Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

The binary diagonal formula for collective F_z

Open
QAlgorithms.Papers.Independent.Intake100.P95.collectiveZBinaryFormula

by Gohan · Oct 30, 2026 · Mathlib 0df444a (Lean v4.33.1)

prove2quantum

Let n≥1n\ge1n≥1 and define Fz=12∑ℓ=1nZℓF_z=\frac12\sum_{\ell=1}^n Z_\ellFz​=21​∑ℓ=1n​Zℓ​, with identities on the other qubits. For a computational basis string b=(b1,…,bn)b=(b_1,\ldots,b_n)b=(b1​,…,bn​), including leading zeroes,

Fz=diag⁡(12∑ℓ=1n(−1)bℓ)b.F_z=\operatorname{diag}\left(\frac12\sum_{\ell=1}^n(-1)^{b_\ell}\right)_b.Fz​=diag(21​ℓ=1∑n​(−1)bℓ​)b​.

Equivalently the iiith diagonal entry in the paper's one-based indexing is obtained from the nnn-digit binary expansion of i−1i-1i−1. The formal index conversion uses the fixed most-significant-bit-first equivalence. This explicit formula keeps both the factor 1/21/21/2 and all nnn digits.

Preamble
import Definitions.Def_QAlgorithms_Papers_Independent_Intake100_P95
Formal statement
namespace QAlgorithms.Papers.Independent.Intake100.P95

open scoped BigOperators

open QAlgorithms.Papers.Independent.Information100.P32 (Op evolution)

open QAlgorithms.Papers.Independent.Advance50.P38 (comm realHSPairing)

open QAlgorithms.Papers.Independent.Information100.P10 (pauli)

open QAlgorithms.Papers.Independent.Claimed50.P03 (wordMatrix wordSupport)

noncomputable section

/-- Lemma 8, PDF p.16, (86)–(89): n binary digits, including leading
zeroes, and the essential factor 1/2. Bit order is the frozen MSB convention;
the diagonal sum itself is invariant under reversing the bit order. -/
theorem collectiveZBinaryFormula {n : ℕ} (hn : 0 < n) :
    collectiveZ n = Matrix.diagonal (fun b : QAlgorithms.Qubits n =>
      (1 / 2 : ℂ) * ∑ k : Fin n, if b k then (-1 : ℂ) else 1) ∧
    (∀ i : Fin (2 ^ n),
      collectiveZ n ((QAlgorithms.bitsEquivFin n).symm i) ((QAlgorithms.bitsEquivFin n).symm i) =
        (1 / 2 : ℂ) * ∑ k : Fin n,
          if ((QAlgorithms.bitsEquivFin n).symm i) k then (-1 : ℂ) else 1) := by sorry

end

end QAlgorithms.Papers.Independent.Intake100.P95
Source
Which Quantum Evolutions Can Be Reversed by Local Unitary Operations? Algebraic Classification and Gradient-Flow-Based Numerical Checks, arXiv:quant-ph/0610061v1, PDF p. 16, Lemma 8: binary formula for collective F_z
Read-back

What the Lean code literally says, in plain math · gpt-6.1-sol

For every natural number n>0n>0n>0, let QQQ be the set of nnn-bit strings and let ZkZ_kZk​ be the matrix acting as diag⁡(1,−1)\operatorname{diag}(1,-1)diag(1,−1), in Boolean order false then true, on bit kkk, and as the identity on every other bit. The matrix Zcoll=12∑k=0n−1ZkZ_{\mathrm{coll}}=\tfrac12\sum_{k=0}^{n-1}Z_kZcoll​=21​∑k=0n−1​Zk​ equals the diagonal matrix whose entry at b∈Qb\in Qb∈Q is 12∑k=0n−1(−1 if bk=true, 1 otherwise)\tfrac12\sum_{k=0}^{n-1}(-1\text{ if }b_k=\mathrm{true},\ 1\text{ otherwise})21​∑k=0n−1​(−1 if bk​=true, 1 otherwise). In addition, for every integer index iii with 0≤i<2n0\le i<2^n0≤i<2n, let b(i)b(i)b(i) be the unique nnn-bit string with i=∑k=0n−11{b(i)k=true}2n−1−ki=\sum_{k=0}^{n-1}\mathbf1_{\{b(i)_k=\mathrm{true}\}}2^{n-1-k}i=∑k=0n−1​1{b(i)k​=true}​2n−1−k, so bit 000 is most significant. Then Zcoll(b(i),b(i))=12∑k=0n−1(−1 if b(i)k=true, 1 otherwise)Z_{\mathrm{coll}}(b(i),b(i))=\tfrac12\sum_{k=0}^{n-1}(-1\text{ if }b(i)_k=\mathrm{true},\ 1\text{ otherwise})Zcoll​(b(i),b(i))=21​∑k=0n−1​(−1 if b(i)k​=true, 1 otherwise), with the scalar and sums regarded as complex numbers.

Human review
  • Endorsed by Shuze Chen · Oct 30, 2026

    Confirmed by the moderator at approval.

  • Endorsed by Gohan · Oct 30, 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