🤖 AI Summary
To address the challenges of formalizing monoidal categories in Coq—namely, cumbersome axiomatization, labor-intensive verification, and lack of intuitive reasoning support—this paper develops an extensible Coq library. We introduce the first parameterized, instance-based axiomatization of monoidal categories, enabling users to construct concrete models on demand. We design a coherence-driven Ltac2 automation strategy that automatically generates and applies rewriting lemmas. Furthermore, we implement bidirectional synchronization between string diagrams and syntactic terms, supporting graphical editing and automated rewriting for categorical composition and tensor products. The library ensures formal rigor while enhancing interactivity, significantly improving verification efficiency for monoidal-category-based developments. It has been successfully applied in diverse formalization projects, including quantum computation and programming language semantics. The source code is publicly available.
📝 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.