AFTD Auto-Formalizing Theoretical Domains

support_mkWithSupport

theoremverifiedimported Lean

Support of a Pauli string built from prescribed data. Fix $n$, a finset $S \subseteq \mathrm{Fin}\,n$, and an assignment $f : S \to \{X,Y,Z\}$ of a non-identity Pauli to each coordinate in $S$. Let $p$ be the Pauli string of length $n$ that equals $f(i)$ at each $i \in S$ and equals the identity $I$ at every coordinate outside $S$. Then the support of $p$ — the set of coordinates where $p$ differs from $I$ — is exactly $S$.

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
lemma support_mkWithSupport {n : ℕ} (S : Finset (Fin n)) (f : S → PauliNZ) :
    support (mkWithSupport S f) = S
Source
TCSlib, `support_mkWithSupport`
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.
Verified
07 Oct 2026
Axioms
Classical.choiceQuot.soundpropext
Built on 4
  • 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…
  • mkWithSupportGiven a finset $S \subseteq \mathrm{Fin}\,n$ and an assignment $f : S \to \mathrm{PauliNZ}$, constructs the Pauli string that equals…
  • supportThe support $\mathrm{supp}(p) \subseteq \mathrm{Fin}\,n$ consists of coordinates where $p(i) \neq I$; the weight is…
  • PauliNZA 3-element type for non-identity single-qubit Pauli operators, used in counting arguments.
Used by 1
  • 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 inopen scoped BigOperators inopen scoped Real inopen scoped Nat inopen scoped Classical inopen scoped Pointwise inset_option maxRecDepth 4000 inset_option synthInstance.maxHeartbeats 20000 inset_option synthInstance.maxSize 128 inset_option relaxedAutoImplicit false inset_option autoImplicit false inopen Complex Matrix inlemma support_mkWithSupport {n : ℕ} (S : Finset (Fin n)) (f : S → PauliNZ) :    support (mkWithSupport S f) = S := by  classical  ext i  simp [support, mkWithSupport, PauliNZ.toBasis_ne_I]
See it in the graphDiscuss this resultChallenge it