CatColab: formal, interoperable, conceptual modeling

Applied Category Theory 2025

Evan Patterson

Topos Institute

2025-06-02

Introducing CatColab

$$

% https://tex.stackexchange.com/a/269194

$$

This talk describes work in progress on CatColab, a collaborative environment for formal, interoperable, conceptual modeling.

formal
models are mathematical objects that can be critiqued with clarity
interoperable
models, and modeling languages, can be interoperated with each other
conceptual
modeling languages are well adapted to concepts used by practitioners

See also the blog post: Introducing CatColab (Carlson 2024)

Outline

  1. Demo
  2. Mathematics behind CatColab

Credits

As of June 2025, the core development team for CatColab is:

  • Kris Brown
  • Kevin Carlson
  • Owen Lynch
  • Jason Moggridge
  • Evan Patterson

I am also grateful for support from colleagues, collaborators, and funders.

For more credits, see: https://catcolab.org/help/credits

Demo

Will a few of the logics currently available in CatColab:

  1. Causal loop diagrams
  2. System structure diagrams, aka primitive stock-flow diagrams
  3. Database schemas

Try it yourself:

  • Stable: https://catcolab.org
  • Bleeding edge: https://next.catcolab.org

Warning

CatColab is early alpha software under active development.

  • Predator-prey model
  • SEIR model
  • CatColab database schema

Mathematics

Mathematical foundation for CatColab is the framework of double theories:

  1. “Cartesian double theories: A double-categorical framework for categorical logic” (Lambert and Patterson 2024)
  2. “Products in double categories, revisited,” Section 10: “Finite-product double theories” (Patterson 2024)

This talks focuses on special cases already implemented in CatColab

Motivation

Formal languages are the syntactic counterpart to categorical structures:

Logic/language Categorical structure
Algebraic theories Cartesian categories
Typed lambda theories Cartesian closed categories
Resource theories Symmetric monoidal categories
Statistical theories Markov categories
… …
  • Many (though not all) of these categorical structures are known to be models of double theories
  • But we’re starting with simpler examples, often not regarded as logics at all

Simple double theories

Definition

A simple double theory is a strict double category.

This is a concept with an attitude, understood as a categorified theory:

  • object = “object type”
  • arrow (vertical morphism) = “operation on objects”
  • proarrow (horizontal morphism) = “morphism type”
  • cell = “operation on morphisms”
  • f = object operation with input type x and output type w
  • α = morphism operation with input type m and output type n

Double theories are usually small double categories, but that is inessential.

Models of simple double theories

Definition

A model of a simple double theory T is

  • a lax double functor M:T→Span, or equivalently
  • a normal lax double functor M:T→Prof

Such models are categorified copresheaves:

Idea 1-dimensional 2-dimensional
Schema/theory Category C Double category D
Semantics Set Span (=Set)
Instance/model Functor C→Set Lax functor D→Span

Discrete double theories

Simplifying still further:

Definition

A discrete double theory is

  • a simple double theory having only trivial arrows and cells, or equivalently
  • a double category of the form Disc(B):=H(B) for some category B

Such a double theory has only object and morphism types, no operations.

Models of discrete double theories are also known as “displayed categories” (Ahrens and Lumsdaine 2019).

Fact

A model of a discrete double theory Disc(B) is equivalent to a category sliced over B:

Lax(Disc(B),Span)≃Cat/B.

Discrete tabulator theories

We now extend discrete double theories with a kind of double limit.

Recall that the tabulator of a profunctor P:C+→D is its category of elements ∫P, having

  • as objects, triples c∈C, d∈D, and p:c⇢d in P;
  • as morphisms (c,d,p)→(c′,d′,p′), morphisms f:c→c′ in C and g:d→d′ in D making the square commute.

Definition

A discrete tabulator theory is a double category with tabulators, having only trivial arrows and cells (identities and projections).

A model of a discrete tabulator theory T is a normal lax functor M:T→Prof that preserves tabulators.

CatColab developer docs: tabulators

Examples

The mathematics behind our examples:

  1. Causal loop diagrams
  2. Database schemas
  3. System structure diagrams

Causal loop diagrams

Causal loop diagrams (and also regulatory networks) are

  • signed graphs, or
  • free signed categories


Let Sgn:={±1}≅Z2 be the group of nonzero signs.

Definition

A signed category is a category C equipped with a functor C→Sgn.

So, the category of signed categories is the slice

SgnCat:=Cat/Sgn.

Aduddell et al. (2024), Section 2.1

Causal loop diagrams via double theories

Theory

The theory of signed categories is the discrete double theory generated by

  • a object type x
  • a morphism type n:x+→x (for “negative”)

subject to the equation n⊙n=idx (where idx:x+→x is “positive”).

Equivalently,

TSgnCat:=Disc(Sgn),

so

Lax(TSgnCat,Span)≃Cat/Sgn=SgnCat.

CatColab developer docs: signed categories

Free signed categories

What’s the point about thinking of signed graphs as free signed categories?

Motifs are morphisms between free signed categories, e.g.,

  • Positive/reinforcing feedback loops are morphisms out of:

  • Negative/balancing feedback loops are morphisms out of:

Aduddell et al. (2024), Section 2.2

Diagrams as free categorical structures

This phenomenon is generic:

Slogan

Diagrammatic languages are free categorical structures whenever it makes sense for arrows to compose.

A famous example:

Example

Petri nets are free symmetric/commutative monoidal categories.

Coming in a future version of CatColab!

On Petri nets and SMCS: Baez et al. (2021)

Database schemas

A basic notion of database schema is a finitely presented profunctor

where Mapping:=HomEntity and AttrOp:=HomAttrType.

In SQL jargon:

  • “Entity” = table
  • “Mapping” = foreign key
  • “Attr” = data attribute
  • “AttrType” = data type, such as TEXT or REAL

Schultz et al. (2017), Patterson, Lynch, and Fairbanks (2022), Roig, Meyers, and Minichiello (2024)

Schemas via double theories

Theory

The theory of profunctors is the “walking proarrow” Disc(2), a discrete double theory freely generated by

  • two objects 0,1
  • one proarrow 0+→1.

A model is a profunctor, either directly or indirectly via “barrels”:

Lax(Disc(2),Span)≃Cat/2.

In future versions of CatColab:

  • Database instances as modules over models of double theories
  • Algebraic databases a la Schultz et al. (2017)

Distributors and barrels on Joyal’s CatLab, esp. Proposition 2.4

System structure diagrams

A system structure diagram, the qualitative counterpart to a stock-flow diagram, consists of:

  • stocks, say of wheat or of people
  • flows, going from an upstream stock to a downstream stock
  • links, going from a source stock to a target flow

In categorical terms, links go from objects to morphisms!

Image: (Meadows 2008, fig. 21)

System structure diagrams via double theories

Theory

The theory of categories with links is the discrete tabulator theory freely generated by

  • an object type x
  • a morphism type ℓ:x+→⊤idx

where ⊤idx denotes the tabulator of the hom-type on x

A system structure diagram is then a free category with links, which implies:

  • Links compose with flows in certain ways to give composite links
  • A richer notion of morphism between system structure diagrams

CatColab developer docs: categories with links

References

Aduddell, Rebekah, James Fairbanks, Amit Kumar, Pablo S. Ocal, Evan Patterson, and Brandon T. Shapiro. 2024. “A Compositional Account of Motifs, Mechanisms, and Dynamics in Biochemical Regulatory Networks.” Compositionality 6 (2). https://doi.org/10.32408/compositionality-6-2.
Ahrens, Benedikt, and Peter LeFanu Lumsdaine. 2019. “Displayed Categories.” Logical Methods in Computer Science 15 (1). https://doi.org/10.23638/LMCS-15(1:20)2019.
Baez, John C., Fabrizio Genovese, Jade Master, and Michael Shulman. 2021. “Categories of Nets.” In 2021 36th Annual ACM/IEEE Symposium on Logic in Computer Science (LICS), 1–13. https://doi.org/10.1109/LICS52264.2021.9470566.
Carlson, Kevin. 2024. “Introducing CatColab.” Topos Institute. 2024. https://topos.site/blog/2024-10-02-introducing-catcolab/.
Lambert, Michael, and Evan Patterson. 2024. “Cartesian Double Theories: A Double-Categorical Framework for Categorical Doctrines.” Advances in Mathematics 444: 109630. https://doi.org/10.1016/j.aim.2024.109630.
Meadows, Donella H. 2008. Thinking in Systems: A Primer. Chelsea Green Publishing.
Patterson, Evan. 2024. “Products in Double Categories, Revisited.” https://arxiv.org/abs/2401.08990.
Patterson, Evan, Owen Lynch, and James Fairbanks. 2022. “Categorical Data Structures for Technical Computing.” Compositionality 4 (5). https://doi.org/10.32408/compositionality-4-5.
Roig, Gabriel Goren, Joshua Meyers, and Emilio Minichiello. 2024. “Presenting Profunctors.” https://arxiv.org/abs/2404.01406.
Schultz, Patrick, David I. Spivak, Christina Vasilakopoulou, and Ryan Wisnesky. 2017. “Algebraic Databases.” Theory and Applications of Categories 32 (16): 547–619. http://www.tac.mta.ca/tac/volumes/32/16/32-16abs.html.
1
CatColab: formal, interoperable, conceptual modeling Applied Category Theory 2025 Evan Patterson 2025-06-02

  1. Slides

  2. Tools

  3. Close
  • CatColab: formal, interoperable, conceptual modeling
  • Introducing CatColab
  • Outline
  • Credits
  • Demo
  • Mathematics
  • Motivation
  • Simple double theories
  • Models of simple double theories
  • Discrete double theories
  • Discrete tabulator theories
  • Examples
  • Causal loop diagrams
  • Causal loop diagrams via double theories
  • Free signed categories
  • Diagrams as free categorical structures
  • Database schemas
  • Schemas via double theories
  • System structure diagrams
  • System structure diagrams via double theories
  • References
  • f Fullscreen
  • s Speaker View
  • o Slide Overview
  • e PDF Export Mode
  • r Scroll View Mode
  • ? Keyboard Help