ViCAR: Visualizing Categories with Automated Rewriting in Coq

We present ViCAR, a library for working with monoidal categories in the Coq proof assistant.ViCAR provides definitions for categorical structures that users can instantiate with their own verification projects.Upon verifying relevant coherence conditions, ViCAR gives a set of lemmas and tactics for manipulating categorical structures.We also provide a visualizer that can display any composition and tensor product of morphisms as a string diagram, showing its categorical structure.This enables graphical reasoning and automated rewriting for Coq projects with monoidal structures. IntroductionJust as category theory provides a unifying framework for diverse concepts in mathematics, category theory can be used in formal verification as a basis for generalization.We can abstract away common structural patterns to yield reusable tactics, lemmas, and techniques for proof assistants.Many constructs that appear in program verification resemble symmetric monoidal categories.ViCAR, a library for Visualizing Categories with Automated Rewriting, takes advantage of the shared structure across symmetric monoidal instances to understand and manipulate morphisms in Coq.ViCAR emerged from Vy ZX, an effort to verify the ZX-calculus, a graphical reasoning system for quantum programs [21].The ZX-calculus [7] forms a symmetric monoidal category whose morphisms are the ZX-diagrams which make up the language.ViCAR generalizes the tools developed in VyZX to assist Coq verification for all concrete monoidal categories.ViCAR consists of three parts: typeclasses for categorical structures in Coq, a visualizer to represent morphisms using string diagrams, and a set of tactics for manipulating typeclass instances.Other popular examples of monoidal categories include the calculus of relations and matrices.The former is the category whose objects are types and morphisms are binary relations.The latter has matrices as its morphisms between vector spaces.The similarities between these examples are initially unclear.Reframing each categorically, however, reveals their shared structure and hints at how the verification of one could help another.To explore and justify this claim, we imported or implemented these instances in Coq then applied ViCAR's monoidal category framework.We found that for a well-developed project, we could easily instantiate the relevant categorical definitions.The tactics and visualization gained were valuable and helped project-specific proofs by removing proof and cognitive overhead.We discuss these examples in more detail in Section 6.ViCAR's key contributions are as follows: We define symmetric monoidal categories in Coq, easily instantiable by user-created structures.

Authors

Institutions

Publication Details

Journal
Electronic Proceedings in Theoretical Computer Science
Published
2025-09-22
DOI
https://doi.org/10.4204/eptcs.429.13
Primary Topic
Semantic Web and Ontologies
Type
article
Field-Weighted Citation Impact
0.00

Funders

Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

ViCAR: Visualizing Categories with Automated Rewriting in Coq

Ben Caldwell, Robert W. Rand, Laura Zielinski, Adrian Lehmann et al.
Electronic Proceedings in Theoretical Computer Science
Semantic Web and Ontologies
article

ViCAR: Visualizing Categories with Automated Rewriting in Coq

Ben Caldwell, Robert W. Rand, Laura Zielinski, Adrian Lehmann, W. Dean Spencer, Bhakti Shah
article en

Abstract

We present ViCAR, a library for working with monoidal categories in the Coq proof assistant.ViCAR provides definitions for categorical structures that users can instantiate with their own verification projects.Upon verifying relevant coherence conditions, ViCAR gives a set of lemmas and tactics for manipulating categorical structures.We also provide a visualizer that can display any composition and tensor product of morphisms as a string diagram, showing its categorical structure.This enables graphical reasoning and automated rewriting for Coq projects with monoidal structures. IntroductionJust as category theory provides a unifying framework for diverse concepts in mathematics, category theory can be used in formal verification as a basis for generalization.We can abstract away common structural patterns to yield reusable tactics, lemmas, and techniques for proof assistants.Many constructs that appear in program verification resemble symmetric monoidal categories.ViCAR, a library for Visualizing Categories with Automated Rewriting, takes advantage of the shared structure across symmetric monoidal instances to understand and manipulate morphisms in Coq.ViCAR emerged from Vy ZX, an effort to verify the ZX-calculus, a graphical reasoning system for quantum programs [21].The ZX-calculus [7] forms a symmetric monoidal category whose morphisms are the ZX-diagrams which make up the language.ViCAR generalizes the tools developed in VyZX to assist Coq verification for all concrete monoidal categories.ViCAR consists of three parts: typeclasses for categorical structures in Coq, a visualizer to represent morphisms using string diagrams, and a set of tactics for manipulating typeclass instances.Other popular examples of monoidal categories include the calculus of relations and matrices.The former is the category whose objects are types and morphisms are binary relations.The latter has matrices as its morphisms between vector spaces.The similarities between these examples are initially unclear.Reframing each categorically, however, reveals their shared structure and hints at how the verification of one could help another.To explore and justify this claim, we imported or implemented these instances in Coq then applied ViCAR's monoidal category framework.We found that for a well-developed project, we could easily instantiate the relevant categorical definitions.The tactics and visualization gained were valuable and helped project-specific proofs by removing proof and cognitive overhead.We discuss these examples in more detail in Section 6.ViCAR's key contributions are as follows: We define symmetric monoidal categories in Coq, easily instantiable by user-created structures.

Electronic Proceedings in Theoretical Computer ScienceVol. 429
University of Chicago (US)
National Science Foundation
Openalex Percentile: Top 87%
Semantic Web and Ontologies
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.