AFTD Auto-Formalizing Theoretical Domains

PauliNZ

inductiveimported Lean

A 3-element type for non-identity single-qubit Pauli operators, used in counting arguments.

Statement

set_option linter.mathlibStandardSet false in
open scoped BigOperators in
open scoped Real in
open scoped Nat in
open scoped Classical in
open scoped Pointwise in
set_option maxRecDepth 4000 in
set_option synthInstance.maxHeartbeats 20000 in
set_option synthInstance.maxSize 128 in
set_option relaxedAutoImplicit false in
set_option autoImplicit false in
open Complex Matrix in
inductive PauliNZ
Defined in
TCSlib, `PauliNZ`
Lean proof
By Allan Li, Hydroxyi (from the file's git history), from github.com/Shilun-Allan-Li/tcslib at c8a02591b1e5 (Apache-2.0). Compiled here against leanprover/lean4:v4.33.1, Mathlib v4.33.1; written for leanprover/lean4:v4.25.0.
What was changed in PauliNZ
--- TCSlib/ErrorCorrectingCodes/QuantumHamming.lean:110 (PauliNZ)
+++ as compiled here
@@ -1,3 +1,14 @@
-/-- A 3-element type for non-identity single-qubit Pauli operators, used in counting arguments. -/
+set_option linter.mathlibStandardSet false in
+open scoped BigOperators in
+open scoped Real in
+open scoped Nat in
+open scoped Classical in
+open scoped Pointwise in
+set_option maxRecDepth 4000 in
+set_option synthInstance.maxHeartbeats 20000 in
+set_option synthInstance.maxSize 128 in
+set_option relaxedAutoImplicit false in
+set_option autoImplicit false in
+open Complex Matrix in
 inductive PauliNZ | X | Y | Z
-deriving DecidableEq, Fintype, Inhabited
+deriving DecidableEq, Inhabited
Verified
07 Oct 2026
Axioms
none listed
Used by 5
  • PauliNZ.toBasis_ne_INon-identity Paulis embed away from the identity. Write $\{X, Y, Z\}$ for the three non-identity Pauli labels, embedded in the natural way…
  • PauliNZ.toBasisEmbeds a non-identity Pauli ($X$, $Y$, or $Z$) from the three-element type $\mathrm{PauliNZ}$ into the full Pauli basis $\{I,X,Y,Z\}$.
  • support_mkWithSupportSupport of a Pauli string built from prescribed data. Fix $n$, a finset $S \subseteq \mathrm{Fin}\,n$, and an assignment…
  • mkWithSupportGiven a finset $S \subseteq \mathrm{Fin}\,n$ and an assignment $f : S \to \mathrm{PauliNZ}$, constructs the Pauli string that equals…
  • card_pauliStringsExactSupportNumber of Pauli strings with a prescribed support. Let $n$ be a natural number and let $S \subseteq \mathrm{Fin}\,n$ be a set of…

Lean source view module on GitHub

set_option linter.mathlibStandardSet false in
open scoped BigOperators in
open scoped Real in
open scoped Nat in
open scoped Classical in
open scoped Pointwise in
set_option maxRecDepth 4000 in
set_option synthInstance.maxHeartbeats 20000 in
set_option synthInstance.maxSize 128 in
set_option relaxedAutoImplicit false in
set_option autoImplicit false in
open Complex Matrix in
/-- A 3-element type for non-identity single-qubit Pauli operators, used in counting arguments. -/
inductive PauliNZ | X | Y | Z
deriving DecidableEq, Inhabited

instance PauliNZ.instFintype : Fintype PauliNZ :=
  ⟨{.X, .Y, .Z}, by intro x; cases x <;> decide⟩
See it in the graphDiscuss this resultChallenge it