VyZX: Formal Verification of a Graphical Quantum Language
Pith reviewed 2026-05-24 06:18 UTC · model grok-4.3
The pith
Inductive graphs from category theory enable formal proofs of ZX-calculus soundness in proof assistants.
A machine-rendered reading of the paper's core claim, the machinery that carries it, and where it could break.
Core claim
Inductive graphs derived from category-theoretic definitions of the ZX-calculus can be used inside a proof assistant to establish the soundness of its rewrite rules, thereby allowing standard inductive proof techniques to be applied to the equational theory of the graphical language without losing its diagrammatic character.
What carries the argument
Inductive graphs in VyZX, constructed from category-theoretic definitions, that represent ZX diagrams and support equational reasoning.
If this is right
- Soundness of ZX rewrite rules is established by induction on the graph structure.
- ZX diagrams and their rewrites become subject to the same proof techniques used for ordinary inductive datatypes.
- An IDE visualizer allows direct graphical manipulation while the underlying proof remains inductive.
- The same library structure can be reused for other inductively presented graphical languages.
Where Pith is reading between the lines
- The technique may transfer to graphical languages used in other domains such as string diagrams for monoidal categories.
- Integration with existing quantum-circuit verifiers could allow mixed graphical and circuit-level proofs.
- Automated tactics that operate directly on the inductive graphs could reduce manual proof effort for large diagrams.
Load-bearing premise
The inductive definitions obtained from category theory match the equational theory of the graphical language exactly, neither adding nor omitting any rewrite equivalences.
What would settle it
A concrete pair of ZX diagrams that are provably equivalent under the standard graphical semantics but not equivalent (or vice versa) under the inductive encoding would falsify the claim.
Figures
read the original abstract
Graphical languages are a convenient shorthand to represent computation, with rewrite rules relating one graph to another. In contrast, proof assistants rely heavily on inductive datatypes, particularly when giving semantics to embedded languages. This creates obstacles to formally reasoning about graphical languages, since imposing an inductive structure obfuscates the diagrammatic nature of graphical languages, along with their corresponding equational theories. To address this gap, we present VyZX, a verified library for reasoning about inductively defined graphical languages. These inductive constructs arise naturally from category-theoretic definitions. We developed VyZX to Verify the ZX-calculus, a graphical langauge for reasoning about quantum computation. The ZX-calculus comes with a collection of diagrammatic rewrite rules that preserve the graph's semantic interpretation. We show how inductive graphs in VyZX are used to prove the soundness of the ZX-calculus rewrite rules and apply them in practice using standard proof assistant techniques. We also provide an IDE-integrated visualizer for proof engineers to directly reason about diagrams in graphical form.
Editorial analysis
A structured set of objections, weighed in public.
Referee Report
Summary. The manuscript presents VyZX, a Coq library for formal reasoning about inductively defined graphical languages. It focuses on the ZX-calculus for quantum computation, using category-theoretic inductive graph constructs to prove soundness of the diagrammatic rewrite rules with respect to the standard interpretation, demonstrates practical application via standard proof-assistant techniques, and supplies an IDE-integrated visualizer.
Significance. Machine-checked soundness proofs for ZX rewrite rules would strengthen the foundations for verified quantum computation tools. The work gives explicit credit to the use of inductive datatypes derived from category theory and standard Coq techniques for applying the verified rules.
major comments (2)
- [§3] §3 (Inductive definition of ZXGraph): the claim that the inductive datatype 'arises naturally from category-theoretic definitions' and accurately captures the equational theory requires an explicit lemma or theorem establishing that the induced rewrite equivalences match those of the standard ZX-calculus (neither adding spurious equalities nor omitting valid diagrammatic rewrites); no such faithfulness result is stated.
- [§5] §5 (Soundness proofs): the soundness theorems are proved inside Coq, but the manuscript supplies no completeness argument or direct comparison of the verified rule set against a reference complete ZX axiomatization (e.g., the known spider-fusion and color-change rules from the literature), leaving open whether the inductive embedding preserves exactly the intended theory.
minor comments (2)
- [Abstract] Abstract: the statement that the library was 'used to prove the soundness' would be strengthened by a brief indication of the size or completeness of the verified fragment.
- [§4] Notation in §4: the mapping from inductive constructors to standard ZX generators (spiders, wires, etc.) could be presented in a single table for easier cross-reference with the rewrite rules.
Simulated Author's Rebuttal
We thank the referee for their careful reading and constructive comments on the manuscript. We respond point-by-point to the major comments below.
read point-by-point responses
-
Referee: [§3] §3 (Inductive definition of ZXGraph): the claim that the inductive datatype 'arises naturally from category-theoretic definitions' and accurately captures the equational theory requires an explicit lemma or theorem establishing that the induced rewrite equivalences match those of the standard ZX-calculus (neither adding spurious equalities nor omitting valid diagrammatic rewrites); no such faithfulness result is stated.
Authors: The inductive datatype ZXGraph follows standard category-theoretic constructions for string diagrams and graphical languages. The soundness results establish that the implemented rewrite rules preserve the standard interpretation and thus introduce no spurious equalities. The manuscript does not claim or prove that the datatype and rule set generate exactly the full equational theory of ZX-calculus (i.e., completeness or faithfulness to every valid diagrammatic rewrite). We will revise §3 to state this scope explicitly and remove any phrasing that could be read as asserting full capture of the equational theory without a dedicated lemma. revision: yes
-
Referee: [§5] §5 (Soundness proofs): the soundness theorems are proved inside Coq, but the manuscript supplies no completeness argument or direct comparison of the verified rule set against a reference complete ZX axiomatization (e.g., the known spider-fusion and color-change rules from the literature), leaving open whether the inductive embedding preserves exactly the intended theory.
Authors: The contribution of §5 is the machine-checked soundness of the supplied ZX rewrite rules inside the inductive framework. No completeness proof or side-by-side comparison against a reference complete axiomatization is present, because the library is intended as a general tool for verifying soundness of user-chosen rules rather than as a claim that the included rule set is complete. We will add a short discussion in the revised §5 clarifying this distinction and noting that the verified rules form a standard sound subset drawn from the ZX literature. revision: yes
Circularity Check
No circularity: soundness proofs target independent external semantics
full rationale
The paper defines inductive graphs from category-theoretic constructions, then uses them to prove soundness of ZX rewrite rules against an external semantic interpretation. No quoted steps reduce a claimed result to a fitted parameter, self-citation chain, or definitional equivalence (e.g., no 'prediction' that is the input by construction). The approach is a standard verification in a proof assistant; the mapping to ZX semantics is presented as an independent check rather than a self-referential derivation. This matches the default expectation of a non-circular verification paper.
Axiom & Free-Parameter Ledger
axioms (1)
- domain assumption Category-theoretic definitions provide inductive structures for graphical languages that preserve their equational theories.
Forward citations
Cited by 2 Pith papers
-
TensorRocq: Enabling diagrammatic reasoning in Rocq
TensorRocq supplies verified Rocq tactics that convert symmetric monoidal category terms to hypergraphs with interfaces, enabling equivalence inference and rewriting based on string-diagram deformations while preservi...
-
Typed compositional quantum computation with lenses
Coq framework with discrete lenses for typed, compositional definition and verification of quantum circuits.
Reference graph
Works this paper leans on
-
[1]
Springer, 326–336. Ambroise Lafont. 2023. A Diagram Editor to Mechanize Categorical Proofs. https://amblafont.github.io/articles/yade.pdf. Liyi Li, Finn Voichick, Kesha Hietala, Yuxiang Peng, Xiaodi Wu, and Michael Hicks. 2022. Verified Compilation of Quantum Oracles. Proceedings of the ACM on Programming Languages 6, OOPSLA2, Article 146 (October 2022), ...
-
[2]
CoqQ : Foundational verification of quantum programs
Better Together: Unifying Datalog and Equality Saturation. arXiv:2304.04332 [cs.PL] Li Zhou, Gilles Barthe, Pierre-Yves Strub, Junyi Liu, and Mingsheng Ying. 2023. CoqQ: Foundational Verification of Quantum Programs. Proceedings of the ACM on Programming Languages 7, POPL, Article 29 (January 2023), 29 pages. https://doi.org/10.1145/3571222 arXiv:2207.113...
discussion (0)
Sign in with ORCID, Apple, or X to comment. Anyone can read and Pith papers without signing in.