Title

Verifiable Foundations for Feedback Structures: Formalising Traced Monoidal Categories in Agda

Introduction

Feedback and recursion are fundamental concepts in programming languages, control systems, and quantum circuits. Traced monoidal categories (TMCs) offer a categorical foundation for modelling such feedback mechanisms. Despite their relevance to fields such as quantum computing and substructural logic, these categories remain under-formalised in modern proof assistants.

In this 42-month PhD project, I will develop a verified formalisation of TMCs in the dependently typed programming language Agda. Building on the work of Hu and Carette [@FormalizingCategoryTheory], I will mechanise the axioms, structure theorems, and advanced constructions associated with TMCs. This work will produce a reusable, verified foundation for feedback structures, supporting applications in AI, quantum computation, and formal semantics.

Background

Basic definitions

A category is an algebraic structure in mathematics that consists of a collection of objects with arrows between them, and an associative composition operator ; subject to further conditions ommitted here. It has seen much use across a wide array of many disciplines, and is a vibrant ongoing research topic, allowing us to connect disperate topics across the formal sciences.

A functor is an operator that connects categories, acting on the objects and arrows together in a way that preserves structure. A natural transformation is a structure preserving map between functors.

Let be a category. An operator is called a monoid if there is a unit object that associates up to isomorphisms, subject to certain conditions that this isomorphism must satisfy. A monoidal category is simply a category with a suitable monoid structure.

Traced Monoidal Category

We call a monoidal category be a left-traced (resp. right-traced) monoidal category, if it is equipped with left (right) trace operator (), for each object in . We call a a traced monidal category if it possesses both left and right traces.

Note that every left-traced category with monoidal operator can be obtained from a right right-traced category with monoidal operator defined such that . This means that it suffice to define just .

A right trace

is a family of natural transformations from the hom-set to such that the following four axioms listed below hold.

Axioms

A right trace must satisfy the following axioms.

Given

Tightening

This states that if a trace passes through an arrow that does’t interact with the trace, then the scope of the trace can be contracted. [@joyalTracedMonoidalCategories1996]

Sliding

This ammounts to sliding a function around a functor around the trace so it ends up occurring before rather than after. [@joyalTracedMonoidalCategories1996]

Vanishing

The first expresses a kindof currying of traces and the second states that a trace functor over the monoidal identity is the identity. [@joyalTracedMonoidalCategories1996]

Strength

This is similar to tightening but in the other dimension. It expresses that arrows which don’t interact with trace, can be taken out of the scope of the trace. [@joyalTracedMonoidalCategories1996]

Balanced Monoidal categories

A monidal category is a braded monoidal category if it has a natural isomorphism , called a braid or crossing. These are subject to two hexagon identities spelled out in [@joyalBraidedTensorCategories1993].

A braided monidal category is a tortile (or ribbon) monidal category if it has a twist natural isomorphism: , and is considered balanced if such that [@joyalGeometryTensorCalculus1991]

A balanced- and traced-monoidal category requires additional two axioms [@joyalTracedMonoidalCategories1996]:

Superimposing

This is, in effect, states that placing the trace f over top of g without interacting or interlacing them is a reversable action, allowing arrows to pass over top of each-other to move horizontally.

Yanking

This provides a way of converting between loops and twists.

Prior Developments

Theoretical Foundations of Traced Monoidal Categories

The formal study of traced monoidal categories (TMCs) originated with Joyal, Street, and Verity’s seminal work, which established the Int construction—a method for embedding TMCs into compact closed categories [@joyalTracedMonoidalCategories1996]. This framework provided a categorical abstraction of feedback loops, unifying diverse applications in linear algebra, knot theory, and programming semantics. Subsequent advances by Hasegawa introduced the uniformity principle, enabling systematic construction of new TMCs from existing ones via full subcategories (e.g., comma categories, coalgebras) [@hasegawaUniformityPrincipleTraced2004]. This principle generalized Plotkin’s fixpoint uniformity to categorical settings, offering tools to propagate traced structures through functorial operations.

Recent breakthroughs by Hu and Vicary recharacterized TMCs as traced pseudomonoids within the bicategory Prof of profunctors [@huTracedMonoidalCategories2021]. Their work externalized TMCs into algebraic structures, enabling graphical reasoning in monoidal bicategories. Key results include equivalence conditions for right -traces and left 1-traces in -autonomous categories and criteria for autonomy [@huFormalizingCategoryTheory2021]. Concurrently, Hasegawa and Lemay advanced the theory of trace-coherent Hopf monads, linking traced monads to symmetric Hopf monads without invoking Eilenberg-Moore categories [@hasegawaTracedMonadsHopf2023]. These developments resolved long-standing questions about monad compatibility but left open challenges in non-Hopf traced monads and autonomy conditions.

Formalization of Monoidal Structures in Proof Assistants

Substantial progress in formalizing category theory has been achieved in Agda, notably through Hu and Carette’s setoid-based, universe-polymorphic library [@huFormalizingCategoryTheory2021]. Their framework supports:

  • Proof-relevant hom-setoids with explicit equality transport, avoiding axiom K dependency.
  • Monoidal category foundations with closed structures and adjunctions.
  • String diagram visualization via ASCII art, though graphical trace operators remain unimplemented.

While this library provides infrastructure for monoidal categories (e.g., naturality proofs, coherence conditions), traced structures are absent. Parallel efforts in Coq’s ViCAR framework developed tactics for rewriting symmetric monoidal diagrams but stopped short of trace operators [@hasegawaUniformityPrincipleTraced2004]. Isabelle/HOL and Lean have basic category theory formalizations but lack monoidal or traced constructs.2

Traced Monads and Algebraic Structures

Lemay’s characterization of traced monads as trace-coherent Hopf monads clarified the relationship between monads and feedback [@hasegawaTracedMonadsHopf2023]. For Cartesian monoidal categories, this connects to Conway operators, while coCartesian settings yield idempotent monads. However, formalizing these results requires reconciling monadic strength with traced axioms, which is a task complicated by universe polymorphism and coherence management.

Gaps and Opportunities

Existing formalizations lack:

  1. Trace Axiomatization: No Agda/Coq implementations of Joyal-Street-Verity’s trace axioms (yanking, vanishing). 2

  2. Int-Construction: Mechanized proofs of the embedding theorem remain open, critical for applications in quantum semantics [@joyalTracedMonoidalCategories1996] [@hasegawaTracedMonoidalClosed2009b].

  3. Hopf Monad Integration: Lemay’s results are yet to be encoded, hindering monad-driven recursion models [@hasegawaTracedMonadsHopf2023].

  4. Performance: Setoid-based equality scales poorly for complex traced diagrams, necessitating optimized tactics. [@huFormalizingCategoryTheory2021]

These gaps form the basis for the proposed research, leveraging prior theoretical and formalization work to advance both TMC theory and verified implementations.

Research Programme

This project is structured around three interlinked strands: foundational formalisation, theoretical development, and application-focused integration.

A. Foundational Formalisation in Agda

  • Axiomatisation of Traced Monoidal Categories: I will implement the Joyal–Street–Verity axioms [@joyalTracedMonoidalCategories1996] in Agda, extending the existing monoidal framework developed by Hu and Carette [@FormalizingCategoryTheory].
  • Braiding and Tortile Structure: I will incorporate braiding and ribbon structures [@reshetikhinRibbonGraphsTheir1990] by adding cross twist operators and verifying the associated coherence laws.
  • Universe Polymorphism and Coherence: I will use setoid-based equality [@kinoshitaCategoryTheoreticStructure2014] and universe polymorphism to ensure cross-level compatibility [@FormalizingCategoryTheory].

B. Theoretical Contributions

  • Structure Theorem Mechanisation:
    • I will formalise the Int-construction [@joyalTracedMonoidalCategories1996] [@hasegawaTracedMonoidalClosed2009b], a generalisation of the Grothendiek Construction of integers [@grothendieckRevetementsEtalesGroupe1971], as a higher inductive type using definitions compatible with Cubical Agda [@vezzosiCubicalAgdaDependently2021].
    • I will prove formally that every TMC embeds into a compact closed category [@dayNoteCompactClosed1977] [@joyalTracedMonoidalCategories1996].
  • Hopf Monad Characterisation:
    • I will mechanise the connection between traced monads and Hopf monads [@bruguieresHopfMonads2007] [@hasegawaRecursionCyclicSharing1997].
  • -Autonomous Equivalence:
    • I will verify Hu and Vicary’s duality between left -trace and right 1-trace in -autonomous categories [@huTracedMonoidalCategories2021].
  • Exploration of Open Problems:
    • I will construct and collect a wide array of examples and counterexamples of various counter examples that satisfy some or all of the braiding, tortile, and trace monoidal axioms to ensure correctness of definitions and applicability across domains.
    • I will formalise conditions under which traced -autonomous categories become fully autonomous [@huTracedMonoidalCategories2021] [@PDFQuantumCategories].

C. Applications and Integration

  • Quantum Feedback:
    • I will interface with the Quantum IO Monad and implement traced structures for quantum gates and monoidal streams [@dilavoreMonoidalStreamsDataflow2022] [@PDFQuantumCategories] [@greenFormallyVerifiedFunctional2010].
  • Recursive Semantics:
    • I will apply TMC formalisation to fixed-point models in substructural logics [@woodFrameworkSubstructuralType2022].
  • AI and Systems:
    • I will provide a verified categorical foundation for recursive neural architectures and feedback in AI-enhanced operating systems.

Innovation & Impact

Theoretical Advances

  • First full formalisation of the Int-construction [@hasegawaTracedMonoidalClosed2009b].
  • Verified treatment of trace in both planar and spherical categorical settings [@huTracedMonoidalCategories2021].
  • Formal counterexamples to long-standing conjectures on traced monads may provide new perspectives on monoidal recursion and duality.

Practical Contributions

  • Agda Library: I will deliver a reusable, extensible module for any combination of balanced and traced monoidal categories in Agda.
  • Tooling for Applied Researchers: The resulting library will support safer reasoning about feedback and recursion in quantum computing, linear logic, and category-theoretic programming.

This work will position Agda as a leading platform for formal category theory and advance the practical verification of high-level mathematical structures in computing.

Timeline & Deliverables

QuarterMilestone
1–4Base TMC axiomatisation, compatibility proofs
5–8Int-construction formalisation, Hopf monad interface
9–12Quantum feedback case study, performance optimisations
13–16Non-Hopf monad counterexamples, autonomy conditions
17–20Recursive semantics integration, documentation
21–24Final verification, library release, tutorial materials

Anticipated Challenges

  1. Universe Management: I will ensure that constructions like the Int-construction remain size-polymorphic and avoid unnecessary universe escalation [@FormalizingCategoryTheory].
  2. Equational Reasoning: I will address the difficulty of verifying string diagram equivalences efficiently and ergonomically within Agda, such as by leveraging my professional experience to create a web-based too to translate between string diagrams and Agda equational reasoning.
  3. Performance Bottlenecks: I will identify and optimise any performance limitations that arise during automated checking of trace axioms via Agda’s pattern matching.

Conclusion

This project will deliver the first complete mechanisation of traced monoidal categories in any proof assistant, opening the door to formal verification of feedback-driven structures in mathematics and computer science. By integrating verified categorical models with emerging developments in quantum computing and AI systems, I will contribute both theoretical insight and practical infrastructure for future research in high-assurance computing.


Citations

Footnotes

  1. This should be an upside down ampersand. 2

  2. This was concluded from a text search for “Traced Monoidal formalisation source” (without quotes) in the search engine https://duckduckgo.com/, which turned up no relevant source code results or discuss about the formalisation on the first 5 pages. 2