Second Virtual Workshop on Double Categories
2024-10-29
$$
% https://tex.stackexchange.com/a/269194
$$
My personal favorite answers:
This talk is mostly about (3).
For (1), see blog post: Why double categories? Part 1
Originates with Lawvere’s functorial semantics of algebraic theories:
Logic | Category theory |
---|---|
algebraic theory | category \(\mathsf{T}\) with finite products |
model of theory | functor \(M: \mathsf{T} \to \mathsf{Set}\) preserving finite products |
model homomorphism | natural transformation \(M \Rightarrow N\) |
Lawvere (1963)
A minimalist account of relational databases:
Logic | Category theory |
---|---|
schema | small category \(\mathsf{C}\) |
instance of schema | functor \(X: \mathsf{C} \to \mathsf{Set}\) |
morphism of instances | natural transformation \(X \Rightarrow Y\) |
Already enough to produce notable capabilities, such as Spivak’s functorial data migration.
Spivak (2012)
Logic | Category theory |
---|---|
theory \(\mathsf{T}\) | category \(\mathsf{T}\) with extra structure |
model of \(\mathsf{T}\) in \(\mathsf{S}\) | structure-preserving functor \(M: \mathsf{T} \to \mathsf{S}\) |
model morphism | structure-preserving natural transformation \(M \Rightarrow N\) |
Categorical logic is two-dimensional:
A sleight of hand in that story:
If we take this seriously, we might propose a different dictionary:
Logic | Category theory |
---|---|
theory \(\mathsf{T}\) | category \(\mathsf{T}\) with extra structure |
model of \(\mathsf{T}\) | structure-preserving module (copresheaf) over \(\mathsf{T}\) |
model morphism | structure-preserving module homomorphism |
Let us refine the dictionary of categorical logic:
But the latter are special kinds of bimodules or profunctors. So the two concepts are united within a double category!
Our starting point:
A categorical logic (doctrine) is a double category of categories equipped with extra structure.
This talk is about a systematic way to work with such categorical logics.
Joint work with Michael Lambert.
Main references:
A lax functor
\[ F: \mathbb{1} \to \mathbb{S}\mathsf{pan}\]
is the same thing as a small category.
Moreover, a natural transformation is the same thing as a functor:
Second observation doesn’t work for lax functors between bicategories!
Generalizing from the terminal double category:
Proposition
Let \(\mathbb{D}\) be a strict double category and let \(F: \mathbb{D} \to \mathbb{S}\mathsf{pan}\) be a lax functor.
For each object \(x \in \mathbb{D}\), the data \((Fx, F\mathrm{id}_x, F_{x,x}, F_x)\) is a category
For each arrow \(f: x \to y\) in \(\mathbb{D}\), the data \((Ff, F\mathrm{id}_f)\) is a functor
For each special cell \(\alpha\) in \(\mathbb{D}\), the image \(F\alpha\) is a natural transformation:
Lambert and Patterson (2024), Section 2
Proposition
Let \(\mathbb{D}\) be a strict double category and let \(F: \mathbb{D} \to \mathbb{S}\mathsf{pan}\) be a lax functor.
For each proarrow \(m: x \mathrel{\mkern 3mu\vcenter{\hbox{$\scriptstyle+$}}\mkern-13mu{\to}}y\) in \(\mathbb{D}\), the data \((Fm, F_{x,m}, F_{m,y})\) is a bimodule, i.e., a profunctor
For each cell \(\alpha\) in \(\mathbb{D}\), the image \(F\alpha\) is a bimodule homomorphism, i.e., a natural transformation
These are the basic notions of category theory! Moreover, replacing \(\mathbb{S}\mathsf{pan}\) with:
Lambert and Patterson (2024), Section 2
With this motivation, we propose that:
For a fixed double theory \(\mathbb{T}\), there will be a (possibly virtual) double category, even a (virtual) equipment, with:
A new dictionary—note the level shift!
Meta-logic | Double category theory |
---|---|
logic | double theory |
theory | model of double theory |
interpretation between theories | model morphism |
model of theory | module/instance over model |
model homomorphism | module/instance homomorphism |
In order of increasing expressivity:
Definition
A simple double theory is a small, strict double category.
This is a concept with an attitude, understood as a categorified theory:
Lambert and Patterson (2024), Section 3
Definition
A model of a simple double theory \(\mathbb{T}\) is
Recall that unitary means that the unitors are identities (Grandis 2019, sec. 3.5.2).
The theory of monads is the simple double theory generated by
an object \(x\)
an arrow \(t: x \to x\)
multiplication and unit cells
subjects to three equations expressing associativity and unitality.
Lambert and Patterson (2024), Theory 3.8
E.g., the associativity axiom:
\[=\]
Fact
A model of the theory of monads is precisely a category \(\mathsf{C}\) along with a monad \((T,\mu,\eta)\) on \(\mathsf{C}\).
Lambert and Patterson (2024), Theory 3.8
Concept | Definition |
---|---|
Simple double theory | Small, strict double category \(\mathbb{T}\) |
Model of simple double theory | Lax functor \(F: \mathbb{T} \to \mathbb{S}\mathsf{pan}\) |
Morphism between models (strict, pseudo, op/lax) | (Strict, pseudo, op/lax) natural transformation \(\alpha: F \Rightarrow G\) |
Bimodule between models | Module \(M: F \mathrel{\mkern 3mu\vcenter{\hbox{$\scriptstyle\mid$}}\mkern-8mu{\Rightarrow}}G\) |
Cell between morphisms/bimodules | Modulation |
Concept | Definition |
---|---|
Cartesian double theory | Small, cartesian, strict double category \(\mathbb{T}\) |
Model of theory | Cartesian lax functor \(F: \mathbb{T} \to \mathbb{S}\mathsf{pan}\) |
Model morphism (strict, pseudo, op/lax) | Cartesian (strict, pseudo, op/lax) natural transformation \(\alpha: F \Rightarrow G\) |
Model bimodule | Cartesian module \(M: F \mathrel{\mkern 3mu\vcenter{\hbox{$\scriptstyle\mid$}}\mkern-8mu{\Rightarrow}}G\) |
Cell | Modulation |
Lambert and Patterson (2024), Section 6
The theory of pseudomonoids is the cartesian double theory generated by
an object \(x\)
arrows \(\otimes: x^2 \to x\) and \(I: 1 \to x\)
associator and unitor cells, along with their external inverses,
subject to two equations, the pentagon and triangle identities.
A model of the theory of pseudomonoids is a (weak) monoidal category.
Two of the logics currently available in CatColab:
Try it yourself: https://catcolab.org
Warning
CatColab is pre-alpha software under active development.
CatColab v0.1 was developed in collaboration with:
I am also grateful for support from other colleagues at Topos Institute and our collaborators and funders.
See also the blog post Introducing CatColab (Carlson 2024)
Simplifying still further from simple double theories:
Definition
A discrete double theory is
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 \(\mathbb{D}\mathsf{isc}(\mathsf{B})\) is equivalent to a category sliced over \(\mathsf{B}\):
\[ \mathsf{Lax}(\mathbb{D}\mathsf{isc}(\mathsf{B}), \mathbb{S}\mathsf{pan}) \simeq \mathsf{Cat}/\mathsf{B}. \]
Causal loop diagrams (and also regulatory networks) are
Let \(\mathsf{Sgn}:= \{\pm 1\} \cong \mathbb{Z}_2\) be the group of nonzero signs.
Definition
A signed category is a category \(\mathsf{C}\) equipped with a functor \(\mathsf{C} \to \mathsf{Sgn}\).
So, the category of signed categories is the slice
\[ \mathsf{SgnCat} := \mathsf{Cat}/\mathsf{Sgn}. \]
Aduddell et al. (2024), Section 2.1
Theory
The theory of signed categories is the discrete double theory generated by
subject to the equation \(n \odot n = \mathrm{id}_x\) (where \(\mathrm{id}_x: x \mathrel{\mkern 3mu\vcenter{\hbox{$\scriptstyle+$}}\mkern-13mu{\to}}x\) is “positive”).
Equivalently,
\[ \mathbb{T}_{\mathsf{SgnCat}} := \mathbb{D}\mathsf{isc}(\mathsf{Sgn}), \]
so
\[ \mathsf{Lax}(\mathbb{T}_{\mathsf{SgnCat}}, \mathbb{S}\mathsf{pan}) \simeq \mathsf{Cat}/\mathsf{Sgn} = \mathsf{SgnCat}. \]
CatColab developer docs: 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
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)
A basic notion of database schema is a finitely presented profunctor
where \(\mathrm{Mapping} := \mathrm{Hom}_{\mathrm{Entity}}\) and \(\mathrm{AttrOp} := \mathrm{Hom}_{\mathrm{AttrType}}\).
In SQL jargon:
Theory
The theory of profunctors is the “walking proarrow” \(\mathbb{D}\mathsf{isc}(\mathsf{2})\), a discrete double theory freely generated by
A model is a profunctor, either directly or indirectly via “barrels”:
\[ \mathsf{Lax}(\mathbb{D}\mathsf{isc}(\mathsf{2}), \mathbb{S}\mathsf{pan}) \simeq \mathsf{Cat}/\mathsf{2}. \]
In future versions of CatColab:
Distributors and barrels on Joyal’s CatLab, esp. Proposition 2.4
The system should enable formal, interoperable, conceptual modeling in domain-specific logics
Intended users have variable levels of technical expertise and might be…
CatColab is a structure editor for categorical structures:
Interpolates between text editors and fully graphical editors:
Hypothesis
It is possible and practical to build a structure editor for collaborative modeling that is ergonomic, yet parametric over the logic.
Another example is Hazel, a structure editor for functional programs (Omar et al. 2017)
We emphasize formal modeling, but informal narrative is indispensable.
CatColab has a notebook-style interface, mixing
Note
Interface familiar from computational notebooks like Jupyter but very different execution model: