Published 4 Apr 2026 in quant-ph and cs.LO | (2604.03884v1)
Abstract: Violation of the Clauser-Horne-Shimony-Holt (CHSH) inequality certifies genuine quantum correlations. In this work, we formalize in Lean 4 the rigidity theorem -- any strategy achieving near-optimal CHSH value must be locally isometric to the canonical qubit strategy. In the course of formalization, we identified a gap in the argument of McKague, Yang, and Scarani (arXiv:1203.2976).
The paper presents a modular formalization in Lean 4 that rigorously proves the robust CHSH rigidity theorem with explicit error bounds.
It introduces concrete operator bounds and step-by-step isometry constructions, ensuring that a near-optimal CHSH violation implies closeness to the ideal Bell state.
The work uncovers and corrects a gap in previous literature, demonstrating the critical role of machine-checked proofs in quantum self-testing protocols.
Formal Verification of CHSH Rigidity in Lean 4
Introduction
The CHSH (Clauser-Horne-Shimony-Holt) rigidity theorem is central in quantum information theory, certifying that near-optimal violation of the CHSH inequality—an experimentally accessible test for quantum nonlocality—implies that the realizing strategy must be isometric to the canonical two-qubit (EPR pair) strategy, up to local isometric embeddings and an uncorrelated junk register. The formalization of this theorem in a proof assistant is not merely a check of correctness but also exposes implicit assumptions and possible errors in the hand proofs.
This paper presents a comprehensive and modular formalization of the robust CHSH rigidity theorem in Lean 4, illustrating both proof architecture and formalization techniques. The development reveals and amends a subtle but genuine gap in the original argument of McKague et al. (2012), and supplies explicit isometry constructions and intertwining relations tailored for formal verification.
Technical Contributions
Modular Formalization in Lean 4
The development decomposes the rigidity statement into four compositional steps, each formalized independently in Lean:
CHSH near-optimality: If the observed CHSH value is within ε of Tsirelson's bound (22​), all subsequent estimates proceed with explicit error tracking.
Expectation bound for extracted qubits: A formal spectral analysis relates the near-maximal expectation to the overlap of the extracted physical state with the canonical Bell state.
State extraction: Construction of local isometries VA​ and VB​ that attach qubit ancillae and apply unitaries formed from controlled-reflection circuits. The regrouping (via explicit isometric linear maps) ensures direct comparison with the Bell basis.
Operator extraction: Rigorous intertwining relations between the physical observables and their extracted counterparts are established, bounding the norm of their action on the state vector and controlling error accumulation throughout.
The main rigidity theorem is assembled from these in Lean, ensuring each technical lemma is reusable and that all tensor reshufflings are tracked explicitly.
Identification and Correction of a Literature Gap
A technical error is identified in the treatment by McKague et al., specifically regarding the definition of Bob's extracted observables when the sum or difference B0​±B1​ is singular. The original proof relies on a kernel convention that is not generally safe, as evidenced by a dimension-2 counterexample. This oversight can lead to incorrect claims about anticommutator properties of the extracted operators.
The Lean formalization circumvents this issue entirely by constructing Bob's isometry through a designed single-qubit rotation, embedding the change of basis into both the extraction circuit and the ancilla initialization, thus ensuring the observables remain well-defined and unitary.
Explicit Extraction Circuits and Tensor Reshuffling
On each side, the extraction isometry is built from a sequence of controlled-reflection operations and Hadamard (and, for Bob, an appropriate single-qubit rotation) gates. The regrouping of tensor factors, which is often only implicit in informal arguments, is formalized as explicit linear isomorphisms (e.g., regSwap in the Lean code).
The state extraction error is quantitatively analyzed, giving explicit upper bounds for the distance (in Hilbert-Schmidt norm) between the extracted and ideal Bell-pair state, as well as for the deviation of the extracted observable actions from their canonical forms.
The Main Rigidity Statement
The central formalized result is an explicit robust CHSH rigidity theorem:
The extracted actions of 22​1 are 22​2-close to 22​3 (where 22​4 are appropriate Pauli combinations), respectively, on the Bell state, tensored with the junk.
Critical to this result are the concrete operator bounds, with explicit constants that can be referenced for quantitative self-testing applications.
Practical and Theoretical Implications
Verified Quantum Self-Testing
The Lean formalization raises the reliability standard for self-testing results in quantum information, where calculations and tensorial arguments are prone to subtle errors. This work not only certifies the correctness of the main theorem, but also supplies machine-checked reusable modules—such as controlled gate devices, isometry constructions, and spectral norm bounds—for further work in device-independent quantum protocols.
Error Detection and Proof Quality
The identification of a gap in a widely cited self-testing proof demonstrates that formal verification can detect nontrivial mathematical mistakes in established literature, even in largely accepted results. This raises the possibility that future work in quantum nonlocality and device-independent cryptography will require machine-verifiable arguments to build rigorous foundations.
Lean Quantum Foundations Ecosystem
The technical development leverages and extends the Lean Mathlib library, anchoring quantum information formalization in the broader mathematical repository. The interplay between foundation design (choosing the tensor and isometry conventions) and proof automation is highlighted, with AI code assistants streamlining formalization, especially after algebraic structures are made manifest in theorem statements.
Outlook and Future Directions
Expansion of Quantum Information Formalizations: The modular style adopted facilitates extension to other rigidity and self-testing theorems, as well as integration with other formalized quantum protocols in Lean.
Agentic Autoformalization: The workflow, which includes LLM-based assistants, aligns with emerging trends in automated proof search and formalization, suggesting future proofs of quantum information results could be fully automated or at least significantly accelerated (Ren et al., 18 Feb 2026).
Standardization of Best Practices: The detailed handling of tensor regroupings and the explicit construction of all intermediate maps are likely to set best-practice standards for future formalizations of multi-party quantum protocols.
Conclusion
This work provides a full-fledged, machine-checked formalization of robust CHSH rigidity in Lean 4, addressing both proof-theoretical and practical implementation aspects. Through explicit isometry constructions, modular proof decomposition, and careful error control, it secures the logical foundation of self-testing via CHSH in quantum information theory. The exposure and resolution of a gap in the original literature further underscore the role of formalization as an instrument of mathematical discovery and quality assurance. This approach is likely to become standard in future foundational quantum information research.
“Emergent Mind helps me see which AI papers have caught fire online.”
Philip
Creator, AI Explained on YouTube
Sign up for free to explore the frontiers of research
Discover trending papers, chat with arXiv, and track the latest research shaping the future of science and technology.Discover trending papers, chat with arXiv, and more.