Metacat: a categorical framework for formal systems
2026-04-09 • Logic in Computer Science
Logic in Computer Science
AI summaryⓘ
The authors develop a new mathematical framework using category theory to describe formal logical systems and their inference rules. They represent rules as operations with inputs and outputs linked by metavariables, allowing proofs to be built by substituting these metavariables. This approach forms a structured system that can be checked automatically, and they provide a software tool to define and work with these formal systems. As a test, they encode first-order logic within their framework and show example proofs.
category theoryformal systemsinference rulesmetavariablescartesian PROPsymmetric monoidal categoryproof checkingMetamathfirst-order logicsubstitution
Authors
Paul Wilson
Abstract
We present a categorical framework for formal systems in which inference rules with $m$ metavariables over a category of syntax $\mathscr{S}$, taken to be a cartesian PROP, are represented by operations of arity $k \to n$ equipped with spans $k \leftarrow m \to n$ in $\mathscr{S}$, encoding the hypotheses and conclusions in a common metavariable context. Composition is by substitution of metavariables, which is the sole primitive operation, as in Metamath. Proofs in this setting form a symmetric monoidal category whose monoidal structure encodes the combination and reuse of hypotheses. This structure admits a proof-checking algorithm; we provide an open-source implementation together with a surface syntax for defining formal systems. As a demonstration, we encode the formulae and inference rules of first-order logic in Metacat, and give axioms and representative derivations as examples.