CatColab: A category-theoretic environment for collaborative modeling

Joint Mathematics Meeting 2025

Evan Patterson

Topos Institute

2024-01-08

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)

Universality vs particularity

  • Tech often aspires to be universal (UML, Semantic Web, AGI)
  • But by trying to do everything, ends up doing nothing particularly well
  • Domain- or problem-specific tools can be very fit for purpose
  • But are often silos, leading to fragmentation and duplication


Rather than a “theory of everything,” CatColab aims to be a “general theory of specific things”:

  • Provide logics well adapted to specific domains and tasks…
  • …yet sharing functionality and tooling and, when possible, interoperable
  • achieved using a metalogic based on two-dimensional category theory

Outline

  1. Demo
  2. Mathematics behind CatColab

Credits

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

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

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

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

Demo

Will show two of the logics currently available in CatColab:

  1. Causal loop diagrams
  2. Database schemas

Try it yourself:

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

Warning

CatColab is pre-alpha software under active development.

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.

Examples

The mathematics behind our two examples:

  1. Causal loop diagrams
  2. Database schemas

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

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.
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: A category-theoretic environment for collaborative modeling Joint Mathematics Meeting 2025 Evan Patterson 2024-01-08

  1. Slides

  2. Tools

  3. Close
  • CatColab: A category-theoretic environment for collaborative modeling
  • Introducing CatColab
  • Universality vs particularity
  • Outline
  • Credits
  • Demo
  • Mathematics
  • Motivation
  • Simple double theories
  • Models of simple double theories
  • Discrete double 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
  • References
  • f Fullscreen
  • s Speaker View
  • o Slide Overview
  • e PDF Export Mode
  • r Scroll View Mode
  • ? Keyboard Help