AFTD Auto-Formalizing Theoretical Domains

xz_pauli

def

The function xz_pauli : Fin 2 → Fin 2 → PauliBasis taking two curried arguments a, b : Fin 2, mapping a = 0, b = 0 to PauliBasis.X; a = 0, b = 1 to PauliBasis.Y; a = 1, b = 0 to PauliBasis.I; and a = 1, b = 1 to PauliBasis.Z.

Statement

def xz_pauli (a b : Fin 2) : PauliBasis
Defined in
arXiv:2610.20846, Appendix C
Verified
01 Nov 2026
Axioms
none listed
Built on 1
  • PauliBasisThe four Pauli basis elements $\{I,X,Y,Z\}$, represented as an inductive type.
Used by 4
  • xz_transfer_matrixThe 16x16 transfer matrix M whose entries M u v are given by the trace of the 4-fold product of Pauli matrices (xz_pauli (u 0) (v…
  • xz_replica_transfer_matrixxz_replica_transfer_matrix q : Matrix (Fin (2*q) → Fin 2) (Fin (2*q) → Fin 2) ℂ, with entry…
  • xz_pauli_stringThe function xz_pauli_string (L : ℕ) : (Fin L → Fin 2) → PauliString L mapping a configuration a : Fin L → Fin 2 to the Pauli string…
  • xz_rho_trace_oneFor every natural number L with 1 ≤ L, the trace of the reduced density matrix xz_rho L equals 1: Matrix.trace (xz_rho L) = 1.

Read back from the Lean

The function xz_pauli takes two elements a, b : Fin 2 and returns an element of PauliBasis (which has four constructors: I, X, Y, Z): - If a.val = 0 and b.val = 0, it returns PauliBasis.X. - If a.val = 0 and b.val ≠ 0 (i.e., b.val = 1), it returns PauliBasis.Y. - If a.val ≠ 0 (i.e., a.val = 1) and b.val = 0, it returns PauliBasis.I. - If a.val ≠ 0 (i.e., a.val = 1) and b.val ≠ 0 (i.e., b.val = 1), it returns PauliBasis.Z.

Written by a model that saw only the Lean, never the English above. If the two disagree, that is worth a challenge.

Lean source view module on GitHub

/-- The single-qubit Pauli basis assignment M_(a,b) sending (0,0) to X, (0,1) to Y, (1,0) to I, and (1,1) to Z. -/
def xz_pauli (a b : Fin 2) : PauliBasis := if a.val = 0 then
    if b.val = 0 then PauliBasis.X else PauliBasis.Y
  else
    if b.val = 0 then PauliBasis.I else PauliBasis.Z
See it in the graphDiscuss this resultChallenge it