<?xml version="1.0" encoding="UTF-8"?>
<rss  xmlns:atom="http://www.w3.org/2005/Atom" 
      xmlns:media="http://search.yahoo.com/mrss/" 
      xmlns:content="http://purl.org/rss/1.0/modules/content/" 
      xmlns:dc="http://purl.org/dc/elements/1.1/" 
      version="2.0">
<channel>
<title>Topos Institute</title>
<link>https://topos.institute/blog/</link>
<atom:link href="https://topos.institute/blog/index.xml" rel="self" type="application/rss+xml"/>
<description></description>
<generator>quarto-1.8.26</generator>
<lastBuildDate>Fri, 26 Jun 2026 00:00:00 GMT</lastBuildDate>
<item>
  <title>Blog / Our Summer Research Associates in 2026</title>
  <dc:creator>Molly White</dc:creator>
  <link>https://topos.institute/blog/2026-06-29-summer-research-associates-2026/</link>
  <description><![CDATA[ 





<p>The arrival of a new group of Summer Research Associates (RAs) is always a highlight of the year at Topos. Alongside their research abilities and technical expertise, they bring fresh perspectives that strengthen our culture and broaden the conversations taking place across the organization. These appointments are an important part of our efforts to support emerging researchers and build a vibrant academic community. We are thrilled to welcome this year’s cohort.</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><a href="2026-group.jpg" class="lightbox" data-gallery="quarto-lightbox-gallery-1" title="The 2026 Summer RAs, from left to right: Michael, Matt, Aaron, Bryce, and Khyathi"><img src="https://topos.institute/blog/2026-06-29-summer-research-associates-2026/2026-group.jpg" class="img-fluid figure-img" alt="The 2026 Summer RAs, from left to right: Michael, Matt, Aaron, Bryce, and Khyathi"></a></p>
<figcaption>The 2026 Summer RAs, from left to right: Michael, Matt, Aaron, Bryce, and Khyathi</figcaption>
</figure>
</div>
<hr>
<p><a href="https://www.rntz.net/"><strong>Michael Arntzenius</strong></a> is a postdoc at UC Berkeley studying programming languages, database query languages, and how to combine them. He’s also interested in incremental computation: how to do less work by reusing old work and paying attention to what changed.</p>
<p><a href="https://cuffaro.srht.site/"><strong>Matt Cuffaro</strong></a> is research software developer and an incoming Masters student in Mathematics at the University of Florida. He’s at Topos this summer collaborating with Evan Patterson and Kevin Carlson to support “instances of modal double models” in CatColab, a type of document whose objects are instantiations of objects in other model. This brings CatColab closer to one motivating goal, which is compiling instance documents into systems of differential equations.</p>
<p><a href="https://aaron-huntley.github.io"><strong>Aaron Huntley</strong></a> is a 2nd Year pure math PhD student at Case Western Reserve University. They are trying to understand connections between various kinds of double (co)limits and a theory of double presentability. This summer they have begun working with Evan and Kevin defining unbiased (co)products for virtual double categories using the family construction. Outside of math Aaron loves to play and watch soccer, explore the world, and learn different languages.</p>
<p><strong>Bryce Goldman</strong> is an engineering RA working on CatColab’s Double TT project with Evan Patterson this summer. He will be implementing a DSL for specifying modal theories and refining the TT package using a type theory for virtual double categories. Bryce recently completed his M.S. in computer science at Stanford, and is broadly interested in compilers, programming languages, and formal methods (and applications of category theory therein).</p>
<p><a href="https://khyathikomalan.github.io"><strong>Khyathi Komalan</strong></a> is a rising junior studying mathematics at Caltech. She enjoys thinking about ways to use category theory to solve structural problems in quantum field theory. This summer, she is working with Kevin Carlson and Brendan Fong to make DOTS more accessible by creating expository materials and a worked example of a safeguarded AI workflow. Outside of math and physics, she spends her time exploring different cuisines, urban exploring, and having philosophical discussions with friends.</p>



<script defer="" src="https://comments.topos.institute/comentario.js"></script>

 ]]></description>
  <category>Topos</category>
  <category>personnel</category>
  <guid>https://topos.institute/blog/2026-06-29-summer-research-associates-2026/</guid>
  <pubDate>Fri, 26 Jun 2026 00:00:00 GMT</pubDate>
</item>
<item>
  <title>Blog / Geometric Type Theory, Done Two Ways</title>
  <dc:creator>Mitchell Riley</dc:creator>
  <link>https://topos.institute/blog/2026-06-15-geometric-type-theory-done-two-ways/</link>
  <description><![CDATA[ 





<p>In a <a href="../../blog/2025-07-13-liberating-synthetic-quasi-coherence-from-forcing/#dreaming-of-homotopy-types">previous post</a>, David Jaz outlined a vision of a type theory for working in the internal language of <em>all toposes</em>. Now I’d like to nibble at this: how can we represent geometric theories in syntax?</p>
<p>David Jaz and I are not the only ones circling this idea: Steven Vickers <a href="https://sjvickers.github.io/GeoAspects.pdf">has</a> <a href="https://sjvickers.github.io/LocTopSpaces.pdf">long</a> <a href="https://arxiv.org/abs/2206.01113">advocated</a> for finding a good syntax for geometric theories, in which one could do purely “continuous mathematics”. Johannes Schipp von Branitz and Ulrik Buchholtz have recently been <a href="https://hott-uf.github.io/2025/slides/Schipp_von_Branitz.pdf">investigating</a> what ought to be the propositional fragment of a larger geometric type theory. Taichi Uemura also has a set of <a href="https://uemurax.github.io/synthetic-topos-theory/index.html">notes</a> that describe a type theory for working with toposes synthetically.</p>
<p>These last two works intend to be modelled in sheaves on the category of all toposes, with a suitable topology. I’ll do something simpler, and just describe a syntax intended to be modelled in toposes directly.</p>
<p>There’s a lot of past work on describing theories of various kinds, or of adding sorts with more structure to first-order logic. To name a few, we have <a href="https://doi.org/10.1016/0168-0072(86)90053-9">Generalised Algebraic Theories</a>, <a href="https://www.math.mcgill.ca/makkai/folds/foldsinpdf/FOLDS.pdf">First-Order Logic with Dependent Sorts</a> (FOLDS) and the similar <a href="https://kwarc.info/people/frabe/Research/rabe_dfol_06.pdf">DFOL</a>, picked up by and analysed by <a href="https://arxiv.org/abs/1605.01586v2">Palmgren</a>.</p>
<!-- TODO: More links maybe:  -->
<!-- https://www.cs.man.ac.uk/~petera/Marseille-abstract.pdf -->
<!-- https://projecteuclid.org/journals/journal-of-symbolic-logic/volume-71/issue-1/The-generalised-type-theoretic-interpretation-of-constructive-set-theory/10.2178/jsl/1140641163.short -->
<!-- http://link.springer.com/chapter/10.1007/978-3-540-68103-8_3 -->
<p>None of these quite capture what we’re looking for. Our wishlist: we want a reasonable language for defining geometric theories, allowing arbitrary set-indexed disjunctions in a principled way. We should be able to describe and manipulate models of these theories, and reason inside the classifying topos of each theory if we like. While we’re really dreaming, the true goal is a syntactic understanding of Ingo’s <a href="../../blog/2025-07-13-liberating-synthetic-quasi-coherence-from-forcing/#blechschmidts-generalized-nullstellensatz">synthetic quasicoherence</a>, which would let us <em>prove</em> all the interesting non-geometric properties of the universal model inside each classifying topos.</p>
<p>In this post I’ll outline two ideas for what a sensible geometric type theory could look like. The first is not too dissimilar from the way theories are ordinarily presented: a list of sorts and axioms. These have a somewhat involved context structure, in order to properly capture the set-indexed disjunctions that are characteristic of geometric theories. The second is more radical, using a lot of the ideas from Owen Lynch’s <a href="https://www.youtube.com/watch?v=Id-9XE5TsA8">EMTT</a>; theories are built up more type theoretically, leaning heavily on a restricted kind of <img src="https://latex.codecogs.com/png.latex?%5CPi">-type to emulate the more complex context structure of the first version. I’ll end the post with a handful of additional thoughts and concerns, in case any readers have good ideas for solving them!</p>
<p>One note before we begin. When working with geometric logic in the ordinary style, constructions such as the product of sorts must be performed “by hand”. One adds an additional structureless sort together with projection functions, and a collection of axioms which give this new sort the correct universal property; in this sense one builds new types out of logic. A <a href="https://arxiv.org/abs/2206.01113">preprint</a> by Vickers contains many examples of this trick.</p>
<p>As type theorists we are more used to doing the opposite; starting with a handful of constructions on types as primitive and carving out logic as a fragment of these. As hinted at in David Jaz’s <a href="../../blog/2025-07-13-liberating-synthetic-quasi-coherence-from-forcing/#dreaming-of-homotopy-types">previous post</a>, we’ll take a leap of faith and build our theories in a proof-relevant, proposition-as-types style, rather than sticking to pure logic. Geometric constructions in the style we present below will be sufficient to, for example, demand that a type is a (h-)proposition, and build the propositional truncation (as a higher inductive type).</p>
<section id="geometric-theories-via-propositions-as-types" class="level1" data-number="1">
<h1 data-number="1"><span class="header-section-number">1</span> Geometric Theories Via Propositions as Types</h1>
<p>To hit all the things on our wishlist there’s an unfortunate explosion in the number of judgements involved. We’ll build up to the full set gradually.</p>
<p>First, the specification of theories themselves. We’ll focus on the <em>coherent</em> fragment to begin with, leaving aside set-indexed disjunctions. As usual, theories will be built as a list of sorts and terms, each of which may use the sorts and terms that came before it. Like Generalised Algebraic Theories and unlike FOLDS, we’re going to allow free mixing of terms and dependent sorts. That is, a theory is a sequence of judgements, each with one of the shapes</p>
<div class="tikz">
<img src="https://topos.institute/blog/2026-06-15-geometric-type-theory-done-two-ways/_svgs/4990680ae5922b968a8e4d9d8caf7645e6d31784.svg" class="img-fluid">
</div>
<p>where <img src="https://latex.codecogs.com/png.latex?%5Cphi"> is a <em>geometric construction</em> in the sorts and terms of the theory so far, <img src="https://latex.codecogs.com/png.latex?%5CPhi"> is a context of such geometric constructions, and <img src="https://latex.codecogs.com/png.latex?X"> and <img src="https://latex.codecogs.com/png.latex?c"> are fresh names.</p>
<p>In this proof-relevant style, we’ll collapse the distinction present in first-order logic between the “context” of variables and the collection of propositional antecedents of a sequent: rather than writing <img src="https://latex.codecogs.com/png.latex?%5Cpsi%20%5Cvdash_%7B%5CGamma%7D%20%5Cphi">, we will use <img src="https://latex.codecogs.com/png.latex?%5CGamma,%20p%20:%20%5Cpsi%0A%5Cvdash%20c%20:%20%5Cphi"> where <img src="https://latex.codecogs.com/png.latex?%5Cpsi"> and <img src="https://latex.codecogs.com/png.latex?%5Cphi"> are constructions that happen to be propositions. For this reason, we won’t add separate primitive notions of functions or relations; (proof-relevant) terms will suffice for the former and dependent sorts for the latter.</p>
<p>Let’s see a couple of examples in this style before describing the judgements more formally. First, the theory of monoids looks similar to what one would write down as a GAT.</p>
<div class="callout callout-style-simple callout-none no-icon">
<div class="callout-body d-flex">
<div class="callout-icon-container">
<i class="callout-icon no-icon"></i>
</div>
<div class="callout-body-container">
<p><img src="https://latex.codecogs.com/png.latex?%5Cbegin%7Balign*%7D%0A%20%20%20%20&amp;%5Cmathord%7B%5Ccdot%7D&amp;&amp;%5Cvdash%20X%20%5C,%5C,%5Cmathsf%7Bsort%7D%5C%5C%0A%20%20%20%20&amp;%5Cmathord%7B%5Ccdot%7D&amp;&amp;%5Cvdash%20e%20:%20X%20%5C%5C%0A%20%20%20%20&amp;x%20:%20X,%20y%20:%20X%20&amp;&amp;%5Cvdash%20m%20:%20X%20%5C%5C%0A%20%20%20%20&amp;x%20:%20X%20&amp;&amp;%5Cvdash%20u%20:%20m(x,%20e)%20=_X%20x%20%5C%5C%0A%20%20%20%20&amp;x%20:%20X%20&amp;&amp;%5Cvdash%20v%20:%20m(e,%20x)%20=_X%20x%20%5C%5C%0A%20%20%20%20&amp;x%20:%20X,%20y%20:%20X,%20z%20:%20X%20&amp;&amp;%5Cvdash%20a%20:%20m(m(x,%20y),%20z)%20=_X%20m(x,%20m(y,%20z))%0A%5Cend%7Balign*%7D"></p>
</div>
</div>
</div>
<p>In contrast to FOLDS or DFOL, the axioms of a monoid are added as terms of certain equality types rather than through a primitive equality judgement or propositional relation.</p>
<p>The “types” <img src="https://latex.codecogs.com/png.latex?%5Cphi"> that may appear in these judgements form a little type theory that contains only the type formers we expect to be stable under pullback by geometric morphisms; that is, <img src="https://latex.codecogs.com/png.latex?%5CSigma">, <img src="https://latex.codecogs.com/png.latex?="> and a to-be-pinned-down class of (higher) inductive types. Crucially, we leave out function types and universes. Any universal quantification in a theory must be performed by the top-level construction context <img src="https://latex.codecogs.com/png.latex?%5CPhi">, and we are not allowed to quantify over sorts.</p>
<p>As a second example consider the theory of a strict interval, whose classifying topos is simplicial sets. We have a sort with a relation on it:</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Cbegin%7Balign*%7D%0A%20%20%20%20%5Cmathord%7B%5Ccdot%7D&amp;%5Cvdash%20I%20%5C,%5C,%5Cmathsf%7Bsort%7D%5C%5C%0A%20%20%20%20x%20:%20I,%20y%20:%20I%20&amp;%5Cvdash(x%20%5Cleq%20y)%20%5C,%5C,%5Cmathsf%7Bsort%7D%5C%5C%0A%5Cend%7Balign*%7D"></p>
<p>We can proceed to add all the ordinary terms of the theory:</p>
<div class="callout callout-style-simple callout-none no-icon">
<div class="callout-body d-flex">
<div class="callout-icon-container">
<i class="callout-icon no-icon"></i>
</div>
<div class="callout-body-container">
<p><img src="https://latex.codecogs.com/png.latex?%5Cbegin%7Balign*%7D%0A%20%20%20%20&amp;%5Cmathord%7B%5Ccdot%7D&amp;&amp;%5Cvdash%20b%20:%20I%20%5C%5C%0A%20%20%20%20&amp;%5Cmathord%7B%5Ccdot%7D&amp;&amp;%5Cvdash%20t%20:%20I%20%5C%5C%0A%20%20%20%20&amp;x%20:%20I%20&amp;&amp;%5Cvdash%20r%20:%20x%20%5Cleq%20x%20%5C%5C%0A%20%20%20%20&amp;x%20:%20I,%20y%20:%20I,%20z%20:%20I,%20p%20:%20x%20%5Cleq%20y,%20q%20:%20y%20%5Cleq%20z%20&amp;&amp;%5Cvdash%20c%20:%20x%20%5Cleq%20z%20%5C%5C%0A%20%20%20%20&amp;x%20:%20I,%20y%20:%20I,%20p%20:%20x%20%5Cleq%20y,%20q%20:%20y%20%5Cleq%20x%20&amp;&amp;%5Cvdash%20d%20:%20x%20=_I%20y%20%5C%5C%0A%20%20%20%20&amp;x%20:%20I%20&amp;&amp;%5Cvdash%20e%20:%20x%20%5Cleq%20t%20%5C%5C%0A%20%20%20%20&amp;x%20:%20I%20&amp;&amp;%5Cvdash%20f%20:%20b%20%5Cleq%20x%20%5C%5C%0A%20%20%20%20&amp;p%20:%20b%20=_I%20t%20&amp;&amp;%5Cvdash%20g%20:%20%5Cvarnothing%5C%5C%0A%20%20%20%20&amp;x%20:%20I,%20y%20:%20I%20%20&amp;&amp;%5Cvdash%20h%20:%20(x%20%5Cleq%20y)%20%5Cvee%20(y%20%5Cleq%20x)%0A%5Cend%7Balign*%7D"></p>
</div>
</div>
</div>
<p>where <img src="https://latex.codecogs.com/png.latex?P%20%5Cvee%20Q%20:%5Cequiv%5Cexists%5Cleft(%20P%20+%20Q%5Cright)"> is constructed using the propositional truncation in the ordinary way.</p>
<p>The <img src="https://latex.codecogs.com/png.latex?x%20%5Cleq%20y"> relation should be proposition-valued. We can enforce this with an additional term:</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Cbegin%7Balign*%7D%0A%20%20%20%20x%20:%20I,%20y%20:%20I,%20p%20:%20x%20%5Cleq%20y,%20q%20:%20x%20%5Cleq%20y%20&amp;%5Cvdash%20w%20:%20p%20=_%7B(x%20%5Cleq%20y)%7D%20q%0A%5Cend%7Balign*%7D"></p>
<p>Similarly, back in the monoid example we likely want the carrier of the monoid <img src="https://latex.codecogs.com/png.latex?X"> to be 0-truncated in the homotopical sense; this requirement can also be written as a geometric construction:</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Cbegin%7Balign*%7D%0A%20%20%20%20x%20:%20X,%20y%20:%20X,%20p%20:%20x%20=_X%20y,%20q%20:%20x%20=_X%20y%20&amp;%5Cvdash%20w%20:%20p%20=_%7B(x=y)%7D%20q%0A%5Cend%7Balign*%7D"></p>
<section id="formal-judgements" class="level2" data-number="1.1">
<h2 data-number="1.1" data-anchor-id="formal-judgements"><span class="header-section-number">1.1</span> Formal Judgements</h2>
<p>Let us set this up a little more formally. This is a first pass that we’ll have to add features to later. We have the following judgements:</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Cbegin%7Balign*%7D%0A&amp;%5Cmathbb%7BT%7D%5C,%5C,%5Cmathsf%7Btheory%7D&amp;&amp;%20%5Cquad%20%5Ctext%7BTheory%7D%20%5C%5C%0A&amp;%5Cmathbb%7BT%7D%5Cmid%20%5CPhi%20%5C,%5C,%5Cmathsf%7Bctx%7D&amp;&amp;%20%5Cquad%20%5Ctext%7BConstruction%20Context%7D%20%5C%5C%0A&amp;%5Cmathbb%7BT%7D%5Cmid%20%5CPhi%20%5Cvdash%5Cphi%20%5C,%5C,%5Cmathsf%7Bconstr%7D&amp;&amp;%20%5Cquad%20%5Ctext%7BConstruction%20in%20Construction%20Context%7D%20%5C%5C%0A&amp;%5Cmathbb%7BT%7D%5Cmid%20%5CPhi%20%5Cvdash%20c%20:%20%5Cphi%20&amp;&amp;%20%5Cquad%20%5Ctext%7BTerm%20of%20Construction%7D%0A%5Cend%7Balign*%7D"></p>
<p>There are two ways to extend a theory: declare a new (dependent) sort, or declare new term.</p>
<div class="tikz">
<img src="https://topos.institute/blog/2026-06-15-geometric-type-theory-done-two-ways/_svgs/e8099255782d563ce99317a31844f6dfdfbe4992.svg" class="img-fluid">
</div>
<p>Construction contexts <img src="https://latex.codecogs.com/png.latex?%5CPhi"> are ordinary type theoretic contexts: lists of variables with an associated construction as its type; each of which may be dependent on the previous entries.</p>
<div class="tikz">
<img src="https://topos.institute/blog/2026-06-15-geometric-type-theory-done-two-ways/_svgs/6627442df7cd88aa8590467dd064e6c3aa0ce369.svg" class="img-fluid">
</div>
<p>Each kind of theory extension has an associated “variable rule”, allowing it to be used directly so long as we specify parameters to use for its construction context.</p>
<div class="tikz">
<img src="https://topos.institute/blog/2026-06-15-geometric-type-theory-done-two-ways/_svgs/a7aed9ba069ff63ad1b15191c54412768ddb3935.svg" class="img-fluid">
</div>
<p>Now, the actual rules for constructions and their terms. First, we have the “inner” variable rule that allows us to use a variable from the current construction context.</p>
<div class="tikz">
<img src="https://topos.institute/blog/2026-06-15-geometric-type-theory-done-two-ways/_svgs/92ded92eed430164de57d7f54dd22670d57e6d9f.svg" class="img-fluid">
</div>
<p>The construction formers available are <img src="https://latex.codecogs.com/png.latex?%5CSigma">, <img src="https://latex.codecogs.com/png.latex?=">, <img src="https://latex.codecogs.com/png.latex?+">, (some) higher inductive types, all taking place within a fixed <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BT%7D%5C,%5C,%5Cmathsf%7Btheory%7D">. Because the language of constructions lacks universes, we will need to compensate by including large elimination rules for inductive types. And because we lack function types, we will likely also need to include an extra “Frobenius” telescope <img src="https://latex.codecogs.com/png.latex?%5CPhi'"> in these induction principles.</p>
<!-- Other Frobenius references/tricks: -->
<!-- https://github.com/akaposi/hiit-signatures/blob/master/formalization/FrobeniusJDeriv.agda -->
<!-- https://lmcs.episciences.org/6100 -->
<!-- https://arxiv.org/abs/2304.10343 -->
<div class="tikz">
<img src="https://topos.institute/blog/2026-06-15-geometric-type-theory-done-two-ways/_svgs/edacfab77a1bb2ff0efa7340542aa9efe2855bd2.svg" class="img-fluid">
</div>
</section>
<section id="set-indexed-sorts-and-terms" class="level2" data-number="1.2">
<h2 data-number="1.2" data-anchor-id="set-indexed-sorts-and-terms"><span class="header-section-number">1.2</span> Set-indexed Sorts and Terms</h2>
<p>The next step is to get the external world of sets involved. Thus far we are only capable of expressing “finitely axiomatisable” theories, those consisting of a finite collection of sorts and terms. This is not sufficient for many coherent theories encountered in practice, even before we get to geometric theories.</p>
<p>Consider the theory of <img src="https://latex.codecogs.com/png.latex?R">-modules for a fixed ring <img src="https://latex.codecogs.com/png.latex?R">. With our current tools we are able to express an abelian group structure on a sort <img src="https://latex.codecogs.com/png.latex?M">, but scalar multiplication requires a scaling operation <img src="https://latex.codecogs.com/png.latex?%5Csigma_r%20:%20M%20%5Cto%20M"> for all elements of the <em>set</em> <img src="https://latex.codecogs.com/png.latex?r%20:%20R">.</p>
<p>Put differently, we need to add a notion of “axiom schema” which allows us to add an axiom for each element of a type, and in the general case this axiom may vary over the elements of the type. While we’re at it, we may as well extend the notion to terms and sorts generally – we’ll handle it through the same facility.</p>
<p>Schemas of this kind are achieved as follows: each sort and term has an ordinary context of types coming before the construction context, so that each sort or term is universally quantified over this context. In the <img src="https://latex.codecogs.com/png.latex?R">-module example:</p>
<div class="callout callout-style-simple callout-none no-icon">
<div class="callout-body d-flex">
<div class="callout-icon-container">
<i class="callout-icon no-icon"></i>
</div>
<div class="callout-body-container">
<p><img src="https://latex.codecogs.com/png.latex?%5Cbegin%7Balign*%7D%0A%20%20%20%20&amp;%5Cmathord%7B%5Ccdot%7D&amp;&amp;%5Cmathbin%7B;%7D%5Cmathord%7B%5Ccdot%7D&amp;&amp;%5Cvdash%20M%20%5C,%5C,%5Cmathsf%7Bsort%7D%5C%5C%0A%20%20%20%20&amp;&amp;&amp;&amp;&amp;%20%5Cdots%20M%20%5Ctext%7B%20is%20an%20abelian%20group%7D%20%5Cdots%20%5C%5C%0A%20%20%20%20&amp;r%20:%20R%20&amp;&amp;%5Cmathbin%7B;%7Dv%20:%20M%20%20&amp;&amp;%5Cvdash%5Csigma(r;%20v)%20:%20M%20%5C%5C%0A%20%20%20%20&amp;r%20:%20R,%20s%20:%20R%20&amp;&amp;%5Cmathbin%7B;%7Dv%20:%20M%20%20&amp;&amp;%5Cvdash%20p_1%20:%20%5Csigma(r;%20%5Csigma(s;%20v))%20=%20%5Csigma(r%20%5Ccdot_R%20s;%20v)%20%20%5C%5C%0A%20%20%20%20&amp;%5Cmathord%7B%5Ccdot%7D&amp;&amp;%5Cmathbin%7B;%7Dv%20:%20M%20%20&amp;&amp;%5Cvdash%20p_2%20:%20%5Csigma(1;%20v)%20=%20v%20%20%5C%5C%0A%20%20%20%20&amp;r%20:%20R%20&amp;&amp;%5Cmathbin%7B;%7Du%20:%20M,%20v%20:%20M%20%20&amp;&amp;%5Cvdash%20p_3%20:%20%5Csigma(r;%20u%20+_M%20v)%20=%20%5Csigma(r;%20u)%20+_M%20%5Csigma(r;%20v)%20%20%5C%5C%0A%20%20%20%20&amp;r%20:%20R,%20s%20:%20R%20&amp;&amp;%5Cmathbin%7B;%7Dv%20:%20M%20%20&amp;&amp;%5Cvdash%20p_4%20:%20%5Csigma(r%20+_R%20s;%20v)%20=%20%5Csigma(r;%20v)%20+_M%20%5Csigma(s;%20v)%0A%5Cend%7Balign*%7D"></p>
</div>
</div>
</div>
<p>On the right-hand side, some of the constructions we have postulated involve operations in the background type theory: we see the multiplication of ring elements <img src="https://latex.codecogs.com/png.latex?r%20%5Ccdot%20s"> in <img src="https://latex.codecogs.com/png.latex?p_1">, and addition <img src="https://latex.codecogs.com/png.latex?r%20+%20s"> in <img src="https://latex.codecogs.com/png.latex?p_4">. These are not part of the theory being defined, but happening externally to it.</p>
<p>For an example of a “sort schema”, consider the theory of prime filters of a ring <img src="https://latex.codecogs.com/png.latex?R">, whose classifying topos is the small Zariski topos <img src="https://latex.codecogs.com/png.latex?%5Cmathrm%7BSpec%7D(R)">. Here, we have one sort <img src="https://latex.codecogs.com/png.latex?P(r)"> for each ring element <img src="https://latex.codecogs.com/png.latex?r%20:%20R">, which we think of as the proposition that the ring element lies in the filter. The remaining terms of the theory are then straightforward translations of the theory in the ordinary style.</p>
<div class="callout callout-style-simple callout-none no-icon">
<div class="callout-body d-flex">
<div class="callout-icon-container">
<i class="callout-icon no-icon"></i>
</div>
<div class="callout-body-container">
<p><img src="https://latex.codecogs.com/png.latex?%5Cbegin%7Balign*%7D%0A%20%20%20%20&amp;r%20:%20R%20&amp;&amp;%5Cmathbin%7B;%7D%5Cmathord%7B%5Ccdot%7D&amp;&amp;%5Cvdash%20P%20%5C,%5C,%5Cmathsf%7Bsort%7D%5C%5C%0A%20%20%20%20&amp;r%20:%20R%20&amp;&amp;%5Cmathbin%7B;%7Dx%20:%20P(r),%20y%20:%20P(r)%20&amp;&amp;%5Cvdash%20t%20:%20x%20=%20y%20%5C%5C%0A%20%20%20%20&amp;%5Cmathord%7B%5Ccdot%7D&amp;&amp;%5Cmathbin%7B;%7D%5Cmathord%7B%5Ccdot%7D&amp;&amp;%5Cvdash%20o%20:%20P(1_R)%20%5C%5C%0A%20%20%20%20&amp;%5Cmathord%7B%5Ccdot%7D&amp;&amp;%5Cmathbin%7B;%7Dp%20:%20P(0_R)%20&amp;&amp;%5Cvdash%20e%20:%20%5Cvarnothing%5C%5C%0A%20%20%20%20&amp;r%20:%20R,%20s%20:%20R%20&amp;&amp;%5Cmathbin%7B;%7Dp%20:%20P(r%20%5Ccdot_R%20s)%20&amp;&amp;%5Cvdash%20c_1%20:%20P(r)%20%5Ctimes%20P(s)%20%20%5C%5C%0A%20%20%20%20&amp;r%20:%20R,%20s%20:%20R%20&amp;&amp;%5Cmathbin%7B;%7Dp%20:%20P(r)%20%5Ctimes%20P(s)%20&amp;&amp;%5Cvdash%20c_2%20:%20P(r%20%5Ccdot_R%20s)%20%5C%5C%0A%20%20%20%20&amp;r%20:%20R,%20s%20:%20R%20&amp;&amp;%5Cmathbin%7B;%7Dp%20:%20P(r%20+_R%20s)%20&amp;&amp;%5Cvdash%20d%20:%20P(r)%20%5Cvee%20P(s)%0A%5Cend%7Balign*%7D"></p>
</div>
</div>
</div>
<p>Formally, these contexts of types are added to all construction judgements and all the rules for interacting with them.</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Cbegin%7Balign*%7D%0A&amp;%5Cmathbb%7BT%7D%5C,%5C,%5Cmathsf%7Btheory%7D&amp;&amp;%20%5Cquad%20%5Ctext%7BTheory%7D%20%5C%5C%0A&amp;%5Cmathbb%7BT%7D%5Cmid%20%5Ctextcolor%7BCrimson%7D%7B%5CDelta%7D%5Cmathbin%7B;%7D%5CPhi%20%5C,%5C,%5Cmathsf%7Bctx%7D&amp;&amp;%20%5Cquad%20%5Ctext%7BConstruction%20Context%7D%20%5C%5C%0A&amp;%5Cmathbb%7BT%7D%5Cmid%20%5Ctextcolor%7BCrimson%7D%7B%5CDelta%7D%5Cmathbin%7B;%7D%5CPhi%20%5Cvdash%5Cphi%20%5C,%5C,%5Cmathsf%7Bconstr%7D&amp;&amp;%20%5Cquad%20%5Ctext%7BConstruction%20in%20Construction%20Context%7D%20%5C%5C%0A&amp;%5Cmathbb%7BT%7D%5Cmid%20%5Ctextcolor%7BCrimson%7D%7B%5CDelta%7D%5Cmathbin%7B;%7D%5CPhi%20%5Cvdash%20c%20:%20%5Cphi%20&amp;&amp;%20%5Cquad%20%5Ctext%7BTerm%20of%20Construction%7D%0A%5Cend%7Balign*%7D"></p>
<div class="tikz">
<img src="https://topos.institute/blog/2026-06-15-geometric-type-theory-done-two-ways/_svgs/be743e40a5094493ee0b2edf8c540a898d4468de.svg" class="img-fluid">
</div>
<p>When using the “variable rules”, we now need to provide parameters to use for the entries in the prefix of types of the construction context:</p>
<div class="tikz">
<img src="https://topos.institute/blog/2026-06-15-geometric-type-theory-done-two-ways/_svgs/fc04ee7cb820bc1f8be8336e071e46ea78817cee.svg" class="img-fluid">
</div>
<p>Besides quantifying over elements of a type in this opaque way, we may wish to make choices based on elements of an inductive type.</p>
<p>For example, the theory of a ring <img src="https://latex.codecogs.com/png.latex?R"> is coherent and finitely axiomatisable. Requiring the ring to have characteristic 0 is still coherent but requires infinitely many terms to specify: we ask that the ring is not characteristic 2, not characteristic 3, and so on. We add one term for each <img src="https://latex.codecogs.com/png.latex?n%20:%20%5Cmathbb%7BN%7D">, stating that <img src="https://latex.codecogs.com/png.latex?(n%20+_%7B%5Cmathbb%7BN%7D%7D%201)%20%5Ccdot%201%0A=%200"> yields a contradiction.</p>
<p>In order to define <img src="https://latex.codecogs.com/png.latex?(n%20%5Ccdot%20x)%20:%20R"> in the construction world, we need to be able to do construction-valued induction on the <em>type</em> <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BN%7D">; this requires a new induction principle:</p>
<div class="tikz">
<img src="https://topos.institute/blog/2026-06-15-geometric-type-theory-done-two-ways/_svgs/78dd1c74e5617f26c02fdea76e6770e5953f10f0.svg" class="img-fluid">
</div>
<p>Temporarily adopting a more convenient syntax, we might write this as an ordinary pattern match:</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Cbegin%7Balign*%7D%0An%20%5Ccdot%20x%20:%5Cequiv%5Cmathsf%7Bcase%7D(n,%20&amp;%5C,%5Cmathsf%7Bzero%7D%20%5Cmapsto%200_R,%20%5C%5C%0A&amp;%5C,%5Cmathsf%7Bsucc%7D(m)%20%5Cmapsto%20x%20+_R%20(m%20%5Ccdot%20x)%20)%0A%5Cend%7Balign*%7D"></p>
<p>And then we can state the term schema that forces the ring to be characteristic 0.</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Cbegin%7Balign*%7D%0A%20%20%20%20n%20:%20%5Cmathbb%7BN%7D%5Cmathbin%7B;%7Dp%20:%20((n+1)%20%5Ccdot%201_R)%20=%200_R%20&amp;%5Cvdash%20c%20:%20%5Cvarnothing%0A%5Cend%7Balign*%7D"></p>
<p>(In this particular example, we could have used a version of the natural numbers <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BN%7D"> definable in the language of constructions, if we choose to include <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BN%7D"> in the class of inductive constructions we allow.)</p>
</section>
<section id="the-ax-construction-former" class="level2" data-number="1.3">
<h2 data-number="1.3" data-anchor-id="the-ax-construction-former"><span class="header-section-number">1.3</span> The Ax Construction-Former</h2>
<p>The feature of geometric logic remaining to be added is infinitary disjunctions, indexed over any type.</p>
<p>The context of types of the last section behaves much like an infinitary disjunction appearing to the <em>left</em> of the turnstile, but we need an equivalent for when an infinitary disjunction appears on the right. For this, we add a new construction former <img src="https://latex.codecogs.com/png.latex?%5Cmathop%7B%5Cmathrm%7B%5Cmathbb%7BA%7Dx%7D%7DA">, so that including a term of the construction <img src="https://latex.codecogs.com/png.latex?%5Cmathop%7B%5Cmathrm%7B%5Cmathbb%7BA%7Dx%7D%7DA"> in a theory is asserting that we have an element of the type <img src="https://latex.codecogs.com/png.latex?A">.</p>
<div class="tikz">
<img src="https://topos.institute/blog/2026-06-15-geometric-type-theory-done-two-ways/_svgs/253df2d3397dbc4eae388ed6d9429543d7184aac.svg" class="img-fluid">
</div>
<p>This is a typical “positive” type former, where the eliminator is designed to give a universal mapping-out property. In this case, to build a construction assuming a term of the construction <img src="https://latex.codecogs.com/png.latex?%5Cmathop%7B%5Cmathrm%7B%5Cmathbb%7BA%7Dx%7D%7DA"> is the same as giving a construction for every element of the type <img src="https://latex.codecogs.com/png.latex?A">. Of course, each construction having the extra context zone of types is necessary for this to make sense.</p>
<p>The <img src="https://latex.codecogs.com/png.latex?%5Cmathop%7B%5Cmathrm%7B%5Cmathbb%7BA%7Dx%7D%7D"> construction-former is the final missing piece, and we can now capture in syntax all your favourite geometric theories. First, the flip side of the example above: the theory of a ring of finite characteristic. Starting with the theory of a ring <img src="https://latex.codecogs.com/png.latex?R">, we can add</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Cbegin%7Balign*%7D%0A%5Cmathord%7B%5Ccdot%7D%5Cmathbin%7B;%7D%5Cmathord%7B%5Ccdot%7D&amp;%5Cvdash%20c%20:%20%5Cmathop%7B%5Cmathrm%7B%5Cmathbb%7BA%7Dx%7D%7D%5Cmathbb%7BN%7D%5C%5C%0A%5Cmathord%7B%5Ccdot%7D%5Cmathbin%7B;%7D%5Cmathord%7B%5Ccdot%7D&amp;%5Cvdash%20p%20:%20%5Cmathsf%7Blet%7D%20%5C;%20%7B%5Cmathop%7B%5Cmathrm%7Bax%7D%7Dn%7D%20:=%20%7Bc%7D%20%5C,%20%5Cmathsf%7Bin%7D%20%5C,%20%7B(n%20%5Ccdot%201_R=%200)%7D%0A%5Cend%7Balign*%7D"> using the same <img src="https://latex.codecogs.com/png.latex?n%20%5Ccdot%20x"> operation defined above. We assert a term of <img src="https://latex.codecogs.com/png.latex?%5Cmathop%7B%5Cmathrm%7B%5Cmathbb%7BA%7Dx%7D%7D%5Cmathbb%7BN%7D">, corresponding to an element of the type <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BN%7D">, and then must unwrap it into the context of types before we can use it as we did previously.</p>
<!-- TODO: reconstructing N as an "induction algebras" using external N? -->
<p>An important example we can now capture is the theory of a <em>flat functor from <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BC%7D"></em> where <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BC%7D"> is a fixed small category. Suppose we have the category provided as a collection of types and functions (not a theory!). In pseudo-Agda notation:</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Cbegin%7Balign*%7D%0AO%20&amp;:%20%5Cmathcal%7BU%7D%5C%5C%0AH%20&amp;:%20O%20%5Cto%20O%20%5Cto%20%5Cmathcal%7BU%7D%5C%5C%0Ai%20&amp;:%20(a%20:%20O)%20%5Cto%20H(a,%20a)%20%5C%5C%0A%5Ccirc%20&amp;:%20%5C%7Ba%20:%20O%5C%7D%20%5Cto%20%5C%7Bb%20:%20O%5C%7D%20%5Cto%20%5C%7Bc%20:%20O%5C%7D%20%5Cto%20H(a,%20b)%20%5Cto%20H(b,%20c)%20%5Cto%20H(a,%20c)%20%5C%5C%0A&amp;%5Ctext%7B%5Cdots%20associative,%20unital%20%5Cdots%7D%0A%5Cend%7Balign*%7D"></p>
<p>From these we can construct, again purely in type theory, the type of cones with endpoints <img src="https://latex.codecogs.com/png.latex?a"> and <img src="https://latex.codecogs.com/png.latex?b">, and the type of equalisers of a pair of morphisms.</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Cbegin%7Balign*%7D%0A&amp;%5Cmathsf%7BCone%7D%20:%20O%20%5Cto%20O%20%5Cto%20%5Cmathcal%7BU%7D%5C%5C%0A&amp;%5Cmathsf%7BCone%7D(a,%20b)%20:=%20(c%20:%20O)%20%5Ctimes%20H(c,%20a)%20%5Ctimes%20H(c,%20b)%20%5C%5C%0A&amp;~%5C%5C%0A&amp;%5Cmathsf%7BEq%7D%20:%20%5C%7Ba%20:%20O%5C%7D%20%5Cto%20%5C%7Bb%20:%20O%5C%7D%20%5Cto%20H(a,%20b)%20%5Cto%20H(a,%20b)%20%5Cto%20%5Cmathcal%7BU%7D%5C%5C%0A&amp;%5Cmathsf%7BEq%7D(f,%20g)%20:=%20(c%20:%20O)%20%5Ctimes%20(h%20:%20H(c,%20a))%20%5Ctimes%20f%20%5Ccirc%20h%20=_%7BH(c,%20b)%7D%20g%20%5Ccirc%20h%0A%5Cend%7Balign*%7D"></p>
<p>Then, in our style, we can build the <a href="https://ncatlab.org/nlab/show/theory+of+flat+functors">theory of a flat functor</a> from <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BC%7D"> in pieces.</p>
<div class="callout callout-style-simple callout-none no-icon">
<div class="callout-body d-flex">
<div class="callout-icon-container">
<i class="callout-icon no-icon"></i>
</div>
<div class="callout-body-container">
<p>“For each object <img src="https://latex.codecogs.com/png.latex?a"> there is a set <img src="https://latex.codecogs.com/png.latex?X(a)">.” <img src="https://latex.codecogs.com/png.latex?%5Cbegin%7Balign*%7D%0A&amp;a%20:%20O%20%5Cmathbin%7B;%7D%5Cmathord%7B%5Ccdot%7D%5Cvdash%20X(a)%20%5C,%5C,%5Cmathsf%7Bsort%7D%5C%5C%0A%5Cend%7Balign*%7D"> “For each morphism <img src="https://latex.codecogs.com/png.latex?f%20:%20a%20%5Cto%20b"> there is a function <img src="https://latex.codecogs.com/png.latex?X(a)%20%5Cto%20X(b)">.” <img src="https://latex.codecogs.com/png.latex?%5Cbegin%7Balign*%7D%0A&amp;a%20:%20O,%20b%20:%20O,%20f%20:%20H(a,%20b)%20%5Cmathbin%7B;%7Dx%20:%20X(a)%20%5Cvdash%5Cmathsf%7Bap%7D_f(x)%20:%20X(b)%0A%5Cend%7Balign*%7D"> “This assignment is functorial.” <img src="https://latex.codecogs.com/png.latex?%5Cbegin%7Balign*%7D%0A&amp;a%20:%20O%20%5Cmathbin%7B;%7Dx%20:%20X(a)%20%5C%5C%20&amp;%5Cquad%20%5Cvdash%20p_1%20:%20%5Cmathsf%7Bap%7D_%7Bi(a)%7D(x)%20=%20x%20%5C%5C%0A&amp;%5C%5C%0A&amp;a%20:%20O,%20b%20:%20O,%20c%20:%20O,%20f%20:%20H(a,%20b),%20g%20:%20H(b,%20c)%20%5Cmathbin%7B;%7Dx%20:%20X(a)%20%5C%5C%20&amp;%5Cquad%20%5Cvdash%20p_2%20:%20%5Cmathsf%7Bap%7D_%7Bg%20%5Ccirc%20f%7D(x)%20=%20%5Cmathsf%7Bap%7D_%7Bg%7D(%5Cmathsf%7Bap%7D_%7Bf%7D(x))%20%5Chspace%7B18em%7D%0A%5Cend%7Balign*%7D"> “The category of elements is filtered.” <img src="https://latex.codecogs.com/png.latex?%5Cbegin%7Balign*%7D%0A&amp;%5Cmathord%7B%5Ccdot%7D%5Cmathbin%7B;%7D%5Cmathord%7B%5Ccdot%7D%5Cvdash%20p_3%20:%20%5Cexists%5Cleft(%20(o%20:%20%5Cmathop%7B%5Cmathrm%7B%5Cmathbb%7BA%7Dx%7D%7DO)%20%5Ctimes%20%5Cmathsf%7Blet%7D%20%5C;%20%7B%5Cmathop%7B%5Cmathrm%7Bax%7D%7Da%7D%20:=%20%7Bo%7D%20%5C,%20%5Cmathsf%7Bin%7D%20%5C,%20%7BX(a)%7D%5Cright)%20%5C%5C%0A&amp;%5C%5C%0A&amp;a%20:%20O,%20b%20:%20O%20%5Cmathbin%7B;%7Dx%20:%20X(a),%20y%20:%20X(b)%20%5C%5C%20&amp;%5Cquad%20%5Cvdash%20p_4%20:%20%5Cexists%20(d%20:%20%5Cmathop%7B%5Cmathrm%7B%5Cmathbb%7BA%7Dx%7D%7D%5Cmathsf%7BCone%7D(a,%20b))%20%5Ctimes%0A%5Cmathsf%7Blet%7D%20%5C;%20%5Cmathop%7B%5Cmathrm%7Bax%7D%7D(c,f,g)%20:=%20x%20%5C,%20%5Cmathsf%7Bin%7D%20%5C%5C%20&amp;%5Cquad%5Cquad%20(z%20:%20X(c))%20%5Ctimes%20%5Cmathsf%7Bap%7D_f(z)%20=%20x%20%5Ctimes%20%5Cmathsf%7Bap%7D_g(z)=y%20%5C%5C%0A&amp;%5C%5C%0A&amp;a%20:%20O,%20b%20:%20O,%20f%20:%20H(a,%20b),%20g%20:%20H(a,%20b)%20%5Cmathbin%7B;%7Dx%20:%20X(a),%20p%20:%20%5Cmathsf%7Bap%7D_f(x)%20=%20%5Cmathsf%7Bap%7D_g(x)%20%5C%5C%20&amp;%5Cquad%20%5Cvdash%20p_5%20:%20%5Cexists%5Cleft(%20(d%20:%20%5Cmathop%7B%5Cmathrm%7B%5Cmathbb%7BA%7Dx%7D%7D%5Cmathsf%7BEq%7D(f,%20g))%20%5Ctimes%20%5Cmathsf%7Blet%7D%20%5C;%20%7B%5Cmathop%7B%5Cmathrm%7Bax%7D%7D(c,h,q)%7D%20:=%20%7Bd%7D%20%5C,%20%5Cmathsf%7Bin%7D%20%5C,%20%7B(z%20:%20X(c))%20%5Ctimes%20%5Cmathsf%7Bap%7D_h(z)%20=%20x%7D%5Cright)%0A%5Cend%7Balign*%7D"></p>
</div>
</div>
</div>
<p>I find this quite nice: the type level and theory level are both captured in the formal language, and the boundary between the two is made totally explicit.</p>
</section>
<section id="internal-theories" class="level2" data-number="1.4">
<h2 data-number="1.4" data-anchor-id="internal-theories"><span class="header-section-number">1.4</span> Internal Theories</h2>
<p>Something we’ve done a couple of times now is judged a theory with reference to some type-theoretic parameters. For example, the ring <img src="https://latex.codecogs.com/png.latex?R"> to be used in the theory of an <img src="https://latex.codecogs.com/png.latex?R">-module, or the data of the category <img src="https://latex.codecogs.com/png.latex?(O,%20H,%20%5Cdots)"> in the theory of a flat functor. These could be provided as closed types and terms, but better would be to allow ourselves to judge a theory internal to an ambient context.</p>
<p>This can be done by sneaking yet another notion of context into our judgements as a prefix, to act as the context that all our work is happening inside:</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Cbegin%7Balign*%7D%0A&amp;%5Ctextcolor%7BCrimson%7D%7B%5CGamma%7D%20%5Cmid%20%5Cmathbb%7BT%7D%5C,%5C,%5Cmathsf%7Btheory%7D&amp;&amp;%20%5Cquad%20%5Ctext%7BTheory%7D%20%5C%5C%0A&amp;%5Ctextcolor%7BCrimson%7D%7B%5CGamma%7D%20%5Cmid%20%5Cmathbb%7BT%7D%5Cmid%20%5CDelta%20%5Cmathbin%7B;%7D%5CPhi%20%5C,%5C,%5Cmathsf%7Bctx%7D&amp;&amp;%20%5Cquad%20%5Ctext%7BConstruction%20Context%7D%20%5C%5C%0A&amp;%5Ctextcolor%7BCrimson%7D%7B%5CGamma%7D%20%5Cmid%20%5Cmathbb%7BT%7D%5Cmid%20%5CDelta%20%5Cmathbin%7B;%7D%5CPhi%20%5Cvdash%5Cphi%20%5C,%5C,%5Cmathsf%7Bconstr%7D&amp;&amp;%20%5Cquad%20%5Ctext%7BConstruction%20in%20Construction%20Context%7D%20%5C%5C%0A&amp;%5Ctextcolor%7BCrimson%7D%7B%5CGamma%7D%20%5Cmid%20%5Cmathbb%7BT%7D%5Cmid%20%5CDelta%20%5Cmathbin%7B;%7D%5CPhi%20%5Cvdash%20c%20:%20%5Cphi%20&amp;&amp;%20%5Cquad%20%5Ctext%7BTerm%20of%20Construction%7D%0A%5Cend%7Balign*%7D"></p>
<p>The above judgements presuppose that <img src="https://latex.codecogs.com/png.latex?%5CGamma%20%5Cvdash%5CDelta%20%5C,%5C,%5Cmathsf%7Btele%7D"> holds. This <img src="https://latex.codecogs.com/png.latex?%5CGamma"> is now sprinkled through all the rules but does not interact with them in any interesting way, other than being present when typing each telescope <img src="https://latex.codecogs.com/png.latex?%5CDelta">.<sup>1</sup></p>
<div class="tikz">
<img src="https://topos.institute/blog/2026-06-15-geometric-type-theory-done-two-ways/_svgs/40dbc1f1f614d385f87444b5541ddb2be158f72d.svg" class="img-fluid">
</div>
<p>We can replay the theories we described above, but properly parameterised over their inputs.</p>
</section>
<section id="judging-a-model" class="level2" data-number="1.5">
<h2 data-number="1.5" data-anchor-id="judging-a-model"><span class="header-section-number">1.5</span> Judging a Model</h2>
<p>Now that we can describe a theory in context, it would be nice if we could express what it means to have a model of that theory. For this, we will introduce a new judgement: <img src="https://latex.codecogs.com/png.latex?%5CGamma%20%5Cvdash%20m%20::%5Cmathbb%7BT%7D">, the claim that <img src="https://latex.codecogs.com/png.latex?m"> “models” or “satisfies”<sup>2</sup> the theory <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BT%7D">. We can use variables from the ambient context <img src="https://latex.codecogs.com/png.latex?%5CGamma"> when describing a model, so really this judgement expresses a model-in-context of a theory-in-context.</p>
<p>The rules for producing a model have some moving parts that need to be defined mutually inductively. To build up a model of a theory means providing an appropriate construction in the world of types for each field of the theory.</p>
<div class="tikz">
<img src="https://topos.institute/blog/2026-06-15-geometric-type-theory-done-two-ways/_svgs/aaa60e59be38a69d3f68b45029f720320e7d1b35.svg" class="img-fluid">
</div>
<p>Each component of a model binds the names in its contexts <img src="https://latex.codecogs.com/png.latex?%5CDelta"> and <img src="https://latex.codecogs.com/png.latex?%5CPhi">. The construction context <img src="https://latex.codecogs.com/png.latex?%5CPhi"> for each field is interpreted using the components we have already specified for the previous fields of the theory. For example, when describing a model of the theory of a monoid, once we’ve chosen a type <img src="https://latex.codecogs.com/png.latex?A"> to use as the carrier, specifying the operations and equations involves elements of that specific type <img src="https://latex.codecogs.com/png.latex?A"> occurring entirely in the type-theoretic world.</p>
<p>Carrying this out means using admissible operations that have the following shape. Given a model of a theory, we are able to interpret any construction context, construction, and construction substitution in that model, giving a result in the underlying type theory.</p>
<div class="tikz">
<img src="https://topos.institute/blog/2026-06-15-geometric-type-theory-done-two-ways/_svgs/d3388b7e6c02a5b7053ff7d0a1c55c9171e06de6.svg" class="img-fluid">
</div>
<p><!-- \inferrule*[fraction={-{\,-\,}-}] { --> <!-- \Gamma \yields m \sats \thT \\\\ --> <!-- \Gamma, \Delta' \yields \tau : \Delta \and --> <!-- \Gamma \mid \thT \mid \Delta' \smid \Phi' \yields \theta : \Phi[\tau]}{\Gamma, \Delta', \interp{\Phi'}{m} \yields \interp{\theta}{m} : \interp{\Phi}{m}} --></p>
<p>This is done by induction on the structure of the constructions involved, so for example:</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Cbegin%7Balign*%7D%0A%20%20%7B%5Cllbracket%20%5Cphi%20+%20%5Cpsi%20%5Crrbracket%7D_%7Bm%7D%20&amp;:%5Cequiv%7B%5Cllbracket%20%5Cphi%20%5Crrbracket%7D_%7Bm%7D%20+%20%7B%5Cllbracket%20%5Cpsi%20%5Crrbracket%7D_%7Bm%7D%20%5C%5C%0A%20%20%7B%5Cllbracket%20%5Cphi%20%5Ctimes%20%5Cpsi%20%5Crrbracket%7D_%7Bm%7D%20&amp;:%5Cequiv%7B%5Cllbracket%20%5Cphi%20%5Crrbracket%7D_%7Bm%7D%20%5Ctimes%20%7B%5Cllbracket%20%5Cpsi%20%5Crrbracket%7D_%7Bm%7D%20%5C%5C%0A%20%20&amp;%5Cdots%0A%5Cend%7Balign*%7D"></p>
<p>Once we reach the base cases of the direct use of a sort or a term, the model provides exactly the type or element to be used in that location.</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Cbegin%7Balign*%7D%0A%20%20%7B%5Cllbracket%20X(%5Ctau;%5Ctheta)%20%5Crrbracket%7D_%7Bm%7D%20&amp;:%5Cequiv%20m.X%5B%5Ctau%5D%5B%7B%5Cllbracket%20%5Ctheta%20%5Crrbracket%7D_%7Bm%7D%5D%20%5C%5C%0A%20%20%7B%5Cllbracket%20f(%5Ctau;%5Ctheta)%20%5Crrbracket%7D_%7Bm%7D%20&amp;:%5Cequiv%20m.f%5B%5Ctau%5D%5B%7B%5Cllbracket%20%5Ctheta%20%5Crrbracket%7D_%7Bm%7D%5D%0A%5Cend%7Balign*%7D"> Here, <img src="https://latex.codecogs.com/png.latex?m.X"> and <img src="https://latex.codecogs.com/png.latex?m.f"> project the corresponding component of the model.</p>
</section>
<section id="stepping-into-a-classifying-topos" class="level2" data-number="1.6">
<h2 data-number="1.6" data-anchor-id="stepping-into-a-classifying-topos"><span class="header-section-number">1.6</span> Stepping Into a Classifying Topos</h2>
<p>Our goal from the start has been to find a way to work in the “internal language of all toposes”. Once we’ve described a theory, we need a way to step into the classifying topos of that theory. We’ll do this by adding a new notion of context extension for the ambient context <img src="https://latex.codecogs.com/png.latex?%5CGamma">, which allows us to hypothesise a model of a theory rather than an element of a type.</p>
<div class="tikz">
<img src="https://topos.institute/blog/2026-06-15-geometric-type-theory-done-two-ways/_svgs/ae301e7ea6debc307529e98571874e3c30b4a67c.svg" class="img-fluid">
</div>
<p>Working inside the ambient context “<img src="https://latex.codecogs.com/png.latex?u%20::%5Cmathbb%7BT%7D%5C,%5C,%5Cmathsf%7Bctx%7D">” will correspond to working internal to the classifying topos <img src="https://latex.codecogs.com/png.latex?%5Cmathrm%7BSet%7D%5B%5Cmathbb%7BT%7D%5D">. The universal model of <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BT%7D"> inside <img src="https://latex.codecogs.com/png.latex?%5Cmathrm%7BSet%7D%5B%5Cmathbb%7BT%7D%5D"> is exactly the model <img src="https://latex.codecogs.com/png.latex?u">, which we will have access to using a variable rule (to be described soon) for these model context extensions. More generally, <img src="https://latex.codecogs.com/png.latex?%5CGamma%20%5Cvdash%5Cmathbb%7BT%7D%5C,%5C,%5Cmathsf%7Btheory%7D"> is a theory internal to the topos specified by the context <img src="https://latex.codecogs.com/png.latex?%5CGamma"> , and the extended context <img src="https://latex.codecogs.com/png.latex?%5CGamma,%20u%20::%0A%5Cmathbb%7BT%7D%5C,%5C,%5Cmathsf%7Bctx%7D"> is then the classifying topos <img src="https://latex.codecogs.com/png.latex?%5CGamma%5B%5Cmathbb%7BT%7D%5D">.</p>
<p>So, “<img src="https://latex.codecogs.com/png.latex?%5CGamma">” in the judgements and rules we’ve seen so far is now generalised to allow interleaving of ordinary and model context extensions. The “<img src="https://latex.codecogs.com/png.latex?%5CDelta">” context appearing in the description of sorts and terms is <em>not</em> generalised in this way; it must only contain ordinary variables.</p>
<p>This new notion of context extension has corresponding weakening and substitution operations, but here we encounter a wrinkle. Semantically, these correspond to pullback along a geometric morphism, which does <em>not</em> commute with all type formers and operations.</p>
<p>This manifests as weakenings and substitutions getting stuck in certain places. In particular, we must make this kind of weakening explicit rather than silent in the syntax of a term.</p>
<div class="tikz">
<img src="https://topos.institute/blog/2026-06-15-geometric-type-theory-done-two-ways/_svgs/294f6f781ceeeb6e392c12446c41a047b9829dce.svg" class="img-fluid">
</div>
<p>We have equations that push both of these operations through geometric term and type constructors, but none of the others.</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Cbegin%7Balign*%7D%0A%20%20((x%20:%20A)%20%5Ctimes%20B)%5C%7B%7Bm/u%7D%5C%7D%20&amp;%5Cequiv(x%20:%20A%5C%7B%7Bm/u%7D%5C%7D)%20%5Ctimes%20B%5C%7B%7Bm/u%7D%5C%7D%20%5C%5C%0A%20%20(A%20+%20B)%5C%7B%7Bm/u%7D%5C%7D%20&amp;%5Cequiv(A%5C%7B%7Bm/u%7D%5C%7D%20+%20B%5C%7B%7Bm/u%7D%5C%7D)%20%5C%5C%0A%20%20~%5C%5C%0A%20%20(A%20%5Cto%20B)%5C%7B%7Bm/u%7D%5C%7D%20&amp;%5Cnot%5Cequiv%20A%5C%7B%7Bm/u%7D%5C%7D%20%5Cto%20B%5C%7B%7Bm/u%7D%5C%7D%20%5C%5C%0A%20%20%5Cmathcal%7BU%7D%5C%7B%7Bm/u%7D%5C%7D%20&amp;%5Cnot%5Cequiv%5Cmathcal%7BU%7D%0A%5Cend%7Balign*%7D"></p>
<p>Similarly, these model substitutions push into theories and constructions. By their very nature these are all built out of geometric pieces, with the exception of <img src="https://latex.codecogs.com/png.latex?%5Cmathop%7B%5Cmathrm%7B%5Cmathbb%7BA%7Dx%7D%7D"> constructions. Once this shifts us back into the world of types, the model substitution may get stuck again on a non-geometric type former.</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Cbegin%7Balign*%7D%0A%20%20(%5Cmathbb%7BT%7D,%20(%5CDelta%5Cmathbin%7B;%7D%5CPhi%20%5Cvdash%20X%20%5C,%5C,%5Cmathsf%7Bsort%7D))%5C%7B%7Bm/u%7D%5C%7D%20&amp;%5Cequiv%5Cmathbb%7BT%7D%5C%7B%7Bm/u%7D%5C%7D,%20(%5CDelta%5C%7B%7Bm/u%7D%5C%7D%5Cmathbin%7B;%7D%5CPhi%5C%7B%7Bm/u%7D%5C%7D%20%5Cvdash%20X%20%5C,%5C,%5Cmathsf%7Bsort%7D)%20%5C%5C%0A%20%20(%5Cmathbb%7BT%7D,%20(%5CDelta%5Cmathbin%7B;%7D%5CPhi%20%5Cvdash%20x%20:%20%5Cphi))%5C%7B%7Bm/u%7D%5C%7D%20&amp;%5Cequiv%5Cmathbb%7BT%7D%5C%7B%7Bm/u%7D%5C%7D,%20(%5CDelta%5C%7B%7Bm/u%7D%5C%7D%5Cmathbin%7B;%7D%5CPhi%5C%7B%7Bm/u%7D%5C%7D%20%5Cvdash%20x%20:%20%5Cphi%5C%7B%7Bm/u%7D%5C%7D)%0A%5Cend%7Balign*%7D"></p>
<p>We now have the language necessary to specify the variable rule:</p>
<div class="tikz">
<img src="https://topos.institute/blog/2026-06-15-geometric-type-theory-done-two-ways/_svgs/59c98cd669b7b89d68b5dd93fb20d58b69bb96bc.svg" class="img-fluid">
</div>
<p>That is, we have a theory <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BT%7D"> internal to a topos <img src="https://latex.codecogs.com/png.latex?%5CGamma">. Inside the classifying topos <img src="https://latex.codecogs.com/png.latex?%5CGamma%5B%5Cmathbb%7BT%7D%5D"> there is, from the perspective of <img src="https://latex.codecogs.com/png.latex?%5CGamma">, a universal model of the theory <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BT%7D">. Because the judgement in the conclusion is interpreted in <img src="https://latex.codecogs.com/png.latex?%5CGamma%5B%5Cmathbb%7BT%7D%5D"> itself, this needs to be adjusted: the theory <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BT%7D"> is pulled back from <img src="https://latex.codecogs.com/png.latex?%5CGamma"> to <img src="https://latex.codecogs.com/png.latex?%5CGamma%5B%5Cmathbb%7BT%7D%5D">, and this cannot be totally silent in general. Then inside <img src="https://latex.codecogs.com/png.latex?%5CGamma%5B%5Cmathbb%7BT%7D%5D">, we have a model of this pulled-back theory.</p>
<p>It’s necessary to notate the locations of these explicit weakenings even when the judgement being weakened has no free variables at all. Consider the type <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BN%7D%5Cto%20%5Cmathrm%7BBool%7D">. This may have a nontrivial intrinsic “topology”, which varies depending on the topos in which it is constructed. Even in the simplest case of the classifier of the theory of an object, the types <img src="https://latex.codecogs.com/png.latex?u%20::(X%20%5C,%5C,%5Cmathsf%7Bsort%7D)%20%5Cvdash%5Cmathbb%7BN%7D%5Cto%0A%5Cmathrm%7BBool%7D%20%5C,%5C,%5Cmathsf%7Btype%7D"> and <img src="https://latex.codecogs.com/png.latex?u%20::(X%20%5C,%5C,%5Cmathsf%7Bsort%7D)%20%5Cvdash(%5Cmathbb%7BN%7D%5Cto%0A%5Cmathrm%7BBool%7D)%5C%7B%7B%5Cuparrow%5E%7Bu%7D%7D%5C%7D%20%5C,%5C,%5Cmathsf%7Btype%7D"> are non-isomorphic, even though <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BN%7D%5C%7B%7B%5Cuparrow%5E%7Bu%7D%7D%5C%7D%20%5Ccong%20%5Cmathbb%7BN%7D"> and <img src="https://latex.codecogs.com/png.latex?%5Cmathrm%7BBool%7D%5C%7B%7B%5Cuparrow%5E%7Bu%7D%7D%5C%7D%20%5Ccong%20%5Cmathrm%7BBool%7D"> individually.</p>
</section>
</section>
<section id="geometric-type-theory-a-la-emtt" class="level1" data-number="2">
<h1 data-number="2"><span class="header-section-number">2</span> Geometric Type Theory a la EMTT</h1>
<p>The type theory that I’ve described in the previous section does not depart too far from geometric theories as they are usually understood, besides switching to the propositions-as-types perspective. There is, however, a serious proliferation of additional judgements and operations necessary to get it all to work. I’d like to outline an alternative, closer to Owen Lynch’s <a href="https://www.youtube.com/watch?v=Id-9XE5TsA8">EMTT</a>, which was also discussed a little in David Jaz’s previous <a href="../../blog/2025-07-13-liberating-synthetic-quasi-coherence-from-forcing/#def-emtt">blog post</a>.</p>
<p>The key insight is that a mixed, type-to-theory notion of <img src="https://latex.codecogs.com/png.latex?%5CPi">-type is sufficient for many of the features we are looking for, though it takes a bit of work to reconstruct them, and theories written in this style look somewhat different to straight-line style of the last section.</p>
<p>Let’s reset back to plain MLTT as a baseline; we’re back to not having a theory context or a separate language of constructions. The only novel judgements we’ll maintain are the theory-in-context and model-in-context judgements that we added at the end.</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Cbegin%7Balign*%7D%0A&amp;%5CGamma%20%5Cvdash%20A%20%5C,%5C,%5Cmathsf%7Btype%7D&amp;&amp;%20%5Cquad%20%5Ctext%7BType%7D%20%5C%5C%0A&amp;%5CGamma%20%5Cvdash%20a%20:%20A%20&amp;&amp;%20%5Cquad%20%5Ctext%7BElement%7D%20%5C%5C%0A&amp;%5CGamma%20%5Cvdash%5Cmathbb%7BT%7D%5C,%5C,%5Cmathsf%7Btheory%7D&amp;&amp;%20%5Cquad%20%5Ctext%7BTheory%7D%20%5C%5C%0A&amp;%5CGamma%20%5Cvdash%20m%20::%5Cmathbb%7BT%7D&amp;&amp;%20%5Cquad%20%5Ctext%7BModel%7D%0A%5Cend%7Balign*%7D"></p>
<p>These still have the associated special context extension, explicit weakening and model substitution, and these latter two still have the special “stuck” behaviour when it comes to non-geometric types.</p>
<p>We’re now going to treat theories and their models much more like an ordinary dependent type theory, albeit a fairly impoverished one. First, we’ll have 1 and <img src="https://latex.codecogs.com/png.latex?%5CSigma"> theories with precisely the rules you would expect (though note the use of model substitution rather than ordinary substitution).</p>
<div class="tikz">
<img src="https://topos.institute/blog/2026-06-15-geometric-type-theory-done-two-ways/_svgs/7b2f95c39ec54cb8c9818f8448cd1c97724142c7.svg" class="img-fluid">
</div>
<p>There are then two special base-cases, the first acting as the replacement for the “<img src="https://latex.codecogs.com/png.latex?%5CPhi%20%5Cvdash%20X%20%5C,%5C,%5Cmathsf%7Bsort%7D">” of theories in the previous style. (In this overview I am neglecting universe levels, which would need to be tracked in the “<img src="https://latex.codecogs.com/png.latex?m%20::A">” judgement.)</p>
<div class="tikz">
<img src="https://topos.institute/blog/2026-06-15-geometric-type-theory-done-two-ways/_svgs/98a04f0ea9e0801a90965baf1a2b92a4f4afd3d6.svg" class="img-fluid">
</div>
<p>Secondly, a new, simpler version of <img src="https://latex.codecogs.com/png.latex?%5Cmathop%7B%5Cmathrm%7B%5Cmathbb%7BA%7Dx%7D%7DA">.</p>
<div class="tikz">
<img src="https://topos.institute/blog/2026-06-15-geometric-type-theory-done-two-ways/_svgs/701d2e1354f792cf9f86f25247e6a3e61ed9ebcd.svg" class="img-fluid">
</div>
<p>Finally, the glue that makes this all work: mixed type-theory <img src="https://latex.codecogs.com/png.latex?%5CPi">-types.</p>
<div class="tikz">
<img src="https://topos.institute/blog/2026-06-15-geometric-type-theory-done-two-ways/_svgs/c7817f72dba062dc07d56f55c7fa4b3946914fec.svg" class="img-fluid">
</div>
<p>Here the substitution involved is to the ordinary kind, of a term into an ordinary variable. In the non-dependent case, let’s write <img src="https://latex.codecogs.com/png.latex?A%20%5Cvartriangleright%0A%5Cmathbb%7BT%7D"> to save on notation.</p>
<p>Similar to before, we still need to add additional eliminators to inductive types to eliminate into the new judgements. This time, at least, there is no separate language of constructions that duplicates all the standard type formers.</p>
<div class="tikz">
<img src="https://topos.institute/blog/2026-06-15-geometric-type-theory-done-two-ways/_svgs/ba4de3996fdfd838842017bd41af1ba0abd3ae5f.svg" class="img-fluid">
</div>
<p>That’s it! These components have some heavy lifting to do in order to match the features of the previous style. First, the <img src="https://latex.codecogs.com/png.latex?%5CSigma">-theories are used to replace the “theory context” <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BT%7D"> that we were using previously. This is more subtle than it may first appear because, if you inspect the typing of the theory for the second component <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BT%7D">, this is now a theory <em>internal to</em> the classifying topos of the theory <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BS%7D">. In the previous style, the types that could occur in the telescopes present in a theory all came from the fixed ambient context <img src="https://latex.codecogs.com/png.latex?%5CGamma">. In this style, the types appearing in <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BT%7D"> now exist in the classifying topos <img src="https://latex.codecogs.com/png.latex?%5CGamma%5B%5Cmathbb%7BS%7D%5D">, and so have to be manually weakened from <img src="https://latex.codecogs.com/png.latex?%5CGamma"> if necessary.</p>
<p>Second, we need some way of emulating the construction context <img src="https://latex.codecogs.com/png.latex?%5CPhi">. This relies on the fact we’ve just seen; that each additional field in a theory is now constructed internal to the classifying topos of the theory so far. And so, what was previously a context of constructions written in a restricted language can be simulated using these <img src="https://latex.codecogs.com/png.latex?%5Cvartriangleright">-types.</p>
<p>This is a lot to take in, so let’s write out some basic theories in the new style. There are fewer moving parts, but the price we pay is that describing a theory is now more noisy. It’s possible that, eventually, an elaboration algorithm will be able to insert all the necessary conversions between judgements, but for now we will keep things fully explicit.</p>
<p>First, the theory of an object is immediate: we have <img src="https://latex.codecogs.com/png.latex?%5Cmathrm%7B%5Cmathbb%7BS%7Dort%7D%5C,%5C,%5Cmathsf%7Btheory%7D"> in the empty context. To add in a point of that sort is a little more involved: First, we describe the theory of “a point of <img src="https://latex.codecogs.com/png.latex?X">”, working internal to the topos described by the context <img src="https://latex.codecogs.com/png.latex?X%20::%5Cmathrm%7B%5Cmathbb%7BS%7Dort%7D">.</p>
<div class="tikz">
<img src="https://topos.institute/blog/2026-06-15-geometric-type-theory-done-two-ways/_svgs/5085352a208c5365f3d7ba20e54911ef818fdd0c.svg" class="img-fluid">
</div>
<p>That is, internal to <img src="https://latex.codecogs.com/png.latex?%5Cmathrm%7BSet%7D%5BX%5D">, we are looking at the theory with a single axiom, an element of the type for the sort <img src="https://latex.codecogs.com/png.latex?X">. In the first line, the model variable rule gives a model of the explicitly weakened <img src="https://latex.codecogs.com/png.latex?%5Cmathrm%7B%5Cmathbb%7BS%7Dort%7D%5C%7B%7B%5Cuparrow%5E%7BX%7D%7D%5C%7D">, but this is equal to <img src="https://latex.codecogs.com/png.latex?%5Cmathrm%7B%5Cmathbb%7BS%7Dort%7D">.</p>
<p>The internal theory we end up with on the last line is exactly of the shape to form a <img src="https://latex.codecogs.com/png.latex?%5CSigma">-theory, so together our theory of a pointed object in the empty context is: <img src="https://latex.codecogs.com/png.latex?%5Cbegin%7Balign*%7D%0A(X%20::%5Cmathrm%7B%5Cmathbb%7BS%7Dort%7D)%20%5Ctimes%20%5Cmathop%7B%5Cmathrm%7B%5Cmathbb%7BA%7Dx%7D%7D%5Cmathop%7B%5Cmathrm%7Bty%7D%7DX%0A%5Cend%7Balign*%7D"></p>
<p>Let’s add a binary operation. We could do this in a context containing a model of the <img src="https://latex.codecogs.com/png.latex?%5CSigma">-theory, but it’s a little clearer to instead extend the <img src="https://latex.codecogs.com/png.latex?X%20::%5Cmathrm%7B%5Cmathbb%7BS%7Dort%7D"> context with the point and proceed from there. To reference <img src="https://latex.codecogs.com/png.latex?X"> in this extended context, we now have to explicitly weaken <img src="https://latex.codecogs.com/png.latex?X"> past the point <img src="https://latex.codecogs.com/png.latex?e"> we’ve just added in.</p>
<div class="tikz">
<img src="https://topos.institute/blog/2026-06-15-geometric-type-theory-done-two-ways/_svgs/3b152a1ed6f15294f6f81d1cf8762f2ec0ac1385.svg" class="img-fluid">
</div>
<p>That is, the use of <img src="https://latex.codecogs.com/png.latex?X"> is justified by</p>
<div class="tikz">
<img src="https://topos.institute/blog/2026-06-15-geometric-type-theory-done-two-ways/_svgs/c2f3b1791baa67eae0289b1e43badba03c3fd3a5.svg" class="img-fluid">
</div>
<p>using the two different kinds of weakening we have available to us. Finally, let’s express that <img src="https://latex.codecogs.com/png.latex?e"> is a left unit for this multiplication. For this, we’re going to use an axiom of the <em>ordinary equality type</em>, rather than an equality construction as we did previously. Let’s abbreviate the context to save space:</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Cbegin%7Balign*%7D%0A%20%20%5CGamma%20:%5Cequiv%20X%20::%5Cmathrm%7B%5Cmathbb%7BS%7Dort%7D,%20e%20::%5Cmathop%7B%5Cmathrm%7B%5Cmathbb%7BA%7Dx%7D%7D%5Cmathop%7B%5Cmathrm%7Bty%7D%7DX,%20m%20::%7B%5Cmathop%7B%5Cmathrm%7Bty%7D%7DX%5C%7B%7B%5Cuparrow%5E%7B%7D%7D%5C%7D%7D%20%5Cvartriangleright%7B%5Cmathop%7B%5Cmathrm%7Bty%7D%7DX%5C%7B%7B%5Cuparrow%5E%7B%7D%7D%5C%7D%7D%20%5Cvartriangleright%5Cmathop%7B%5Cmathrm%7B%5Cmathbb%7BA%7Dx%7D%7D%5Cmathop%7B%5Cmathrm%7Bty%7D%7DX%5C%7B%7B%5Cuparrow%5E%7B%7D%7D%5C%7D%0A%5Cend%7Balign*%7D"></p>
<p>Then:</p>
<div class="tikz">
<img src="https://topos.institute/blog/2026-06-15-geometric-type-theory-done-two-ways/_svgs/1b89607c10c93082ad426c05171e648dd884cd1e.svg" class="img-fluid">
</div>
<p>Again, we should be able to hide most of this noise in a practical system!</p>
</section>
<section id="next-steps" class="level1" data-number="3">
<h1 data-number="3"><span class="header-section-number">3</span> Next Steps</h1>
<p>There’s a lot about the design of the type theory which is still up in the air. Here are some of the things I’ve been wondering about.</p>
<section id="ingos-synthetic-quasicoherence" class="level2" data-number="3.1">
<h2 data-number="3.1" data-anchor-id="ingos-synthetic-quasicoherence"><span class="header-section-number">3.1</span> Ingo’s Synthetic Quasicoherence</h2>
<p>The purpose of this whole exercise was to devise a setting in which we could state Ingo’s quasicoherence principle, and this is where the theory starts to hit the rocks.</p>
<p>In the framing that I want to use, his principle gives a universal property to a certain theory living inside any classifying topos <img src="https://latex.codecogs.com/png.latex?u%0A::%5Cmathbb%7BT%7D">; the “slice theory” <img src="https://latex.codecogs.com/png.latex?u%20%5C!%5Cdownarrow%5C!%5Cmathbb%7BT%7D">. This is the theory of “<img src="https://latex.codecogs.com/png.latex?u">-algebras”, models of <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BT%7D"> equipped with a homomorphism from the universal model <img src="https://latex.codecogs.com/png.latex?u">. Because this is happening inside the classifying topos <img src="https://latex.codecogs.com/png.latex?u%20::%5Cmathbb%7BT%7D">, we are not working with models of <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BT%7D"> exactly; we must explicitly weaken <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BT%7D"> into that extended context.</p>
<p>I won’t attempt a general definition of <img src="https://latex.codecogs.com/png.latex?u%20%5C!%5Cdownarrow%5C!%5Cmathbb%7BT%7D"> here. It’s up in the air whether this theory should be defined “observationally” in terms of the theory <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BT%7D">, that is, computing by induction on the structure of <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BT%7D">. Or perhaps the quasicoherence principle I’m about to describe will characterise this slice theory completely, and it can be <em>proved</em> inductively <img src="https://latex.codecogs.com/png.latex?u%20%5C!%5Cdownarrow%5C!%5Cmathbb%7BT%7D"> is equivalent to the theory of homomorphisms out of <img src="https://latex.codecogs.com/png.latex?u">.</p>
<p>Phrased both more syntactically and more naively than in the <a href="../../blog/2025-07-13-liberating-synthetic-quasi-coherence-from-forcing/#dreaming-of-homotopy-types">previous post</a>, the induction principle has the following shape:</p>
<div class="tikz">
<img src="https://topos.institute/blog/2026-06-15-geometric-type-theory-done-two-ways/_svgs/b4482c0e994c8618af86cacbedfd85d714fded4f.svg" class="img-fluid">
</div>
<p>In words:</p>
<blockquote class="blockquote">
<p>Working internally to the classifying topos for <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BT%7D">, to show a quasicoherent statement about <img src="https://latex.codecogs.com/png.latex?u">-algebras it suffices to prove the statement for the <em>identity</em> <img src="https://latex.codecogs.com/png.latex?u">-algebra.</p>
</blockquote>
<p>This is highly reminiscent of ordinary path-induction; in order to “map out” of the slice theory <img src="https://latex.codecogs.com/png.latex?u%20%5C!%5Cdownarrow%5C!%5Cmathbb%7BT%7D">, it suffices to give the image at the identity algebra.</p>
<p>We’ve used a judgement that ensures that a context telescope is etale, meaning that it only consists of ordinary context extensions and does not contain any model-extensions. The addition of the etale telescope <img src="https://latex.codecogs.com/png.latex?%5CDelta"> is necessary to do anything interesting here; the principle holds for any slice of the classifying topos for <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BT%7D">.</p>
<p>With the above rule in hand, we can attempt to replicate one of Ingo’s proofs of an interesting non-geometric feature of a classifying topos: any two elements of the universal object <img src="https://latex.codecogs.com/png.latex?u%20::%5Cmathrm%7B%5Cmathbb%7BS%7Dort%7D"> are <em>not not</em> equal, where “not” is defined in the ordinary way as <img src="https://latex.codecogs.com/png.latex?%5Cneg%20X%0A:%5Cequiv%20X%20%5Cto%20%5Cvarnothing">. (This is only indicative of what the argument will look like; the precise induction rule is not pinned down enough for this to be formal.)</p>
<p>We’ll do this in excruciating detail, with all the judgement-switching made explicit. In search of a contradiction, suppose we have <img src="https://latex.codecogs.com/png.latex?x,%20y%20:%0A%5Cmathop%7B%5Cmathrm%7Bty%7D%7Du"> so that <img src="https://latex.codecogs.com/png.latex?c%20:%20%5Cneg%20(x%20=%20y)">; that is, our context is <img src="https://latex.codecogs.com/png.latex?%5CGamma%20:%5Cequiv%20u%20::%5Cmathrm%7B%5Cmathbb%7BS%7Dort%7D,%20x%20:%20%5Cmathop%7B%5Cmathrm%7Bty%7D%7Du,%20y%20:%20%5Cmathop%7B%5Cmathrm%7Bty%7D%7Du,%0Ac%20:%20%5Cneg(x=y)."></p>
<p>The slice theory <img src="https://latex.codecogs.com/png.latex?u%20%5C!%5Cdownarrow%5C!%5Cmathrm%7B%5Cmathbb%7BS%7Dort%7D"> in this case is the theory of a sort <img src="https://latex.codecogs.com/png.latex?v"> together with, for every element <img src="https://latex.codecogs.com/png.latex?e%20:%20%5Cmathop%7B%5Cmathrm%7Bty%7D%7Du%5C%7B%7B%5Cuparrow%5E%7B%7D%7D%5C%7D">, an axiom <img src="https://latex.codecogs.com/png.latex?a_e%20:%20v">. Such a map is exactly a model of <img src="https://latex.codecogs.com/png.latex?%5Cmathop%7B%5Cmathrm%7Bty%7D%7Du%5C%7B%7B%5Cuparrow%5E%7B%7D%7D%5C%7D%0A%5Cvartriangleright%5Cmathop%7B%5Cmathrm%7B%5Cmathbb%7BA%7Dx%7D%7D%5Cmathop%7B%5Cmathrm%7Bty%7D%7Dv">, so the slice theory in total is <img src="https://latex.codecogs.com/png.latex?u%20%5C!%5Cdownarrow%5C!%0A%5Cmathrm%7B%5Cmathbb%7BS%7Dort%7D:%5Cequiv(v%20::%20%5Cmathrm%7B%5Cmathbb%7BS%7Dort%7D)%20%5Ctimes%20(%5Cmathop%7B%5Cmathrm%7Bty%7D%7Du%5C%7B%7B%5Cuparrow%5E%7B%7D%7D%5C%7D%20%5Cvartriangleright%5Cmathop%7B%5Cmathrm%7B%5Cmathbb%7BA%7Dx%7D%7D%0A%5Cmathop%7B%5Cmathrm%7Bty%7D%7Dv)."> There is certainly a model of this theory given by the identity homomorphism, which in this case is the pair <img src="https://latex.codecogs.com/png.latex?(u%5C%7B%7B%5Cuparrow%5E%7B%7D%7D%5C%7D,%0A%5Clambda%20e.%20%5Cmathop%7B%5Cmathrm%7Bax%7D%7De)">.</p>
<p>Working further inside the classifying topos for this <img src="https://latex.codecogs.com/png.latex?h%20::u%0A%5C!%5Cdownarrow%5C!%5Cmathrm%7B%5Cmathbb%7BS%7Dort%7D">, we can form the “motive” theory: <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BC%7D:%5Cequiv%0A%5Cleft(%5Cmathop%7B%5Cmathrm%7Bunax%7D%7D(%5Cmathsf%7Bpr%7D_2%20h)(x%5C%7B%7B%5Cuparrow%5E%7B%7D%7D%5C%7D)%20=%20%5Cmathop%7B%5Cmathrm%7Bunax%7D%7D(%5Cmathsf%7Bpr%7D_2%20h)(y%5C%7B%7B%5Cuparrow%5E%7B%7D%7D%5C%7D)%5Cright)%0A%5Cvartriangleright%5Cmathop%7B%5Cmathrm%7B%5Cmathbb%7BA%7Dx%7D%7D%5Cvarnothing."> If we substitute the identity model for <img src="https://latex.codecogs.com/png.latex?h"> yielding a model internal only to <img src="https://latex.codecogs.com/png.latex?u::%5Cmathrm%7B%5Cmathbb%7BS%7Dort%7D">, the theory <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BC%7D%5C%7B%7B(u%5C%7B%7B%5Cuparrow%5E%7B%7D%7D%5C%7D,%20%5Clambda%20e.%20%5Cmathop%7B%5Cmathrm%7Bax%7D%7De)/h%7D%5C%7D"> reduces all the way to <img src="https://latex.codecogs.com/png.latex?(x%0A=%20y)%20%5Cvartriangleright%5Cmathop%7B%5Cmathrm%7B%5Cmathbb%7BA%7Dx%7D%7D%5Cvarnothing">. We certainly have a model of this theory, built easily from <img src="https://latex.codecogs.com/png.latex?c">: <img src="https://latex.codecogs.com/png.latex?(%5Clambda%20p.%20%5Cmathop%7B%5Cmathrm%7Bax%7D%7Dc(p))%20:%20(x%20=%20y)%20%5Cvartriangleright%5Cmathop%7B%5Cmathrm%7B%5Cmathbb%7BA%7Dx%7D%7D%5Cvarnothing."></p>
<p>By the quasicoherence principle, we have a model of <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BC%7D%5C%7B%7Bm/h%7D%5C%7D"> for any model <img src="https://latex.codecogs.com/png.latex?m%20::u%20%5C!%5Cdownarrow%5C!%5Cmathrm%7B%5Cmathbb%7BS%7Dort%7D">. We now choose a specific model to use that solves this problem: the quotient type <img src="https://latex.codecogs.com/png.latex?(%5Cmathop%7B%5Cmathrm%7Bty%7D%7D%0Au)/(x=y)">, given the structure of a <img src="https://latex.codecogs.com/png.latex?u">-algebra by the function <img src="https://latex.codecogs.com/png.latex?%5Cmathsf%7Bquot%7D%20:%20%5Cmathop%7B%5Cmathrm%7Bty%7D%7Du%20%5Cto%20(%5Cmathop%7B%5Cmathrm%7Bty%7D%7Du)/(x=y)">. More precisely, we’re forming the model</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Cbegin%7Balign*%7D%0A&amp;m%20::(v%20::%20%5Cmathrm%7B%5Cmathbb%7BS%7Dort%7D)%20%5Ctimes%20(%5Cmathop%7B%5Cmathrm%7Bty%7D%7Du%5C%7B%7B%5Cuparrow%5E%7B%7D%7D%5C%7D%20%5Cvartriangleright%5Cmathop%7B%5Cmathrm%7B%5Cmathbb%7BA%7Dx%7D%7D%5Cmathop%7B%5Cmathrm%7Bty%7D%7Dv)%20%5C%5C%0A&amp;m%20:%5Cequiv(%5Cmathop%7B%5Cmathrm%7Bsort%7D%7D((%5Cmathop%7B%5Cmathrm%7Bty%7D%7Du)/(x=y)),%20%5Clambda%20z.%20%5Cmathop%7B%5Cmathrm%7Bax%7D%7D%5Cmathsf%7Bquot%7D(z))%0A%5Cend%7Balign*%7D"></p>
<p>Performing the substitution of this model into <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BC%7D">, we see that induction has given us a model of <img src="https://latex.codecogs.com/png.latex?(%5Cmathsf%7Bquot%7D(x)%20=%0A%5Cmathsf%7Bquot%7D(y))%20%5Cvartriangleright%5Cmathop%7B%5Cmathrm%7B%5Cmathbb%7BA%7Dx%7D%7D%5Cvarnothing">. Because we do indeed have an element of <img src="https://latex.codecogs.com/png.latex?%5Cmathsf%7Bquot%7D(x)%20=%20%5Cmathsf%7Bquot%7D(y)"> in the quotient type <img src="https://latex.codecogs.com/png.latex?(%5Cmathop%7B%5Cmathrm%7Bty%7D%7Du)/(x=y)">, this yields a model of <img src="https://latex.codecogs.com/png.latex?%5Cmathop%7B%5Cmathrm%7B%5Cmathbb%7BA%7Dx%7D%7D%5Cvarnothing">, and so an element of <img src="https://latex.codecogs.com/png.latex?%5Cvarnothing">. Contradiction!</p>
<p>There are a few issues with the rule as presented above. First, one crucial aspect of the induction principle is that it does not apply to arbitrary motives <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BC%7D">, only those that are “quasicoherent” over the context; this is the intended meaning of the <img src="https://latex.codecogs.com/png.latex?%5Cmathsf%7Btheory%7D%5Eq"> annotation<sup>3</sup>. In Ingo’s formulation, this is a restriction on which infinitary coproducts are allowed to appear; in our setting, this corresponds to some restriction on exactly what types are allowed to be used inside <img src="https://latex.codecogs.com/png.latex?%5Cmathop%7B%5Cmathrm%7B%5Cmathbb%7BA%7Dx%7D%7D">.</p>
<p>Here’s an example of something we’re <em>not</em> supposed to be able to write. Suppose we’re again working directly in the object classifier, so <img src="https://latex.codecogs.com/png.latex?u%20::%5Cmathrm%7B%5Cmathbb%7BS%7Dort%7D">, and the slice theory <img src="https://latex.codecogs.com/png.latex?h%20::u%20%5C!%5Cdownarrow%5C!%5Cmathrm%7B%5Cmathbb%7BS%7Dort%7D"> is as above. In the context of <img src="https://latex.codecogs.com/png.latex?u"> and <img src="https://latex.codecogs.com/png.latex?h"> we can write down the theory of a section of <img src="https://latex.codecogs.com/png.latex?h">: <img src="https://latex.codecogs.com/png.latex?(g%20::%20%5Cmathop%7B%5Cmathrm%7Bty%7D%7D%5Cmathsf%7Bpr%7D_1(h)%20%5Cvartriangleright%5Cmathop%7B%5Cmathrm%7B%5Cmathbb%7BA%7Dx%7D%7D%0A%5Cmathop%7B%5Cmathrm%7Bty%7D%7Du%5C%7B%7B%5Cuparrow%5E%7B%7D%7D%5C%7D)%20%5Ctimes%20%5Cleft%5B(x%20:%20%5Cmathop%7B%5Cmathrm%7Bty%7D%7D%5Cmathsf%7Bpr%7D_1(h))%20%5Cvartriangleright%20%5Cmathop%7B%5Cmathrm%7B%5Cmathbb%7BA%7Dx%7D%7D(%5Cmathop%7B%5Cmathrm%7Bunax%7D%7D%0Ag(h%5C%7B%7B%5Cuparrow%5E%7B%7D%7D%5C%7D(x))%20=%20x)%5Cright%5D."></p>
<p>This certainly has a model when <img src="https://latex.codecogs.com/png.latex?h"> is the identity <img src="https://latex.codecogs.com/png.latex?u">-algebra, and so quasicoherent induction applied with this motive would summon a section for any <img src="https://latex.codecogs.com/png.latex?u">-algebra. Worse, the existence of a section would pull back to any morphism in any topos. The culprit in this case is the use of the theory <img src="https://latex.codecogs.com/png.latex?%5Cmathop%7B%5Cmathrm%7B%5Cmathbb%7BA%7Dx%7D%7D%5Cmathop%7B%5Cmathrm%7Bty%7D%7Du%5C%7B%7B%5Cuparrow%5E%7B%7D%7D%5C%7D">; this corresponds to an infinitary coproduct that is not quasicoherent over the context. We need some syntactic condition that restricts exactly which types we are allowed to apply <img src="https://latex.codecogs.com/png.latex?%5Cmathop%7B%5Cmathrm%7B%5Cmathbb%7BA%7Dx%7D%7D"> to in the motive of the rule, but how to formulate this condition is unclear.</p>
<p>Second: as written, the rule is syntactically unpleasant due to the non-generic shape of the context in the conclusion. The type theorist’s solution is to cut in for the variable <img src="https://latex.codecogs.com/png.latex?u%20::%5Cmathbb%7BT%7D"> in the conclusion (and probably the extra telescope <img src="https://latex.codecogs.com/png.latex?%5CDelta"> as well). The ordinary justification is that we lose no generality, because if we want to recover the original version of the rule with the variable in the context, we can simply apply the new rule with a context that happens to contain the variable, and use that variable when applying the rule.</p>
<p>Writing out a more familiar example, suppose we have judgements</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Cbegin%7Balign*%7D%0A&amp;%5CGamma,%20x%20:%20A,%20y%20:%20A,%20p%20:%20x%20=%20y%20&amp;&amp;%5Cvdash%20C%20%5C,%5C,%5Cmathsf%7Btype%7D%5C%5C%0A&amp;%5CGamma,%20x%20:%20A%20&amp;&amp;%5Cvdash%20c%20:%20C%5Bx/x,%20x/y,%20%5Cmathsf%7Brefl%7D_x/p%5D%0A%5Cend%7Balign*%7D"> and we wish to construct <img src="https://latex.codecogs.com/png.latex?%5Cbegin%7Balign*%7D%0A%5CGamma,%20x%20:%20A,%20y%20:%20A,%20p%20:%20x%20=%20y%20%5Cvdash%5Cmathsf%7Bind%7D(%7B%5Cdots%7D)%20:%20C%0A%5Cend%7Balign*%7D"> using the ordinary path induction rule. When we apply the rule, we are given additional variables in the context to type the motive, and we choose to supply the term <img src="https://latex.codecogs.com/png.latex?p"> (which happens to be a variable) as the target.</p>
<div class="tikz">
<img src="https://topos.institute/blog/2026-06-15-geometric-type-theory-done-two-ways/_svgs/881c4f6691b7e5cb59972f47fbdd521a9ffc9409.svg" class="img-fluid">
</div>
<p>In our setting, substituting in for the model variable <img src="https://latex.codecogs.com/png.latex?u%20::%5Cmathbb%7BT%7D"> gets stuck on any non-geometric types used in the motive <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BC%7D">: we would no longer be able to obtain a result “internal to <img src="https://latex.codecogs.com/png.latex?%5Cmathrm%7BSet%7D%5B%5Cmathbb%7BT%7D%5D">” directly, only one pulled back from <img src="https://latex.codecogs.com/png.latex?%5Cmathrm%7BSet%7D%5B%5Cmathbb%7BT%7D%5D"> to an arbitrary model.</p>
<p>This is unsatisfying, but may actually be sufficient in practice. How might we use the resulting model of <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BC%7D%5C%7B%7Bm/u%7D%5C%7D">? Well, if <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BC%7D"> contains non-positive constructions then we are stuck for now. However, in combination with other models of theories of the form <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BS%7D%5C%7B%7Bm/u%7D%5C%7D">, we may be able to prove a positive fact beneath the <img src="https://latex.codecogs.com/png.latex?-%5C%7B%7Bm/u%7D%5C%7D">. Then <img src="https://latex.codecogs.com/png.latex?%5C%7B%7Bm/u%7D%5C%7D"> is no longer stuck, and we obtain a proof that the fact holds for the model <img src="https://latex.codecogs.com/png.latex?m"> specifically. It is unclear to me how feasible this kind of reasoning would be to do by hand.</p>
<p>Finally, the rule above is actually <em>underpowered</em> compared to the principle described by Ingo. In its original formulation, the conclusion of the quasicoherence principle is not merely that the quasicoherent statement holds for every <img src="https://latex.codecogs.com/png.latex?u">-algebra, but that there is a <em>proof</em> in geometric logic modulo <img src="https://latex.codecogs.com/png.latex?u%20%5C!%5Cdownarrow%5C!%5Cmathbb%7BT%7D"> that the statement holds (again, all happening internal to <img src="https://latex.codecogs.com/png.latex?u%20::%5Cmathbb%7BT%7D">).</p>
<p>This distinction is impossible to express in our type theory; we do not have a method of “introspection” that lets us manipulate proofs in this way. When might that additional power come in handy? One situation is when we have a model of <img src="https://latex.codecogs.com/png.latex?u%20%5C!%5Cdownarrow%5C!%5Cmathbb%7BT%7D"> not internal to <img src="https://latex.codecogs.com/png.latex?u%20::%5Cmathbb%7BT%7D"> itself, but internal to a topos that is internal to <img src="https://latex.codecogs.com/png.latex?u%0A::%5Cmathbb%7BT%7D">. Because we have a geometric proof of the statement, that proof can be replayed in this inner topos too; and so ought to hold for models of <img src="https://latex.codecogs.com/png.latex?u%20%5C!%5Cdownarrow%5C!%5Cmathbb%7BT%7D"> that live there:</p>
<div class="tikz">
<img src="https://topos.institute/blog/2026-06-15-geometric-type-theory-done-two-ways/_svgs/2dff3163a6925beeabf7642c571a2e9f30cd9cfa.svg" class="img-fluid">
</div>
<p>Heaping speculation on speculation, we may be able to allow the <em>motive</em> of the induction to also lie in an inner topos. Temporarily removing the cut for <img src="https://latex.codecogs.com/png.latex?h">, the rule then has exactly the same shape as the left-rule for the ordinary identity type:</p>
<div class="tikz">
<img src="https://topos.institute/blog/2026-06-15-geometric-type-theory-done-two-ways/_svgs/6d0a3af6847f070e65912c28df4febd6234d5838.svg" class="img-fluid">
</div>
<p>Allowing a general <img src="https://latex.codecogs.com/png.latex?%5CGamma'"> telescope subsumes the need for the intermediate etale telescope <img src="https://latex.codecogs.com/png.latex?%5CDelta"> between <img src="https://latex.codecogs.com/png.latex?u"> and <img src="https://latex.codecogs.com/png.latex?h">: the contents of <img src="https://latex.codecogs.com/png.latex?%5CDelta"> can be explicitly weakened and placed into <img src="https://latex.codecogs.com/png.latex?%5CGamma'"> instead.</p>
<p>The rule certainly needs some quasicoherence restriction on the motive <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BC%7D">, but likely also a restriction on the form of the telescopes <img src="https://latex.codecogs.com/png.latex?%5CGamma'"> that may be used. Exactly what is necessary is a question for the semantics, and I am not the best person to answer it unfortunately.</p>
</section>
<section id="converting-between-styles" class="level2" data-number="3.2">
<h2 data-number="3.2" data-anchor-id="converting-between-styles"><span class="header-section-number">3.2</span> Converting Between Styles</h2>
<p>Converting between the EMTT style and the all-in-one style of theory is not entirely mechanical. Consider the <img src="https://latex.codecogs.com/png.latex?%5CSigma">-theory for the following internal theory: <img src="https://latex.codecogs.com/png.latex?%5Cbegin%7Balign*%7D%0AX%20::%5Cmathrm%7B%5Cmathbb%7BS%7Dort%7D%5Cvdash(%5Cmathop%7B%5Cmathrm%7Bty%7D%7DX%20%5Cto%20%5Cmathop%7B%5Cmathrm%7Bty%7D%7DX)%20%5Cvartriangleright%5Cmathrm%7B%5Cmathbb%7BS%7Dort%7D%5C,%5C,%5Cmathsf%7Btheory%7D%0A%5Cend%7Balign*%7D"> That is, we have an internal theory with one sort for each function <img src="https://latex.codecogs.com/png.latex?X%0A%5Cto%20X">. This should correspond to <em>some</em> geometric theory in the base topos, but which one?</p>
<p>Naturally, <img src="https://latex.codecogs.com/png.latex?(%5Cmathop%7B%5Cmathrm%7Bty%7D%7DX%20%5Cto%20%5Cmathop%7B%5Cmathrm%7Bty%7D%7DX)"> is not a geometric construction in the theory <img src="https://latex.codecogs.com/png.latex?X%20::%5Cmathrm%7B%5Cmathbb%7BS%7Dort%7D">, and so we cannot write in the old style what would be the natural thing: <img src="https://latex.codecogs.com/png.latex?%5Cbegin%7Balign*%7D%0A%20%20%20%20&amp;%5Cmathord%7B%5Ccdot%7D&amp;&amp;%5Cmathbin%7B;%7D%5Cmathord%7B%5Ccdot%7D&amp;&amp;%5Cvdash%20X%20%5C,%5C,%5Cmathsf%7Bsort%7D%5C%5C%0A%20%20%20%20&amp;%5Cmathord%7B%5Ccdot%7D&amp;&amp;%5Cmathbin%7B;%7Df%20:%20X%20%5Cto%20X%20&amp;&amp;%5Cvdash%20Y%20%5C,%5C,%5Cmathsf%7Bsort%7D%0A%5Cend%7Balign*%7D"></p>
<p>Our only option here is to appeal to quasicoherence. We happen to know, via quasicoherence, the non-geometric fact that inside <img src="https://latex.codecogs.com/png.latex?X%20::%0A%5Cmathrm%7B%5Cmathbb%7BS%7Dort%7D"> there is an isomorphism <img src="https://latex.codecogs.com/png.latex?(%5Cmathop%7B%5Cmathrm%7Bty%7D%7DX%20%5Cto%20%5Cmathop%7B%5Cmathrm%7Bty%7D%7DX)%0A%5Csimeq(1%20+%20%5Cmathop%7B%5Cmathrm%7Bty%7D%7DX)">. This lets us write the correct all-in-one version of the theory:</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Cbegin%7Balign*%7D%0A%20%20%20%20&amp;%5Cmathord%7B%5Ccdot%7D&amp;&amp;%5Cmathbin%7B;%7D%5Cmathord%7B%5Ccdot%7D&amp;&amp;%5Cvdash%20X%20%5C,%5C,%5Cmathsf%7Bsort%7D%5C%5C%0A%20%20%20%20&amp;%5Cmathord%7B%5Ccdot%7D&amp;&amp;%5Cmathbin%7B;%7Df%20:%201%20+%20X%20&amp;&amp;%5Cvdash%20Y%20%5C,%5C,%5Cmathsf%7Bsort%7D%0A%5Cend%7Balign*%7D"> Applying this transformation seems difficult to do mechanically!</p>
</section>
<section id="should-model-weakening-be-modal" class="level2" data-number="3.3">
<h2 data-number="3.3" data-anchor-id="should-model-weakening-be-modal"><span class="header-section-number">3.3</span> Should Model Weakening Be Modal?</h2>
<p>One nit in both versions of this type theory is that the rules for model substitution have to be tuned by hand to do the right thing; commuting with certain type and theory constructors but not others.</p>
<p>Here’s an alternative that feels quite natural: we treat weakening past a model context extension as a modal operator that must be introduced and eliminated explicitly. Here’s what that might look like.</p>
<div class="tikz">
<img src="https://topos.institute/blog/2026-06-15-geometric-type-theory-done-two-ways/_svgs/8493668925442432a297098072f4d3c0e0bf752b.svg" class="img-fluid">
</div>
<p>We can then aim to <em>prove</em> that certain constructions commute with <img src="https://latex.codecogs.com/png.latex?%5Cmathsf%7BConst%7D_u"> internally, if we give them sufficiently powerful “crisp” induction principles that can be applied anywhere in the context. For sums, we have the following:</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Cbegin%7Balign*%7D%0A&amp;f%20:%20%5Cmathsf%7BConst%7D_u%20(A%20+%20B)%20%5Cto%20%5Cmathsf%7BConst%7D_u%20A%20+%20%5Cmathsf%7BConst%7D_u%20B%20%5C%5C%0A&amp;f(d)%20:=%20%5Cmathsf%7Blet%7D%20%5C;%20%7B%5Cdelta%5C,%20s%7D%20:=%20%7Bd%7D%20%5C,%20%5Cmathsf%7Bin%7D%20%5C,%20%7B%5Cmathsf%7Bcase%7D(s,%20%5Cmathop%7B%5Cmathrm%7Binl%7D%7Da%20%5Cmapsto%20%5Cmathop%7B%5Cmathrm%7Binl%7D%7D%5Cdelta%5C,%20a,%20%5Cmathop%7B%5Cmathrm%7Binr%7D%7Db%20%5Cmapsto%20%5Cmathop%7B%5Cmathrm%7Binr%7D%7D%5Cdelta%5C,%20b)%7D%20%5C%5C%0A%5Cend%7Balign*%7D"></p>
<p>As a derivation tree, we are typing the body of the definition by:</p>
<div class="tikz">
<img src="https://topos.institute/blog/2026-06-15-geometric-type-theory-done-two-ways/_svgs/aa98c108113a1882f40e3370228bb4db47a6a900.svg" class="img-fluid">
</div>
<p>Key here is that we can apply <img src="https://latex.codecogs.com/png.latex?+">-induction on the term <img src="https://latex.codecogs.com/png.latex?s"> that is well-formed in the prefix of the context that comes before <img src="https://latex.codecogs.com/png.latex?u%20::%5Cmathbb%7BT%7D">.</p>
<p>Using <img src="https://latex.codecogs.com/png.latex?%5Cmathsf%7BConst%7D"> rather than explicit substitutions to isolate the special nature of geometric constructions feels much more satisfying and uniform than building them into the rules directly. But pushing down this bump in the carpet causes it to pop up elsewhere. First, it introduces a lot of wrapping and unwrapping <img src="https://latex.codecogs.com/png.latex?%5Cmathsf%7BConst%7D">s, even for the simple theories we’ve seen already.</p>
<p>Additionally, this interferes with the typing of the model variable rule. In context <img src="https://latex.codecogs.com/png.latex?%5CGamma%20:%5Cequiv%20u%20::%5Cmathbb%7BT%7D">, we should still be able to use the variable <img src="https://latex.codecogs.com/png.latex?u"> directly, giving a model of some theory. What theory is <img src="https://latex.codecogs.com/png.latex?u"> a model of? With explicit weakening, this was <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BT%7D%5C%7B%7B%5Cuparrow%5E%7Bu%7D%7D%5C%7D">. Now, we have to reach into <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BT%7D"> and sprinkle the use of <img src="https://latex.codecogs.com/png.latex?%5Cmathsf%7BConst%7D_u"> everywhere. A symmetric issue happens when applying model substitution as occurs in the rules for <img src="https://latex.codecogs.com/png.latex?%5CSigma">-theories (and elsewhere, in the future). There, the substitution operation has to strip all uses of <img src="https://latex.codecogs.com/png.latex?%5Cmathsf%7BConst%7D_u">. I don’t immediately see any blockers to this working out, but it certainly complicates the metatheory.</p>
<p>Finally, this doesn’t help with the model substitution rule, which should get stuck in all the same places as weakening. I have been unable to come up with sensible rules for a modal operator corresponding to model substitution; model substitution doesn’t seem to be “judgementalisable” in the same way that weakening is:</p>
<div class="tikz">
<img src="https://topos.institute/blog/2026-06-15-geometric-type-theory-done-two-ways/_svgs/c0d14763b00506e904830a2cd1badcc1c26d327c.svg" class="img-fluid">
</div>
<p>This is not the first time the issue of stuck substitutions has been encountered in dependent type theory. The most similar precursors can be seen in the line of work on <a href="https://link.springer.com/chapter/10.1007/978-3-662-49630-5_2"><em>guarded</em> dependent type theory</a>, which uses the “later” modality <img src="https://latex.codecogs.com/png.latex?%5Ctriangleright"> to ensure that recursive definitions are productive. There, delayed substitutions are used to give typing to an applicative structure on <img src="https://latex.codecogs.com/png.latex?%5Ctriangleright"> that works on dependent functions, not just non-dependent functions. Unfortunately the remainder of the setting is quite different, and I’m not sure what lessons can be drawn.</p>
<p>Even more tantalising is that one of the intended models of guarded dependent type theory is the topos of trees; the <a href="https://doi.org/10.46298/entics.10323">classifying topos</a> of an easily described theory. And so, it is possible that the rules of GDTT will one day fall out of geometric type theory as a particular instance.</p>
</section>
<section id="should-model-weakening-be-multimodal" class="level2" data-number="3.4">
<h2 data-number="3.4" data-anchor-id="should-model-weakening-be-multimodal"><span class="header-section-number">3.4</span> Should Model Weakening Be Multimodal?</h2>
<p>Another option is to use the modal frameworks <a href="http://dx.doi.org/10.46298/lmcs-17(3:11)2021">MTT</a> or <a href="http://dx.doi.org/10.46298/entics.12300">MATT</a> to produce a type theory, taking the “mode theory” to be the entire category of toposes and (inverse image parts of) geometric morphisms. Finite diagrams of toposes are the intended application of MATT, and so we are only doing something new if we mix in the ability to specify new modes and mode morphisms as we go. But as a first step, let’s write out MATT in a syntax closer to what we’ve already seen above.</p>
<p>Each context is annotated with a theory <img src="https://latex.codecogs.com/png.latex?%5CGamma%20%5C,%5C,%5Cmathsf%7Bctx%7D_%5Cmathbb%7BT%7D"> specifying the topos in which it lives. We’ll suppose there is a judgement for geometric morphisms <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BT%7D%5Cvdash%5Cmathbb%7BS%7D%5C,%5C,%5Cmathsf%7Btheory%7D"> (representing the geometric morphism <img src="https://latex.codecogs.com/png.latex?%5Cmathrm%7BSet%7D%5B%5Cmathbb%7BT%7D%5D%5B%5Cmathbb%7BS%7D%5D%20%5Cto%20%5Cmathrm%7BSet%7D%5B%5Cmathbb%7BT%7D%5D">), with rules to be determined, and which doesn’t interact with the contexts <img src="https://latex.codecogs.com/png.latex?%5CGamma"> at all.</p>
<div class="tikz">
<img src="https://topos.institute/blog/2026-06-15-geometric-type-theory-done-two-ways/_svgs/da029a9f9b11bb4986e0baba36e6731800f5198f.svg" class="img-fluid">
</div>
<p>To have the MATT variable rule we need a syntactic notion of 2-cell between geometric morphisms, and if we are presenting morphisms as “theories in context”, it’s difficult to make sense of what this would mean.</p>
<p>The general inverse image modality would look like the following:</p>
<div class="tikz">
<img src="https://topos.institute/blog/2026-06-15-geometric-type-theory-done-two-ways/_svgs/2ae2616d55be5b96e685f6d4a17626f97e1d8de9.svg" class="img-fluid">
</div>
<p>With rules along these lines we could probably do some very basic examples, such as the object classifier <img src="https://latex.codecogs.com/png.latex?%5Ccdot%20%5Cvdash(X%20%5C,%5C,%5Cmathsf%7Bsort%7D)%0A%5C,%5C,%5Cmathsf%7Btheory%7D">. But as written there’s no advantage over just using MATT directly, so I’m not sure this is going anywhere useful.</p>



</section>
</section>


<script defer="" src="https://comments.topos.institute/comentario.js"></script>

<div id="quarto-appendix" class="default"><section class="quarto-appendix-contents" id="quarto-bibliography"><h2 class="anchored quarto-appendix-heading">References</h2><div id="refs" class="references csl-bib-body hanging-indent" data-entry-spacing="0">
<div id="ref-gdtt" class="csl-entry">
Bizjak, Aleš, Hans Bugge Grathwohl, Ranald Clouston, Rasmus E. Møgelberg, and Lars Birkedal. 2016. <span>“Guarded Dependent Type Theory with Coinductive Types.”</span> In <em>Foundations of Software Science and Computation Structures</em>, 9634:20–35. Lecture Notes in Comput. Sci. Springer, Berlin. <a href="https://doi.org/10.1007/978-3-662-49630-5_2">https://doi.org/10.1007/978-3-662-49630-5_2</a>.
</div>
<div id="ref-blechschmidt:qcoh" class="csl-entry">
Blechschmidt, Ingo. 2017. <span>“A General Nullstellensatz for Generalized Spaces.”</span> 2017. <a href="https://rawgit.com/iblech/internal-methods/master/paper-qcoh.pdf">https://rawgit.com/iblech/internal-methods/master/paper-qcoh.pdf</a>.
</div>
<div id="ref-cartmell:gats" class="csl-entry">
Cartmell, John. 1986. <span>“Generalised Algebraic Theories and Contextual Categories.”</span> <em>Ann. Pure Appl. Logic</em> 32 (3): 209–43. <a href="https://doi.org/10.1016/0168-0072(86)90053-9">https://doi.org/10.1016/0168-0072(86)90053-9</a>.
</div>
<div id="ref-mtt" class="csl-entry">
Gratzer, Daniel, G. A. Kavvos, Andreas Nuyts, and Lars Birkedal. 2020. <span>“Multimodal Dependent Type Theory.”</span> In <em>Proceedings of the 35th Annual ACM/IEEE Symposium on Logic in Computer Science</em>. LICS ’20. Saarbrücken, Germany: Association for Computing Machinery. <a href="https://doi.org/10.1145/3373718.3394736">https://doi.org/10.1145/3373718.3394736</a>.
</div>
<div id="ref-lynch:emtt-talk" class="csl-entry">
Lynch, Owen. 2025. <span>“Element Model Type Theory.”</span> Oxford Seminar, Topos Institute, video recording. <a href="https://www.youtube.com/watch?v=Id-9XE5TsA8">https://www.youtube.com/watch?v=Id-9XE5TsA8</a>.
</div>
<div id="ref-makkai:folds" class="csl-entry">
Makkai, Michael. 1995. <span>“First Order Logic with Dependent Sorts, with Applications to Category Theory.”</span> <a href="https://www.math.mcgill.ca/makkai/folds/foldsinpdf/FOLDS.pdf">https://www.math.mcgill.ca/makkai/folds/foldsinpdf/FOLDS.pdf</a>.
</div>
<div id="ref-palmgren:cwf-fol" class="csl-entry">
Palmgren, Erik. 2019. <span>“Categories with Families and First-Order Logic with Dependent Sorts.”</span> <em>Ann. Pure Appl. Logic</em> 170 (12): 102715, 75. <a href="https://doi.org/10.1016/j.apal.2019.102715">https://doi.org/10.1016/j.apal.2019.102715</a>.
</div>
<div id="ref-ps:topoi-sgdt" class="csl-entry">
Palombi, Daniele, and Jonathan Sterling. 2023. <span>“Classifying Topoi in Synthetic Guarded Domain Theory. <span>T</span>he Universal Property of Multi-Clock Guarded Recursion.”</span> In <em>Mathematical <span>F</span>oundations of <span>P</span>rogramming <span>S</span>emantics—<span>T</span>hirty-<span>E</span>ighth <span>A</span>nnual <span>C</span>onference</em>, 1:Paper No. 12, 24. Electron. Notes Theor. Inform. Comput. Sci. Episciences, Villeurbanne. <a href="https://doi.org/10.46298/entics.10323">https://doi.org/10.46298/entics.10323</a>.
</div>
<div id="ref-rabe:dfol" class="csl-entry">
Rabe, Florian. 2006. <span>“First-Order Logic with Dependent Types.”</span> In <em>Automated Reasoning</em>, 4130:377–91. Lecture Notes in Comput. Sci. Springer, Berlin. <a href="https://doi.org/10.1007/11814771_33">https://doi.org/10.1007/11814771_33</a>.
</div>
<div id="ref-svbb:propositional-geometric" class="csl-entry">
Schipp von Branitz, Johannes, and Ulrik Buchholtz. 2025. <span>“Propositional Geometric Type Theory.”</span> Talk slides, HoTT/UF 2025. <a href="https://hott-uf.github.io/2025/slides/Schipp_von_Branitz.pdf">https://hott-uf.github.io/2025/slides/Schipp_von_Branitz.pdf</a>.
</div>
<div id="ref-shluman:matt" class="csl-entry">
Shulman, Michael. 2023. <span>“Semantics of Multimodal Adjoint Type Theory.”</span> In <em>Mathematical <span>F</span>oundations of <span>P</span>rogramming <span>S</span>emantics—<span>P</span>roceedings of the <span>T</span>hirty-<span>N</span>inth <span>A</span>nnual <span>C</span>onference</em>, 3:Art. No. 18, 20. Electron. Notes Theor. Inform. Comput. Sci. Episciences, Villeurbanne. <a href="https://doi.org/10.46298/entics.proceedings.mfps39">https://doi.org/10.46298/entics.proceedings.mfps39</a>.
</div>
<div id="ref-uemura:synthetic-topos-theory" class="csl-entry">
Uemura, Taichi. 2023. <span>“Synthetic Topos Theory.”</span> Online notes. <a href="https://uemurax.github.io/synthetic-topos-theory/">https://uemurax.github.io/synthetic-topos-theory/</a>.
</div>
<div id="ref-vikers:locales-and-toposes" class="csl-entry">
Vickers, Steven. 2007. <span>“Locales and Toposes as Spaces.”</span> In <em>Handbook of Spatial Logics</em>, 429–96. Springer, Dordrecht. <a href="https://doi.org/10.1007/978-1-4020-5587-4_8">https://doi.org/10.1007/978-1-4020-5587-4_8</a>.
</div>
<div id="ref-vickers:continuity" class="csl-entry">
———. 2014. <span>“Continuity and Geometric Logic.”</span> <em>J. Appl. Log.</em> 12 (1): 14–27. <a href="https://doi.org/10.1016/j.jal.2013.07.004">https://doi.org/10.1016/j.jal.2013.07.004</a>.
</div>
<div id="ref-vickers:point-free" class="csl-entry">
———. 2022. <span>“Generalized Point-Free Spaces, Pointwise.”</span> <a href="https://arxiv.org/abs/2206.01113">https://arxiv.org/abs/2206.01113</a>.
</div>
</div></section><section id="footnotes" class="footnotes footnotes-end-of-document"><h2 class="anchored quarto-appendix-heading">Footnotes</h2>

<ol>
<li id="fn1"><p>We may want to allow inductive types in <img src="https://latex.codecogs.com/png.latex?%5CGamma"> to eliminate into construction and theory judgements, though this can be simulated by doing the same elimination in the <img src="https://latex.codecogs.com/png.latex?%5CDelta"> context of each field in the Theory.↩︎</p></li>
<li id="fn2"><p>The <img src="https://latex.codecogs.com/png.latex?%5Cmodels"> symbol would be more appropriate here, but doesn’t display so well in this blogging software.↩︎</p></li>
<li id="fn3"><p>In Ingo’s note he calls these special motives geometric<img src="https://latex.codecogs.com/png.latex?%7B%7D%5E*">. So geometric, but terms and conditions apply.↩︎</p></li>
</ol>
</section></div> ]]></description>
  <category>type theory</category>
  <guid>https://topos.institute/blog/2026-06-15-geometric-type-theory-done-two-ways/</guid>
  <pubDate>Mon, 15 Jun 2026 00:00:00 GMT</pubDate>
  <media:content url="https://topos.institute/blog/2026-06-15-geometric-type-theory-done-two-ways/thumbnail.png" medium="image" type="image/png" height="91" width="144"/>
</item>
<item>
  <title>Blog / CatColab v0.6: Starling</title>
  <dc:creator>Tim Hosgood</dc:creator>
  <link>https://topos.institute/blog/2026-06-01-catcolab-0-6-starling/</link>
  <description><![CDATA[ 





<div class="quarto-layout-panel" data-layout-ncol="2">
<div class="quarto-layout-row quarto-layout-valign-center">
<div class="quarto-layout-cell" style="flex-basis: 50.0%;justify-content: flex-start;">
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><a href="images/starling.png" class="lightbox" data-gallery="quarto-lightbox-gallery-1" title="European Starling photo © Venkat Arumugam / Macaulay Library"><img src="https://topos.institute/blog/2026-06-01-catcolab-0-6-starling/images/starling.png" class="img-fluid figure-img" alt="European Starling photo © Venkat Arumugam / Macaulay Library"></a></p>
<figcaption><a href="https://macaulaylibrary.org/asset/658782582">European Starling photo © Venkat Arumugam / Macaulay Library</a></figcaption>
</figure>
</div>
</div>
<div class="quarto-layout-cell" style="flex-basis: 50.0%;justify-content: flex-start;">
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><a href="images/ode-fictional-example.png" class="lightbox" data-gallery="quarto-lightbox-gallery-2" title="Some of the new features in Starling"><img src="https://topos.institute/blog/2026-06-01-catcolab-0-6-starling/images/ode-fictional-example.png" class="border img-fluid figure-img" alt="Some of the new features in Starling"></a></p>
<figcaption>Some of the new features in Starling</figcaption>
</figure>
</div>
</div>
</div>
</div>
<p>You can find the changelog and complete release notes on GitHub:</p>
<div class="text-center">
<p><a href="https://github.com/ToposInstitute/CatColab/blob/main/CHANGELOG.md" class="btn btn-outline-secondary"> CHANGELOG</a> <a href="https://github.com/ToposInstitute/CatColab/releases/tag/v0.6.0" class="btn btn-outline-secondary"> Full v0.6 release notes</a></p>
</div>
<div class="small">
<p>CatColab is a collaborative environment for formal, interoperable, conceptual modeling. For an introduction to CatColab, visit the <a href="https://catcolab.org/help">help page</a>.</p>
</div>
<section id="major-new-features" class="level2">
<h2 data-anchor-id="major-new-features">Major new features</h2>
<section id="compositional-stock-flow-diagrams" class="level3">
<h3 data-anchor-id="compositional-stock-flow-diagrams">Compositional stock-flow diagrams</h3>
<p>The <a href="../../blog/2026-03-23-catcolab-0-5-sandpiper">previous release</a> added the ability to compose Petri nets by sharing places. This release continues in that vein, adding the ability to <strong>compose stock-flow diagrams by sharing stocks</strong>. As a result, <em>all</em> logics in CatColab now support composing models in the variable sharing paradigm.</p>
<p>With all this composition, we might need something to make sense of the compositional structures that we can now create…</p>
</section>
<section id="composition-pattern-visualisation" class="level3">
<h3 data-anchor-id="composition-pattern-visualisation">Composition pattern visualisation</h3>
<p>… and that’s what a new analysis lets us do. The <strong>composition pattern</strong> analysis visualises the way in which your notebooks have been composed, as an <em>undirected wiring diagram</em>. A composition pattern gives a high-level summary of how a model is constructed from components.</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><a href="images/composition-pattern-analysis.png" class="lightbox" data-gallery="quarto-lightbox-gallery-3" title="The composition pattern analysis for a two-level predator prey causal loop diagram, built from two copies of a positive/negative loop motif. It shows that RG.Prey is tied to Grass, both RG.Predator and FR.Prey are tied to Rabbit, and FR.Predator is tied to Fox."><img src="https://topos.institute/blog/2026-06-01-catcolab-0-6-starling/images/composition-pattern-analysis.png" class="border img-fluid figure-img" alt="The composition pattern analysis for a two-level predator prey causal loop diagram, built from two copies of a positive/negative loop motif. It shows that RG.Prey is tied to Grass, both RG.Predator and FR.Prey are tied to Rabbit, and FR.Predator is tied to Fox."></a></p>
<figcaption>The composition pattern analysis for a two-level predator prey causal loop diagram, built from two copies of a positive/negative loop motif. It shows that <code>RG.Prey</code> is tied to <code>Grass</code>, both <code>RG.Predator</code> and <code>FR.Prey</code> are tied to <code>Rabbit</code>, and <code>FR.Predator</code> is tied to <code>Fox</code>.</figcaption>
</figure>
</div>
</section>
<section id="systems-of-polynomial-odes" class="level3">
<h3 data-anchor-id="systems-of-polynomial-odes">Systems of polynomial ODEs</h3>
<p>Quantitative analyses of models are important, whence our efforts to implement and extend well known ones such as <a href="https://en.wikipedia.org/wiki/Generalized_Lotka%E2%80%93Volterra_equation">Lotka–Volterra</a>, <a href="https://en.wikipedia.org/wiki/Kuramoto_model">Kuramoto</a>, and <a href="https://en.wikipedia.org/wiki/Law_of_mass_action">mass action</a>. However, in keeping with the core design decisions of CatColab itself, we want users to be able to define their <em>own</em> ODE semantics.</p>
<p>The first step towards this is to be able to treat systems of ODEs as models of a theory in their own right, giving ODE systems first-class status in CatColab. The mathematical details of this idea are sketched out in <a href="https://next.catcolab.org/rfc/0001">RFC-0001</a> (more on RFCs below!), but the short story is that you can now build arbitrary systems of polynomial ODEs as models, compose them, view the derived equations, and simulate them.</p>
<p>As a toy example, we can “define” <img src="https://latex.codecogs.com/png.latex?%5Csin"> and <img src="https://latex.codecogs.com/png.latex?%5Ccos"> as solutions to a system of two polynomial ODEs:</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><a href="images/ode-trig-functions.png" class="lightbox" data-gallery="quarto-lightbox-gallery-4" title="Defining sine and cosine as a model of the theory of systems of polynomial ODEs. We define two variables (implicitly treated as functions of time), and then two terms (“contributions”) in the system of ODEs governing them. For example, one term is called sin'=cos and gives the equation \frac{\mathrm{d}}{\mathrm{d}t}\sin = \lambda\cos; setting \lambda=1 will recover one of the two usual constraints defining sine and cosine as solutions to ODEs, namely that \sin'=\cos."><img src="https://topos.institute/blog/2026-06-01-catcolab-0-6-starling/images/ode-trig-functions.png" class="border img-fluid figure-img" style="width:70.0%" alt="Defining sine and cosine as a model of the theory of systems of polynomial ODEs. We define two variables (implicitly treated as functions of time), and then two terms (“contributions”) in the system of ODEs governing them. For example, one term is called sin'=cos and gives the equation \frac{\mathrm{d}}{\mathrm{d}t}\sin = \lambda\cos; setting \lambda=1 will recover one of the two usual constraints defining sine and cosine as solutions to ODEs, namely that \sin'=\cos."></a></p>
<figcaption>Defining sine and cosine as a model of the theory of systems of polynomial ODEs. We define two variables (implicitly treated as functions of time), and then two terms (“contributions”) in the system of ODEs governing them. For example, one term is called <code>sin'=cos</code> and gives the equation <img src="https://latex.codecogs.com/png.latex?%5Cfrac%7B%5Cmathrm%7Bd%7D%7D%7B%5Cmathrm%7Bd%7Dt%7D%5Csin%20=%20%5Clambda%5Ccos">; setting <img src="https://latex.codecogs.com/png.latex?%5Clambda=1"> will recover one of the two usual constraints defining sine and cosine as solutions to ODEs, namely that <img src="https://latex.codecogs.com/png.latex?%5Csin'=%5Ccos">.</figcaption>
</figure>
</div>
<p>We can then use compositionality of models to “import” these trigonometric functions into a new model, which is an ODE model of an entirely fictional system that I made up with very scientific names and equations:</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><a href="images/ode-fictional-example.png" class="lightbox" data-gallery="quarto-lightbox-gallery-5" title="Left: An ODE model for a fictional system, given by defining the variables and then the “contributions” to the ODEs. Right: An analysis of the model, showing the composition pattern as well as the generated equations and a numerical simulation."><img src="https://topos.institute/blog/2026-06-01-catcolab-0-6-starling/images/ode-fictional-example.png" class="border img-fluid figure-img" alt="Left: An ODE model for a fictional system, given by defining the variables and then the “contributions” to the ODEs. Right: An analysis of the model, showing the composition pattern as well as the generated equations and a numerical simulation."></a></p>
<figcaption><em>Left:</em> An ODE model for a fictional system, given by defining the variables and then the “contributions” to the ODEs. <em>Right:</em> An analysis of the model, showing the composition pattern as well as the generated equations and a numerical simulation.</figcaption>
</figure>
</div>
</section>
<section id="backend-for-julia-and-algebraicjulia" class="level3">
<h3 data-anchor-id="backend-for-julia-and-algebraicjulia">Backend for Julia and AlgebraicJulia</h3>
<p><a href="https://www.algebraicjulia.org/">AlgebraicJulia</a> is an ecosystem of packages for category-theoretic modeling and simulation, building on the <a href="https://julialang.org/">Julia</a> programming language. In this release, we added a Julia compute service to our backend infrastructure. At this time, the Julia service is exercised only by a proof-of-concept analysis that converts a diagram over a schema into a tabular instance by invoking machinery in <a href="https://github.com/AlgebraicJulia/Catlab.jl">Catlab.jl</a>. In the future, we will use the Julia service to provide advanced simulation capabilities, such as for agent-based models (<a href="https://github.com/AlgebraicJulia/AlgebraicABMs.jl">AlgebraicABMs.jl</a>) and partial differential equations on manifolds (<a href="https://github.com/AlgebraicJulia/Decapodes.jl">Decapodes.jl</a>).</p>
</section>
<section id="notebook-history" class="level3">
<h3 data-anchor-id="notebook-history">Notebook history</h3>
<p>When you made changes to your notebook, snapshots are now stored of the notebook history. This means that you can undo/redo changes, as well as view the entire history and jump back and forwards between time-stamped edits.</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><a href="images/document-history.png" class="lightbox" data-gallery="quarto-lightbox-gallery-6" title="The notebook history sidebar, with buttons for undo/redo as well as the full timestamped edit history."><img src="https://topos.institute/blog/2026-06-01-catcolab-0-6-starling/images/document-history.png" class="border img-fluid figure-img" alt="The notebook history sidebar, with buttons for undo/redo as well as the full timestamped edit history."></a></p>
<figcaption>The notebook history sidebar, with buttons for undo/redo as well as the full timestamped edit history.</figcaption>
</figure>
</div>
</section>
<section id="public-rfcs" class="level3">
<h3 data-anchor-id="public-rfcs">Public RFCs</h3>
<p>Those interested in the development of CatColab can already follow our <a href="https://github.com/ToposInstitute/CatColab/pulls">pull requests</a> and <a href="https://github.com/ToposInstitute/CatColab/issues">issues</a> on GitHub, as well as our conversations on <a href="https://catcolab.zulipchat.com/">our Zulip</a>. But sometimes the best format for a discussion is closer to that of a blog post, or extended abstract, where a single author describes their vision for a feature, and often the mathematics supporting it, and then shares it with the rest of the team (and the wider community). Such discussions are now recorded as <em>requests for comment</em> (RFCs) and can be found at <a href="https://next.catcolab.org/rfc/">next.catcolab.org/rfc</a>. To quote from that page:</p>
<blockquote class="blockquote">
<p>A distinctive feature of RFCs compared to other kinds of documentation is that they represent a design at a particular point in time, as envisioned by a particular person. Thus, an RFC should have a date and an author, and there is no expectation that an RFC will be updated over time as its implementation inevitably evolves.</p>
<p>The format of an CatColab RFC is not yet standardized. In organizing the RFCs written so far, we’ve been inspired by the <a href="https://github.com/rust-lang/rfcs/blob/master/0000-template.md">RFC template</a> used by the <a href="https://rust-lang.org/">Rust</a> language.</p>
</blockquote>
</section>
</section>
<section id="other-improvements-and-fixes" class="level2">
<h2 data-anchor-id="other-improvements-and-fixes">Other improvements and fixes</h2>
<ul>
<li>Instantiating models is now done using a new widget that lets you search over existing models, rather than having to copy and paste a URL.</li>
<li><em>Experimental:</em> Petri nets created in <a href="https://petrinaut.org">Petrinaut</a> and exported as JSON can be imported into CatColab.</li>
</ul>


</section>

<script defer="" src="https://comments.topos.institute/comentario.js"></script>

 ]]></description>
  <category>CatColab</category>
  <guid>https://topos.institute/blog/2026-06-01-catcolab-0-6-starling/</guid>
  <pubDate>Mon, 01 Jun 2026 00:00:00 GMT</pubDate>
  <media:content url="https://topos.institute/blog/2026-06-01-catcolab-0-6-starling/images/starling.png" medium="image" type="image/png" height="135" width="144"/>
</item>
<item>
  <title>Blog / Extending mass-action semantics, Part 2</title>
  <dc:creator>Tim Hosgood</dc:creator>
  <link>https://topos.institute/blog/2026-04-18-extending-mass-action-semantics-2/</link>
  <description><![CDATA[ 





<div class="callout callout-style-default callout-note callout-titled">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
Note
</div>
</div>
<div class="callout-body-container callout-body">
<p>This blog post is a direct continuation of <a href="../../blog/2026-03-16-extending-mass-action-semantics-1">Part&nbsp;1</a>.</p>
</div>
</div>
<p>We left off last time saying how nice it would be if CatColab supported a generalised version of mass-action semantics for Petri nets. To cut straight to the punchline, as of the recent <a href="../../blog/2026-03-23-catcolab-0-5-sandpiper">CatColab v0.5 release</a>, Petri nets (as well as stock-flow diagrams) now support this “unbalanced” mass-action dynamics. In the analyses for mass-action dynamics, there is a setting menu with an option to toggle <em>conserve mass</em> which, if unticked, will allow you to pick a <em>rate granularity</em> of either <em>per place</em> or <em>per transition</em>. The <a href="https://catcolab.org/help/logics/petri-net">help pages</a> describe this in much more detail.</p>
<p>If you just want to see the results, I’ve re-implemented the model from <a href="../../blog/2026-03-16-extending-mass-action-semantics-1">Part&nbsp;1</a>. Below you can view both the model and the derived equations, or you can play around with them yourself at <a href="https://catcolab.org/model/019c8afb-1d25-7162-b101-83cb227108b1/analysis/019c8afb-69fc-7de3-a570-8c79f0488bba">this link</a>. The key thing to note here is that the equations are <em>derived</em> from the model, which means that you can add or remove transitions and immediately see how the equations change. This solves the main problem that I pointed out last time: how easy it is to make a mistake when translating a Petri net into the mass-action equations by hand.</p>
<iframe width="100%" height="500" src="https://catcolab.org/model/019c8afb-1d25-7162-b101-83cb227108b1" title="CatColab model"></iframe>
<iframe width="100%" height="500" src="https://catcolab.org/analysis/019c8afb-69fc-7de3-a570-8c79f0488bba" title="CatColab analysis"></iframe>
<p>Before proceeding, I want to point out one thing that I find particularly exciting. Although CatColab is still under very active development, it has now reached the stage where I could to go from idea, to research, to implementation, to having a live public-facing feature in a matter of weeks. That’s because there is now a solid foundation of tooling and examples in the codebase for people to build on, in terms of both foundational categorical logic and UI components and general software infrastructure. And of course this is only the case due to a gargantuan effort from <a href="https://catcolab.org/help/credits/">all the people working on CatColab</a>.</p>
<p>GitHub <a href="https://github.com/ToposInstitute/CatColab/pull/1045/changes">tells me</a> that my implementation of unbalanced mass-action semantics consists of 1,059 lines of code added, and 927 lines of code deleted. If we pretend that positive code and negative code cancel out, then that’s under 150 lines of code — not too bad! The <a href="https://catcolab.org/help/logics/petri-net">Petri net</a> (and <a href="https://catcolab.org/help/logics/primitive-stock-flow">stock-flow</a>) help pages on CatColab contain documentation for this new semantics.</p>
<p>For those interested in a small walkthrough of some of the key parts of the implementation, found in <a href="https://github.com/ToposInstitute/CatColab/blob/main/packages/catlog/src/stdlib/analyses/ode/mass_action.rs"><code>mass_action.rs</code></a>, you can read more below!</p>
<section id="defining-some-types" class="level2" data-number="1">
<h2 data-number="1" data-anchor-id="defining-some-types"><span class="header-section-number">1</span> Defining some types</h2>
<p>Let’s begin by writing down the different types of mass-action semantics that we want to differentiate between. We are interested in three types, each more expressive than the last:</p>
<ul>
<li><p><strong>Balanced.</strong> Transitions conserve mass, and are described by a single <strong>transition rate</strong> parameter <img src="https://latex.codecogs.com/png.latex?r_T">. So a transition <img src="https://latex.codecogs.com/png.latex?%5BA,B%5D%5Cto%5Cboxed%7BT%7D%5Cto%5BX,Y%5D"> requires <em>one</em> parameter <img src="https://latex.codecogs.com/png.latex?r_T">, and gives the equations <img src="https://latex.codecogs.com/png.latex?%0A%20%20%5Cleft%5C%7B%0A%20%20%5Cbegin%7Baligned%7D%0A%20%20%20%20%5Cdot%7BA%7D%20&amp;=%20-r_T%20AB%0A%20%20%5C%5C%5Cdot%7BB%7D%20&amp;=%20-r_T%20AB%0A%20%20%5C%5C%5Cdot%7BX%7D%20&amp;=%20%5Cphantom%7B-%7Dr_T%20AB%0A%20%20%5C%5C%5Cdot%7BY%7D%20&amp;=%20%5Cphantom%7B-%7Dr_T%20AB%0A%20%20%5Cend%7Baligned%7D%0A%20%20%5Cright.%0A"></p></li>
<li><p><strong>Unbalanced, per transition.</strong> Transitions do not necessarily conserve mass, and are described a <strong>consumption rate</strong> parameter <img src="https://latex.codecogs.com/png.latex?%5Ckappa_T"> and a <strong>production rate</strong> parameter <img src="https://latex.codecogs.com/png.latex?%5Crho_T">. So a transition <img src="https://latex.codecogs.com/png.latex?%5BA,B%5D%5Cto%5Cboxed%7BT%7D%5Cto%5BX,Y%5D"> requires <em>two</em> parameters <img src="https://latex.codecogs.com/png.latex?(%5Ckappa_T,%5Crho_T)">, and gives the equations <img src="https://latex.codecogs.com/png.latex?%0A%20%20%5Cleft%5C%7B%0A%20%20%5Cbegin%7Baligned%7D%0A%20%20%20%20%5Cdot%7BA%7D%20&amp;=%20-%5Ckappa_T%20AB%0A%20%20%5C%5C%5Cdot%7BB%7D%20&amp;=%20-%5Ckappa_T%20AB%0A%20%20%5C%5C%5Cdot%7BX%7D%20&amp;=%20%5Cphantom%7B-%7D%5Crho_T%20AB%0A%20%20%5C%5C%5Cdot%7BY%7D%20&amp;=%20%5Cphantom%7B-%7D%5Crho_T%20AB%0A%20%20%5Cend%7Baligned%7D%0A%20%20%5Cright.%0A"></p></li>
<li><p><strong>Unbalanced, per place.</strong> Transitions do not necessarily conserve mass, and are described a <strong>consumption rate</strong> parameter <img src="https://latex.codecogs.com/png.latex?%5Ckappa_T%5EA"> for each input place <img src="https://latex.codecogs.com/png.latex?A"> and a <strong>production rate</strong> parameter <img src="https://latex.codecogs.com/png.latex?%5Crho_T%5EX"> for each output place <img src="https://latex.codecogs.com/png.latex?X">. So a transition <img src="https://latex.codecogs.com/png.latex?%5BA,B%5D%5Cto%5Cboxed%7BT%7D%5Cto%5BX,Y%5D"> requires <em>four</em> parameters <img src="https://latex.codecogs.com/png.latex?(%5Ckappa_T%5EA,%5Ckappa_T%5EB,%5Crho_T%5EX,%5Crho_T%5EY)">, and gives the equations <img src="https://latex.codecogs.com/png.latex?%0A%20%20%5Cleft%5C%7B%0A%20%20%5Cbegin%7Baligned%7D%0A%20%20%20%20%5Cdot%7BA%7D%20&amp;=%20-%5Ckappa_T%5EA%20AB%0A%20%20%5C%5C%5Cdot%7BB%7D%20&amp;=%20-%5Ckappa_T%5EB%20AB%0A%20%20%5C%5C%5Cdot%7BX%7D%20&amp;=%20%5Cphantom%7B-%7D%5Crho_T%5EX%20AB%0A%20%20%5C%5C%5Cdot%7BY%7D%20&amp;=%20%5Cphantom%7B-%7D%5Crho_T%5EY%20AB%0A%20%20%5Cend%7Baligned%7D%0A%20%20%5Cright.%0A"></p></li>
</ul>
<p>Note that these semantics make sense for Petri nets, but the first two also make sense for stock-flow diagrams. Because of this, we sometimes switch between the words “transition” and “flow”.</p>
<p>We can write down a simple description of this hierarchy in Rust types. First off, we specify the three types of mass-action, using <code>RateGranularity</code> to describe the distinction between the per-place and per-transition cases.</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb1" style="background: #f1f3f5;"><pre class="sourceCode rust code-with-copy"><code class="sourceCode rust"><span id="cb1-1"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">pub</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">enum</span> MassConservationType <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span></span>
<span id="cb1-2">    Balanced<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-3">    Unbalanced(RateGranularity)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-4"><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span></span>
<span id="cb1-5"></span>
<span id="cb1-6"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">pub</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">enum</span> RateGranularity <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span></span>
<span id="cb1-7">    PerTransition<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-8">    PerPlace<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-9"><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span></span></code></pre></div></div>
<p>Next we describe what the parameters will look like for each flow. In CatColab, <code>QualifiedName</code> is the type of a name referring to an object or morphism declared in a model. (It is called “qualifed” because a name may consist of multiple segments when a model is constructed by hierarchical composition.) In particular, every place and transition in a Petri net is identified by a <code>QualifiedName</code>.</p>
<p>Recall that, in the balanced case, we don’t need to worry about the direction of flows (e.g.&nbsp;whether a place is an input or an output to the transition); in the unbalanced per-transition case, we don’t need to worry about distinguishing between any of the input places (resp. output places); in the unbalanced per-place case, we need to worry about everything! Note that the <code>Direction</code> type has the opposite terminology from what we might expect: a transition <img src="https://latex.codecogs.com/png.latex?A%5Cto%5Cboxed%7BT%7D%5Cto%20B"> (or a flow <img src="https://latex.codecogs.com/png.latex?A%5CRightarrow%20B">) gives rise to an <em>incoming flow</em> to the <em>output</em> <img src="https://latex.codecogs.com/png.latex?B"> and an <em>outgoing flow</em> from the <em>input</em> <img src="https://latex.codecogs.com/png.latex?A">.</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb2" style="background: #f1f3f5;"><pre class="sourceCode rust code-with-copy"><code class="sourceCode rust"><span id="cb2-1"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">pub</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">enum</span> FlowParameter <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span></span>
<span id="cb2-2">    Balanced <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span></span>
<span id="cb2-3">        transition<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> QualifiedName<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb2-4">    <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">},</span></span>
<span id="cb2-5">    Unbalanced <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span></span>
<span id="cb2-6">        direction<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> Direction<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb2-7">        parameter<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> RateParameter<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb2-8">    <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">},</span></span>
<span id="cb2-9"><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span></span>
<span id="cb2-10"></span>
<span id="cb2-11"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">pub</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">enum</span> RateParameter <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span></span>
<span id="cb2-12">    PerTransition <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span></span>
<span id="cb2-13">        transition<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> QualifiedName<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb2-14">    <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">},</span></span>
<span id="cb2-15">    PerPlace <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span></span>
<span id="cb2-16">        transition<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> QualifiedName<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb2-17">        place<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> QualifiedName<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb2-18">    <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">},</span></span>
<span id="cb2-19"><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span></span>
<span id="cb2-20"></span>
<span id="cb2-21"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">pub</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">enum</span> Direction <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span></span>
<span id="cb2-22">    IncomingFlow<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb2-23">    OutgoingFlow<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb2-24"><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span></span></code></pre></div></div>
</section>
<section id="building-the-system-of-equations" class="level2" data-number="2">
<h2 data-number="2" data-anchor-id="building-the-system-of-equations"><span class="header-section-number">2</span> Building the system of equations</h2>
<p>With the types all set up, the process of actually building the equations from a given model is rather routine, and consists of matching against the mass-action type and then using all of the built-in functionality of <code>catlog</code> (the core package of CatColab).</p>
<p>The first step is to simply create an equation for each object (i.e.&nbsp;place or stock) of the form <img src="https://latex.codecogs.com/png.latex?%5Cdot%7BA%7D=0">, so that we can add all the contributions to it when we later iterate over the morphisms (i.e.&nbsp;transitions or flows).</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb3" style="background: #f1f3f5;"><pre class="sourceCode rust code-with-copy"><code class="sourceCode rust"><span id="cb3-1"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">let</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">mut</span> sys <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">PolynomialSystem::</span>new()<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb3-2"></span>
<span id="cb3-3"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> ob <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> model<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>ob_generators_with_type(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">self</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>stock_ob_type) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span></span>
<span id="cb3-4">    sys<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>add_term(ob<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">Polynomial::</span>zero())<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb3-5"><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span></span></code></pre></div></div>
<p>Next we’ll iterate over all the pairs <code>(flow, term)</code>, where <code>flow</code> is a morphism in the model and <code>term</code> is the monomial built by multiplying together all of the variables corresponding to the input places (or, in the case of stock-flow diagrams, the variable corresponding to the input stock and those of any input links). For this we use a helper function <code>flow_monomials</code> which we won’t look at in any detail. As we said above, all we need to do here is match against <code>MassConservationType</code>, so let’s start by just sketching out the shape of the iteration.</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb4" style="background: #f1f3f5;"><pre class="sourceCode rust code-with-copy"><code class="sourceCode rust"><span id="cb4-1"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">let</span> terms<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">Vec</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span>_<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">self</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>flow_monomials(model)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>into_iter()<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>collect()<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb4-2"></span>
<span id="cb4-3"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> (flow<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> term) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> terms <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span></span>
<span id="cb4-4">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">let</span> dom <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> model<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>mor_generator_dom(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span>flow)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>unwrap_basic()<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb4-5">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">let</span> cod <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> model<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>mor_generator_cod(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span>flow)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>unwrap_basic()<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb4-6">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">match</span> mass_conservation_type <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span></span>
<span id="cb4-7">        <span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">MassConservationType::</span>Balanced <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=&gt;</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span></span>
<span id="cb4-8">            <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">...</span></span>
<span id="cb4-9">        <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span></span>
<span id="cb4-10">        <span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">MassConservationType::</span>Unbalanced(granularity) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=&gt;</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span></span>
<span id="cb4-11">            <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">...</span></span>
<span id="cb4-12">        <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span></span>
<span id="cb4-13">    <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span></span>
<span id="cb4-14"><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span></span></code></pre></div></div>
<p>For the case of <code>MassConservationType::Balanced</code>, we simply need to build the monomial given by multiplying <code>term</code> by a single rate parameter, i.e.&nbsp;of of type <code>FlowParameter::Balanced</code>.</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb5" style="background: #f1f3f5;"><pre class="sourceCode rust code-with-copy"><code class="sourceCode rust"><span id="cb5-1"><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">MassConservationType::</span>Balanced <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=&gt;</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span></span>
<span id="cb5-2">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">let</span> term<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> Polynomial<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span>_<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> _<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> _<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [(</span>
<span id="cb5-3">        <span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">Parameter::</span>generator(<span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">FlowParameter::</span>Balanced <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span> transition<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> mor <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb5-4">        term<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>clone()<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb5-5">    )]</span>
<span id="cb5-6">    <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>into_iter()</span>
<span id="cb5-7">    <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>collect()<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb5-8"></span>
<span id="cb5-9">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> input <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> inputs <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span></span>
<span id="cb5-10">        sys<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>add_term(input<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>unwrap_generator()<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>term<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>clone())<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb5-11">    <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span></span>
<span id="cb5-12"></span>
<span id="cb5-13">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> output <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> outputs <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span></span>
<span id="cb5-14">        sys<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>add_term(output<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>unwrap_generator()<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> term<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>clone())<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb5-15">    <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span></span>
<span id="cb5-16"><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span></span></code></pre></div></div>
<p>For <code>MassConservationType::Unbalanced(_)</code>, we need to treat the per-transition and per-place cases differently. In the former, our parameter will be of type <code>RateParameter::PerTransition</code>, and in the latter of type <code>RateParameter::PerPlace</code>. To avoid repetition, we’ll just look at iterating over the input places, since the code for output places is essentially identical: we just change <code>Direction</code> from <code>OutgoingFlow</code> to <code>IncomingFlow</code> and add instead of adding <code>-input_term</code> to our system we add <code>output_term</code>.</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb6" style="background: #f1f3f5;"><pre class="sourceCode rust code-with-copy"><code class="sourceCode rust"><span id="cb6-1"><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">MassConservationType::</span>Unbalanced(granularity) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=&gt;</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span></span>
<span id="cb6-2">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> input <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> inputs <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span></span>
<span id="cb6-3">        <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">let</span> input_term<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> Polynomial<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span>_<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> _<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> _<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">match</span> granularity <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span></span>
<span id="cb6-4">            <span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">RateGranularity::</span>PerTransition <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=&gt;</span> [(</span>
<span id="cb6-5">                <span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">Parameter::</span>generator(<span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">FlowParameter::</span>Unbalanced <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span></span>
<span id="cb6-6">                    direction<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">Direction::</span>OutgoingFlow<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb6-7">                    parameter<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">RateParameter::</span>PerTransition <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span></span>
<span id="cb6-8">                        transition<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> mor<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>clone()<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb6-9">                    <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">},</span></span>
<span id="cb6-10">                <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb6-11">                term<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>clone()<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb6-12">            )]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb6-13">            <span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">RateGranularity::</span>PerPlace <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=&gt;</span> [(</span>
<span id="cb6-14">                <span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">Parameter::</span>generator(<span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">FlowParameter::</span>Unbalanced <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span></span>
<span id="cb6-15">                    direction<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">Direction::</span>OutgoingFlow<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb6-16">                    parameter<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">RateParameter::</span>PerPlace <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span></span>
<span id="cb6-17">                        transition<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> mor<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>clone()<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb6-18">                        place<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> input<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>clone()<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>unwrap_generator()<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb6-19">                    <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">},</span></span>
<span id="cb6-20">                <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb6-21">                term<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>clone()<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb6-22">            )]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb6-23">        <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span></span>
<span id="cb6-24">        <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>into_iter()</span>
<span id="cb6-25">        <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>collect()<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb6-26"></span>
<span id="cb6-27">        sys<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>add_term(input<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>unwrap_generator()<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>input_term<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>clone())<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb6-28">    <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span></span>
<span id="cb6-29">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> output <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> outputs <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span></span>
<span id="cb6-30">      <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">...</span></span>
<span id="cb6-31">    <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span></span>
<span id="cb6-32"></span>
<span id="cb6-33">    sys<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>normalize()</span>
<span id="cb6-34"><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span></span></code></pre></div></div>
</section>
<section id="writing-a-test" class="level2" data-number="3">
<h2 data-number="3" data-anchor-id="writing-a-test"><span class="header-section-number">3</span> Writing a test</h2>
<p>There is a growing collection of <a href="https://github.com/ToposInstitute/CatColab/blob/main/packages/catlog/src/stdlib/models.rs">test models</a> in <code>catlog</code> that we use for unit and regression testing. One of them is a small Petri net representing a catalytic reaction:</p>
<div class="tikz">
<img src="https://topos.institute/blog/2026-04-18-extending-mass-action-semantics-2/_svgs/28f0da7ca58899d4be2fce8479634789eadb6dd5.svg" class="img-fluid">
</div>
<p>Thanks to all the work on the <a href="https://github.com/ToposInstitute/CatColab/blob/main/packages/catlog/examples/tt/text/">DoubleTT text elaborator</a>, we can construct this model without too much boilerplate:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb7" style="background: #f1f3f5;"><pre class="sourceCode rust code-with-copy"><code class="sourceCode rust"><span id="cb7-1"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">let</span> th <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">Rc::</span>new(th_sym_monoidal_category())<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb7-2"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">let</span> model <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">tt::modelgen::Model::</span>from_text(</span>
<span id="cb7-3">    <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span>th<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>into()<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb7-4">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"[</span></span>
<span id="cb7-5"><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">        x : Object,</span></span>
<span id="cb7-6"><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">        y : Object,</span></span>
<span id="cb7-7"><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">        c : Object,</span></span>
<span id="cb7-8"><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">        f : (Hom Object)[@tensor [x, c], @tensor [y, c]],</span></span>
<span id="cb7-9"><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">    ]"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb7-10">)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb7-11"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">let</span> model <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> model<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>unwrap()<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>as_modal()<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>unwrap()<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span></code></pre></div></div>
<p>We can now write a test that applies unbalanced, per-place, mass-action semantics to this model and verifies that the output is what we expect, namely <img src="https://latex.codecogs.com/png.latex?%0A%20%20%5Cleft%5C%7B%0A%20%20%20%20%5Cbegin%7Baligned%7D%0A%20%20%20%20%20%20%5Cdot%7Bx%7D%20&amp;=%20-%5Ckappa_f%5Ex%20cx%0A%20%20%20%20%5C%5C%5Cdot%7By%7D%20&amp;=%20%5Cphantom%7B-%7D%5Crho_r%5Ey%20cx%0A%20%20%20%20%5C%5C%5Cdot%7Bc%7D%20&amp;=%20(%5Crho_f%5Ec%20-%20%5Ckappa_f%5Ec)%20cx%0A%20%20%20%20%5Cend%7Baligned%7D%0A%20%20%5Cright.%0A"> Note that the “catalyst” <img src="https://latex.codecogs.com/png.latex?c"> is not actually left unchanged unless <img src="https://latex.codecogs.com/png.latex?f"> is balanced with respect to <img src="https://latex.codecogs.com/png.latex?c">, i.e.&nbsp;unless <img src="https://latex.codecogs.com/png.latex?%5Crho_f%5Ec%20=%20%5Ckappa_f%5Ec">.</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb8" style="background: #f1f3f5;"><pre class="sourceCode rust code-with-copy"><code class="sourceCode rust"><span id="cb8-1"><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">#[</span>test<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">]</span></span>
<span id="cb8-2"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">fn</span> catalysis_dynamics() <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span></span>
<span id="cb8-3">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">let</span> th <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">Rc::</span>new(th_sym_monoidal_category())<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb8-4">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">let</span> model <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> catalyzed_reaction(th)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb8-5">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">let</span> sys <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">PetriNetMassActionAnalysis::</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">default</span>()<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>build_system(</span>
<span id="cb8-6">        <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span>model<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb8-7">        <span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">MassConservationType::</span>Unbalanced(<span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">RateGranularity::</span>PerPlace)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb8-8">    )<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb8-9">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">let</span> expected <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">expect!</span>([<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">r#"</span></span>
<span id="cb8-10"><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">        dx = -(x-&gt;[f]) c x</span></span>
<span id="cb8-11"><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">        dy = ([f]-&gt;y) c x</span></span>
<span id="cb8-12"><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">        dc = (([f]-&gt;c) - (c-&gt;[f])) c x</span></span>
<span id="cb8-13"><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">    "#</span>])<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb8-14">    expected<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>assert_eq(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span>sys<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>to_string())<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb8-15"><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span></span></code></pre></div></div>
<p>Here, instead of LaTeX, we’re just using a simple ASCII printer for parameters, which outputs e.g.&nbsp;<code>(x-&gt;[f])</code> instead of <img src="https://latex.codecogs.com/png.latex?%5Ckappa_f%5Ex"> and <code>([f]-&gt;y)</code> instead of <img src="https://latex.codecogs.com/png.latex?%5Crho_f%5Ey">.</p>
<p>Running <code>cargo test</code> tells us that everything works just as we want. Nice!</p>


</section>

<script defer="" src="https://comments.topos.institute/comentario.js"></script>

 ]]></description>
  <category>CatColab</category>
  <category>modeling</category>
  <guid>https://topos.institute/blog/2026-04-18-extending-mass-action-semantics-2/</guid>
  <pubDate>Sat, 18 Apr 2026 00:00:00 GMT</pubDate>
  <media:content url="https://topos.institute/blog/2026-04-18-extending-mass-action-semantics-2/catcolab-model.png" medium="image" type="image/png" height="102" width="144"/>
</item>
<item>
  <title>Blog / CatColab v0.5: Sandpiper</title>
  <dc:creator>Tim Hosgood</dc:creator>
  <link>https://topos.institute/blog/2026-03-23-catcolab-0-5-sandpiper/</link>
  <description><![CDATA[ 





<div class="quarto-layout-panel" data-layout-ncol="2">
<div class="quarto-layout-row quarto-layout-valign-center">
<div class="quarto-layout-cell" style="flex-basis: 50.0%;justify-content: flex-start;">
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><a href="sandpiper.jpg" class="lightbox" data-gallery="quarto-lightbox-gallery-1" title="Western Sandpiper photo © Mike Cameron / Macaulay Library"><img src="https://topos.institute/blog/2026-03-23-catcolab-0-5-sandpiper/sandpiper.jpg" class="img-fluid figure-img" alt="Western Sandpiper photo © Mike Cameron / Macaulay Library"></a></p>
<figcaption><a href="https://macaulaylibrary.org/asset/137933661">Western Sandpiper photo © Mike Cameron / Macaulay Library</a></figcaption>
</figure>
</div>
</div>
<div class="quarto-layout-cell" style="flex-basis: 50.0%;justify-content: flex-start;">
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><a href="general-screenshot.png" class="lightbox" data-gallery="quarto-lightbox-gallery-2" title="Some of the new analyses in Sandpiper"><img src="https://topos.institute/blog/2026-03-23-catcolab-0-5-sandpiper/general-screenshot.png" class="img-fluid figure-img" alt="Some of the new analyses in Sandpiper"></a></p>
<figcaption>Some of the new analyses in Sandpiper</figcaption>
</figure>
</div>
</div>
</div>
</div>
<p>After 97 days and 96 merged pull requests, CatColab has gone from <strong>v0.4:&nbsp;Robin</strong> to <strong>v0.5:&nbsp;Sandpiper</strong>. In this post I’ll walk through some of the main additions, changes, and fixes. You can find the changelog and complete release notes on GitHub:</p>
<div class="text-center">
<p><a href="https://github.com/ToposInstitute/CatColab/blob/main/CHANGELOG.md" class="btn btn-outline-secondary"> CHANGELOG</a> <a href="https://github.com/ToposInstitute/CatColab/releases/tag/v0.5.0" class="btn btn-outline-secondary"> Full v0.5 release notes</a></p>
</div>
<div class="small">
<p>CatColab is a collaborative environment for formal, interoperable, conceptual modeling. For an introduction to CatColab, visit the <a href="https://catcolab.org/help">help page</a>.</p>
</div>
<section id="major-new-features" class="level2">
<h2 data-anchor-id="major-new-features">Major new features</h2>
<p>The three most evident new features highlight some of our work’s main focuses over the past three months, namely <strong>compositionality</strong>, <strong>ODE semantics</strong>, and <strong>database theory</strong>.</p>
<section id="composition-of-petri-nets" class="level3">
<h3 data-anchor-id="composition-of-petri-nets">Composition of Petri nets</h3>
<p>Two major features <a href="../../blog/2026-01-08-catcolab-0-4-robin/">in the previous release</a> were Petri nets and composing models of discrete theories. This release brings these two together! We have extended CatColab’s <a href="https://github.com/ToposInstitute/CatColab/tree/main/packages/catlog/examples/tt/text">DoubleTT</a> implementation to enable composing models of modal theories, which means in particular that <strong>Petri nets can now be composed along places</strong>. As a tiny example, we can start by instantiating the standard SIR model <img src="https://latex.codecogs.com/png.latex?%0A%5Cmathtt%7Bunvax%7D%20=%0A%5Cleft%5C%7B%0AS%0A%5Clongrightarrow%0A%5Cboxed%7B%5Cmathrm%7Binfect%7D%7D%0A%5Cmathrel%7B%5Csubstack%7B%0A%5Ctextstyle%5Clongleftarrow%5C%5C%0A%5Ctextstyle%5Clongrightarrow%5C%5C%0A%5Ctextstyle%5Clongrightarrow%0A%7D%7D%0AI%0A%5Clongrightarrow%0A%5Cboxed%7B%5Cmathrm%7Brecover%7D%7D%0A%5Clongrightarrow%0AR%0A%5Cright%5C%7D%0A"> and then add a new state and transition <img src="https://latex.codecogs.com/png.latex?%0A%5Cmathtt%7Bunvax%7D.S%0A%5Clongrightarrow%0A%5Cboxed%7B%5Cmathrm%7Bvaccinate%7D%7D%0A%5Clongrightarrow%0AV%0A"> to obtain an SIRV model.</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><a href="compositional-petri-net.png" class="lightbox" data-gallery="quarto-lightbox-gallery-3" title="Building a simple SIRV Petri net by instantiating an SIR model and adding a vaccination state and transition"><img src="https://topos.institute/blog/2026-03-23-catcolab-0-5-sandpiper/compositional-petri-net.png" class="border img-fluid figure-img" alt="Building a simple SIRV Petri net by instantiating an SIR model and adding a vaccination state and transition"></a></p>
<figcaption>Building a simple SIRV Petri net by instantiating an SIR model and adding a vaccination state and transition</figcaption>
</figure>
</div>
</section>
<section id="unbalanced-mass-action-ode-systems-and-equation-visualisation" class="level3">
<h3 data-anchor-id="unbalanced-mass-action-ode-systems-and-equation-visualisation">Unbalanced mass-action ODE systems, and equation visualisation</h3>
<p>When working with ODE semantics for a model, it’s useful to know <em>which</em> equations are actually being simulated. Doing this by hand is time consuming and error prone, and this is exactly the kind of task that computers are very good at doing. The mass-action dynamics analysis (available for <a href="https://catcolab.org/help/logics/primitive-stock-flow">stock-flow diagrams</a> and <a href="https://catcolab.org/help/logics/petri-net">Petri nets</a>) will now <strong>show you the equations generated by your model</strong>, with either generic symbolic parameters or numerical parameter values from your simulation.</p>
<p>The mass-action dynamics analysis also has two new settings increasing its generality: mass conservation and rate granularity. This reflects a new (non-standard) capability for <strong>mass-action dynamics that do not preserve mass</strong>. You can read more about unbalanced mass-action in <a href="../../blog/2026-03-16-extending-mass-action-semantics-1/">this blog post</a> and <a href="../../blog/2026-03-27-extending-mass-action-semnatics-2">its sequel</a>.</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><a href="mass-action-equations.png" class="lightbox" data-gallery="quarto-lightbox-gallery-4" title="Mass-action dynamics equations derived from a Petri net"><img src="https://topos.institute/blog/2026-03-23-catcolab-0-5-sandpiper/mass-action-equations.png" class="border img-fluid figure-img" alt="Mass-action dynamics equations derived from a Petri net"></a></p>
<figcaption>Mass-action dynamics equations derived from a Petri net</figcaption>
</figure>
</div>
</section>
<section id="sql-schema-definitions" class="level3">
<h3 data-anchor-id="sql-schema-definitions">SQL schema definitions</h3>
<p>The mathematical history of CatColab can be traced in part to the categorical approach to database theory, as explained by David Spivak and Brendan Fong in Chapter&nbsp;3 of <a href="https://arxiv.org/abs/1803.05316"><em>Seven Sketches in Compositionality</em></a>. Much of our recent focus has been on quantitative scientific modeling, but we do intend to keep expanding the database capabilities of CatColab. Thanks to Matt Cuffaro, you can now <strong>generate SQL schema definitions</strong> in several dialects from a schema model in a CatColab. You can read more about this feature in the <a href="https://catcolab.org/help/logics/simple-schema">schema help pages</a>.</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><a href="sql-schema.png" class="lightbox" data-gallery="quarto-lightbox-gallery-5" title="A schema model and the generated SQL schema definitions in PostgresSQL"><img src="https://topos.institute/blog/2026-03-23-catcolab-0-5-sandpiper/sql-schema.png" class="border img-fluid figure-img" alt="A schema model and the generated SQL schema definitions in PostgresSQL"></a></p>
<figcaption>A schema model and the generated SQL schema definitions in PostgresSQL</figcaption>
</figure>
</div>
</section>
</section>
<section id="other-improvements-and-fixes" class="level2">
<h2 data-anchor-id="other-improvements-and-fixes">Other improvements and fixes</h2>
<section id="improved-graph-layouts" class="level3">
<h3 data-anchor-id="improved-graph-layouts">Improved graph layouts</h3>
<p>To visualise models we make use of graph layout algorithms, which are notoriously sensitive to input data and parameters. Now, in addition to the <a href="https://graphviz.org">Graphviz</a> layout engine, you can choose to use <a href="https://eclipse.dev/elk/">ELK</a> (via the package <a href="https://github.com/kieler/elkjs">elkjs</a>). This gives you another option to choose from. We have found that ELK’s layered algorithm is particularly well suited to Petri nets.</p>
</section>
<section id="rust-backend" class="level3">
<h3 data-anchor-id="rust-backend">Rust backend</h3>
<p>Following a backend re-architecture, syncing of <a href="https://automerge.org/">Automerge</a> documents is now provided by the new Rust crate <a href="https://github.com/alexjg/samod"><code>samod</code></a> instead of the Node package <a href="https://github.com/automerge/automerge-repo"><code>automerge-repo</code></a>. This means that 100% of the CatColab backend is now written in Rust 🦀</p>
</section>
<section id="document-corruption-fix" class="level3">
<h3 data-anchor-id="document-corruption-fix">Document corruption fix</h3>
<p>There was a pretty terrible bug related to the rich text editor, which could result in Automerge documents becoming corrupted and thus un-openable. This bug was fixed <a href="https://github.com/automerge/automerge/pull/1279">upstream</a> thanks to the Ink &amp; Switch team. We also now have better systems in place to detect corrupted documents should similar problems arise in the future.</p>


</section>
</section>

<script defer="" src="https://comments.topos.institute/comentario.js"></script>

 ]]></description>
  <category>CatColab</category>
  <guid>https://topos.institute/blog/2026-03-23-catcolab-0-5-sandpiper/</guid>
  <pubDate>Mon, 23 Mar 2026 00:00:00 GMT</pubDate>
  <media:content url="https://topos.institute/blog/2026-03-23-catcolab-0-5-sandpiper/sandpiper.jpg" medium="image" type="image/jpeg"/>
</item>
<item>
  <title>Blog / Can the Most Abstract Math Make the World a Better Place? (Quanta)</title>
  <dc:creator>Brendan Fong</dc:creator>
  <link>https://topos.institute/blog/2026-03-18-quanta-can-the-most-abstract-math/</link>
  <description><![CDATA[ 





<div class="card" style="border: 1px solid black;">
  <div class="card-body">
    <h5 class="card-title">Can the Most Abstract Math Make the World a Better Place?</h5>
    <h6 class="card-subtitle mb-2 text-muted">Columnist Natalie Wolchover explores whether applied category theory can be "green" math.</h6>
    <p class="card-text"><i>Like these mathematicians, I yearn to make the world a better place while doing what I love. (Don't we all?) Philosophically, I see the promise in applied category theory. Time will tell whether the approach will genuinely help humanity or the planet. But for those who feel called to do good and to do math, it's worth a try.</i></p>
    <a href="https://www.quantamagazine.org/can-the-most-abstract-math-make-the-world-a-better-place-20260304/" class="card-link"><i class="bi bi-box-arrow-up-right"></i> Full post</a>
  </div>
</div>



<script defer="" src="https://comments.topos.institute/comentario.js"></script>

 ]]></description>
  <category>crosspost</category>
  <category>micro</category>
  <guid>https://topos.institute/blog/2026-03-18-quanta-can-the-most-abstract-math/</guid>
  <pubDate>Wed, 18 Mar 2026 00:00:00 GMT</pubDate>
</item>
<item>
  <title>Blog / Extending mass-action semantics, Part 1</title>
  <dc:creator>Tim Hosgood</dc:creator>
  <link>https://topos.institute/blog/2026-03-16-extending-mass-action-semantics-1/</link>
  <description><![CDATA[ 





<div class="callout callout-style-default callout-note callout-titled">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
Note
</div>
</div>
<div class="callout-body-container callout-body">
<p>This post has a sequel: <a href="../../blog/2026-04-18-extending-mass-action-semantics-2">Part&nbsp;2</a>.</p>
</div>
</div>
<section id="some-context" class="level1" data-number="1">
<h1 data-number="1"><span class="header-section-number">1</span> Some context</h1>
<p>In January, <a href="https://eeb.utk.edu/people/nina-fefferman/">Nina Fefferman</a>, <a href="https://www.bowdoin.edu/profiles/faculty/mlzeeman/">Mary Lou Zeeman</a>, and myself, supported by the <a href="https://appex.org">Center for Analysis and Prediction of Pandemic Expansion</a> and the <a href="https://aimath.org">American Institute of Mathematics</a>, organised a workshop:</p>
<blockquote class="blockquote">
<p><a href="https://aimath.org/pastworkshops/formalmodel.html">Formal scientific modeling: a case study in global health</a>.</p>
</blockquote>
<p>We are in the process of preparing a report on the workshop, but, in short, “it was very good”, thanks entirely to the other organisers, the support of AIM, and the enthusiasm and expertise of the participants. However, this blog post is not about the workshop directly. Rather, I’d like to speak about a small piece of research that came out of a conversation during the workshop, and that has now landed in CatColab. I’d like to try to answer a few different questions in this post:</p>
<ol type="1">
<li><p>How can formal categorical modelling help people to better understand scientific models outside their expertise?</p></li>
<li><p>What do we mean when we say things like “categorical modelling can help make assumptions explicit”?</p></li>
<li><p>How can we allow for somewhat informal-looking diagrams to convey precise quantitative information?</p></li>
</ol>
<p>While I won’t directly answer these questions, they’re in the background of the story that I’m going to tell. Then, in a future post, I’m going to focus more on the following:</p>
<ol start="4" type="1">
<li><p>How can software support the process of building categorical models?</p></li>
<li><p>What does it look like, in practice, to add new functionality to CatColab?</p></li>
</ol>
</section>
<section id="understanding-a-model" class="level1" data-number="2">
<h1 data-number="2"><span class="header-section-number">2</span> Understanding a model</h1>
<p>I’m going to be talking about the model from the paper</p>
<blockquote class="blockquote">
<p>A. Hoyer-Leitzel, S.M. Iams, A.J. Haslam-Hyde, M.L. Zeeman, N.H. Fefferman, “An immuno-epidemiological model for transient immune protection: A case study for viral respiratory infections”. <em>Infectious Disease Modelling</em> <strong>8</strong> (2023), pp.&nbsp;855–864. DOI: <a href="https://doi.org/10.1016/j.idm.2023.07.004">10.1016/j.idm.2023.07.004</a></p>
</blockquote>
<p>which I’ll refer to as <span class="citation" data-cites="HLIHHZF">(Hoyer-Leitzel et al. 2023)</span> or simply “the paper”.</p>
<section id="the-exercise" class="level2" data-number="2.1">
<h2 data-number="2.1" data-anchor-id="the-exercise"><span class="header-section-number">2.1</span> The exercise</h2>
<p>Let me start with the usual disclaimer: <em>I am not an immuno-epidemiologist</em>. In fact, I’m not even close, and have spent the last few months realising how little biology I actually know. But for the purpose of this exercise, <em>this is actually a good thing</em> because it gives an example of the kind of problem that I’m interested in studying: how can people sitting on opposite sides of a domain-specialist boundary better communicate? To be a bit more concrete, if I read a paper on a specific model in immuno-epidemiology and see some graph-like diagrams and systems of ordinary differential equations — things that I understand comparatively well — how can I be more sure that I’m not completely misinterpreting them? One of my preferred ways of teaching/learning is to flip things around and have the student explain things to the teacher, amongst other reasons because this often highlights key misunderstandings that can easily go unnoticed. I think the same thing can work well here:</p>
<div class="callout callout-style-simple callout-warning no-icon callout-titled" title="The exercise">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon no-icon"></i>
</div>
<div class="callout-title-container flex-fill">
<span class="screen-reader-only">Warning</span>The exercise
</div>
</div>
<div class="callout-body-container callout-body">
<p>We’re going to try to rebuild the model and explain it back, constructing a formal mathematical artefact that can be used to centre a discussion. Then people can point at specific things that we say and respond with “this sounds wrong” or “this seems right”.</p>
</div>
</div>
<p>Anyway, enough preamble. The model in the paper is <em>almost</em> given by the <strong>system of ODEs</strong> <span class="citation" data-cites="HLIHHZF">(Hoyer-Leitzel et al. 2023, Equation 1)</span> <img src="https://latex.codecogs.com/png.latex?%0A%5Cleft%5C%7B%0A%5Cbegin%7Baligned%7D%0A%20%20%5Cdot%7BV%7D%20&amp;=%20pI%20-%20cV%20-%20%5Cmu%20VA%20-%20%5Cbeta%20VT%0A%5C%5C%5Cdot%7BT%7D%20&amp;=%20gT%5Cleft(%201-%5Cfrac%7BT+I%7D%7BC_T%7D%20%5Cright)%20-%20%5Cbeta'%20VT%0A%5C%5C%5Cdot%7BI%7D%20&amp;=%20%5Cbeta'%20VT%20-%20%5Cdelta%20I%20-%20%5Ckappa%20IF%0A%5C%5C%5Cdot%7BF%7D%20&amp;=%20qI%20-%20dF%0A%5C%5C%5Cdot%7BB%7D%20&amp;=%20m_1%20V(1-B)%20-%20m_2%20B%0A%5C%5C%5Cdot%7BA%7D%20&amp;=%20m_3%20B%20-%20rA%20-%20%5Cmu'%20VA%0A%5Cend%7Baligned%7D%0A%5Cright.%0A"> where the coefficients are described in the <strong>parameter table</strong> <span class="citation" data-cites="HLIHHZF">(Hoyer-Leitzel et al. 2023, Table 1)</span>, e.g.&nbsp;<img src="https://latex.codecogs.com/png.latex?p"> is the “viral production rate”, <img src="https://latex.codecogs.com/png.latex?c"> is the “viral clearance rate” , and so on. I say “<em>almost</em>” because I have omitted a smoothing term <img src="https://latex.codecogs.com/png.latex?%5Cfrac%7BV%7D%7BV_m+V%7D"> that multiplies the three appearances of the <img src="https://latex.codecogs.com/png.latex?VT"> monomial. The use of this smoothing term is actually one of the novel parts in the paper, and does raise a non-trivial question to the categorical modeller, but I’m going to save that story for another day.</p>
<p>Alongside these quantitative parts, there’s a more high-level <strong>diagram</strong> <span class="citation" data-cites="HLIHHZF">(Hoyer-Leitzel et al. 2023, fig. 1)</span> explaining the general processes described by the model, reproduced below.</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><a href="figure-1.png" class="lightbox" data-gallery="quarto-lightbox-gallery-1" title="An informal representation of the model"><img src="https://topos.institute/blog/2026-03-16-extending-mass-action-semantics-1/figure-1.png" class="img-fluid figure-img" style="width:80.0%" alt="An informal representation of the model"></a></p>
<figcaption>An informal representation of the model</figcaption>
</figure>
</div>
<p>So here’s what we’re going to do: we’re going to draw our own version of the diagram, building it up bit by bit by grouping together terms in the system of ODEs, using the context given in the parameter table. What this will entail is “pairing up” terms in the ODEs to demarcate them as individual processes. The point is that we will likely not end up doing this in a biologically-correct way, but this method ensures that we have to make <em>some</em> specific choices and commit to these assumptions.</p>
<div class="callout callout-style-simple callout-warning no-icon">
<div class="callout-body d-flex">
<div class="callout-icon-container">
<i class="callout-icon no-icon"></i>
</div>
<div class="callout-body-container">
<p>There are multiple different diagrams that would recover exactly the same system of ODEs. This is because diagrams convey information about the <em>processes</em> postulated by the model, which are at best only implicit in the equations.</p>
</div>
</div>
</div>
</section>
<section id="rebuilding-the-model" class="level2" data-number="2.2">
<h2 data-number="2.2" data-anchor-id="rebuilding-the-model"><span class="header-section-number">2.2</span> Rebuilding the model</h2>
<p>Looking at the diagram, there’s some interaction between target cells <img src="https://latex.codecogs.com/png.latex?T">, the virus <img src="https://latex.codecogs.com/png.latex?V">, and the infected cells <img src="https://latex.codecogs.com/png.latex?I">. An educated guess tells me that viruses do something to target cells to turn them into infected cells and maybe get “used up” in the process, so this interaction will probably turn up in the equations for <img src="https://latex.codecogs.com/png.latex?%5Cdot%7BV%7D">, <img src="https://latex.codecogs.com/png.latex?%5Cdot%7BT%7D">, and <img src="https://latex.codecogs.com/png.latex?%5Cdot%7BI%7D">. Having heard of <strong>mass-action dynamics</strong> from e.g. <span class="citation" data-cites="BP2017">(Baez and Pollard 2017)</span>, I would guess that the corresponding terms in the ODEs will be proportional to the product of the inputs, i.e.&nbsp;<img src="https://latex.codecogs.com/png.latex?VT">. Putting this all together, it seems fair to assume that we have a correspondence between the circled part of the diagram and the boxed terms in the equations below:</p>
<div class="quarto-layout-panel" data-layout-ncol="2">
<div class="quarto-layout-row">
<div class="quarto-layout-cell" style="flex-basis: 50.0%;justify-content: center;">
<p><a href="figure-1-VT.png" class="lightbox" data-gallery="quarto-lightbox-gallery-2"><img src="https://topos.institute/blog/2026-03-16-extending-mass-action-semantics-1/figure-1-VT.png" class="img-fluid"></a></p>
</div>
<div class="quarto-layout-cell" style="flex-basis: 50.0%;justify-content: flex-start;">
<p><img src="https://latex.codecogs.com/png.latex?%0A%5Cleft%5C%7B%0A%5Cbegin%7Baligned%7D%0A%20%20%5Cdot%7BV%7D%20&amp;=%20pI%20-%20cV%20-%20%5Cmu%20VA%20-%20%5Cboxed%7B%5Ccolor%7Bpurple%7D%5Cbeta%20VT%7D%0A%5C%5C%5Cdot%7BT%7D%20&amp;=%20gT%5Cleft(%201-%5Cfrac%7BT+I%7D%7BC_T%7D%20%5Cright)%20-%20%5Cboxed%7B%5Ccolor%7Bpurple%7D%5Cbeta'%20VT%7D%0A%5C%5C%5Cdot%7BI%7D%20&amp;=%20%5Cboxed%7B%5Ccolor%7Bpurple%7D%5Cbeta'%20VT%7D%20-%20%5Cdelta%20I%20-%20%5Ckappa%20IF%0A%5C%5C%5Cdot%7BF%7D%20&amp;=%20qI%20-%20dF%0A%5C%5C%5Cdot%7BB%7D%20&amp;=%20m_1%20V(1-B)%20-%20m_2%20B%0A%5C%5C%5Cdot%7BA%7D%20&amp;=%20m_3%20B%20-%20rA%20-%20%5Cmu'%20VA%0A%5Cend%7Baligned%7D%0A%5Cright.%0A"></p>
</div>
</div>
</div>
<p>Looking at the parameter table, we see that <img src="https://latex.codecogs.com/png.latex?%5Cbeta"> and <img src="https://latex.codecogs.com/png.latex?%5Cbeta'"> correspond to “rate of viral loss per target cell” and “rate of conversion from target cells to infected cells per virion”, respectively. This seems to confirm our conclusion, so let’s start drawing a diagram for ourselves.</p>
<section id="the-first-interaction-infection" class="level3" data-number="2.2.1">
<h3 data-number="2.2.1" data-anchor-id="the-first-interaction-infection"><span class="header-section-number">2.2.1</span> The first interaction: <em>infection</em></h3>
<p>Rather than drawing multi-arrows (arrows with multiple inputs), we’ll take inspiration from Petri net notation and make interactions first-class elements, drawing them as boxes. Then our variables can be inputs or outputs of interactions. For example, we would draw this “infection” interaction like so:</p>
<div class="cell" data-layout-align="center">
<div class="cell-output-display">
<div>
<p></p><figure class="figure"><p></p>
<div>
<pre class="mermaid mermaid-js">flowchart LR
  T("`**T**arget cells`") --&gt; X[infection]
  V("`**V**irus`") --&gt; X
  X --&gt; I("`**I**nfected cells`")
  classDef transition fill:#53b6b2
  class X transition
</pre>
</div>
<p></p></figure><p></p>
</div>
</div>
</div>
<p>This is intended to be read in a similar way to mass-action dynamics for Petri nets: each variable will have an ODE describing its behaviour, and each transition generates <strong>contributions</strong> (i.e.&nbsp;terms) of these ODEs. Whenever you see a transition, you should look at all the input variables (here, <img src="https://latex.codecogs.com/png.latex?V"> and <img src="https://latex.codecogs.com/png.latex?T">) and take their product (<img src="https://latex.codecogs.com/png.latex?VT">). You then add this as a <em>negative</em> term to each of the ODEs corresponding to an input variable, and as a <em>positive</em> term to those corresponding to an output variable. So here we would get <img src="https://latex.codecogs.com/png.latex?%0A%5Cleft%5C%7B%0A%5Cbegin%7Baligned%7D%0A%20%20%5Cdot%7BV%7D%20&amp;%5Coverset%7B+%7D%7B=%7D%20VT%0A%5C%5C%5Cdot%7BT%7D%20&amp;%5Coverset%7B+%7D%7B=%7D%20VT%0A%5C%5C%5Cdot%7BI%7D%20&amp;%5Coverset%7B-%7D%7B=%7D%20VT%0A%5Cend%7Baligned%7D%0A%5Cright.%0A"></p>
<p>But the thing we’re going to do differently here is to <em>also</em> labelled the arrows with some data, namely <img src="https://latex.codecogs.com/png.latex?%5Cbeta"> and <img src="https://latex.codecogs.com/png.latex?%5Cbeta'">, corresponding to the coefficient of the monomial in the ODE. This should be interpreted as telling us the <strong>rate coefficient</strong> for that term. All in all then, we have a convention for (a) drawing diagrams, and (b) turning them into systems of ODEs.</p>
<div class="quarto-layout-panel" data-layout="[75,25]">
<div class="quarto-layout-row quarto-layout-valign-center">
<div class="quarto-layout-cell" style="flex-basis: 75.0%;justify-content: flex-start;">
<div class="cell" data-layout-align="center">
<div class="cell-output-display">
<div>
<p></p><figure class="figure"><p></p>
<div>
<pre class="mermaid mermaid-js">flowchart LR
  T("`**T**arget cells`") --&gt;|𝛽'| X[infection]
  V("`**V**irus`") --&gt;|𝛽| X
  X --&gt;|𝛽'| I("`**I**nfected cells`")
  classDef transition fill:#53b6b2
  class X transition
</pre>
</div>
<p></p></figure><p></p>
</div>
</div>
</div>
</div>
<div class="quarto-layout-cell" style="flex-basis: 25.0%;justify-content: flex-start;">
<p><img src="https://latex.codecogs.com/png.latex?%0A%5Cleftrightsquigarrow%0A%5Cleft%5C%7B%0A%5Cbegin%7Baligned%7D%0A%20%20%5Cdot%7BV%7D%20&amp;%5Coverset%7B+%7D%7B=%7D%20%5Cbeta%20VT%0A%5C%5C%5Cdot%7BT%7D%20&amp;%5Coverset%7B+%7D%7B=%7D%20%5Cbeta'VT%0A%5C%5C%5Cdot%7BI%7D%20&amp;%5Coverset%7B-%7D%7B=%7D%20%5Cbeta'VT%0A%5Cend%7Baligned%7D%0A%5Cright.%0A"></p>
</div>
</div>
</div>
<div class="callout callout-style-simple callout-warning no-icon callout-titled" title="Assumption made explicit">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon no-icon"></i>
</div>
<div class="callout-title-container flex-fill">
<span class="screen-reader-only">Warning</span>Assumption made explicit
</div>
</div>
<div class="callout-body-container callout-body">
<p>Every interaction corresponds to a specific monomial, which gives a contribution to the ODEs governing both the inputs and outputs. The coefficients of these contributions are specific to each input and output of the interaction, rather than being determined by just the interaction itself. In other words, every interaction is “mass-conserving up to a constant”.</p>
</div>
</div>
</section>
<section id="different-diagrams-clouds-and-no-links" class="level3" data-number="2.2.2">
<h3 data-number="2.2.2" data-anchor-id="different-diagrams-clouds-and-no-links"><span class="header-section-number">2.2.2</span> Different diagrams, clouds, and no links</h3>
<p>Let’s move on to another interaction. Looking at the system of ODEs and the parameter table, it seems like the terms <img src="https://latex.codecogs.com/png.latex?%0A%5Cleft%5C%7B%0A%5Cbegin%7Baligned%7D%0A%20%20%5Cdot%7BV%7D%20&amp;%5Coverset%7B-%7D%7B=%7D%20%5Cmu%20VA%0A%5C%5C%5Cdot%7BA%7D%20&amp;%5Coverset%7B-%7D%7B=%7D%20%5Cmu'VA%0A%5Cend%7Baligned%7D%0A%5Cright.%0A"> can also be paired up, coming from a virion/antibody interaction. We can add this to our diagram:</p>
<div class="cell" data-layout-align="center">
<div class="cell-output-display">
<div>
<p></p><figure class="figure"><p></p>
<div>
<pre class="mermaid mermaid-js">flowchart LR
  T("`**T**arget cells`") --&gt;|𝛽'| X[infection]
  V("`**V**irus`") --&gt;|𝛽| X
  X --&gt;|𝛽'| I("`**I**nfected cells`")
  V --&gt;|𝜇| Y{{antibody-virion binding}}
  A("`**A**ntibodies`") --&gt;|𝜇'| Y
  classDef transition fill:#53b6b2
  classDef death fill:#ddd,color:#555
  class X transition
  class Y death
</pre>
</div>
<p></p></figure><p></p>
</div>
</div>
</div>
<p>We haven’t drawn any output for this new interaction, but that’s because it concerns a quantity that we’ve decided we’re not interested in measuring, namely the number of “dead” viruses and/or antibodies. We could take inspiration from stock-flow/system structure diagrams and draw <em>clouds</em> to represent such quantities, but for the sake of simplicity we’re not going to do that and instead just make the interaction itself grey and hexagonal.</p>
<p>Anyway, adding this second interaction is an important step, because now our diagram really does look different from the one in <span class="citation" data-cites="HLIHHZF">(Hoyer-Leitzel et al. 2023)</span>. The latter shows antibodies as <em>inhibiting</em> virus production, whereas ours shows antibodies and viruses interacting in some process as sort of “equal players”. Maybe we could enrich our diagrams to allow for some sort of inhibition arrows, building up some sort of <strong>multi-ary stock-flow with links</strong> syntax. But I’m not going to do that right now, for a few reasons, but primarily because <em>I don’t have the biological intuition to know what is correct</em>. This is one example of what I meant by question (2) right at the start of this post: what does it mean to make our assumptions explicit? Here I’m showing that, <em>to me</em>, the antibody response interaction is of the same sort of shape/flavour/vibe as the infection interaction: it takes inputs and gives outputs, and the interaction itself is <em>not</em> modulated by some any parameter, or affected by any other variables. By building this diagram we are expressing <em>our</em> understanding of what we intend the model to represent, by essentially saying things like “I don’t believe in modulated/parametrised interactions, only direct agent-to-agent interactions”. Whether or not this is a <em>good</em> assumption is something to be discussed, but what I’m trying to point out here is that in order to do so we first need to make clear that we <em>are indeed</em> asserting this as an assumption.</p>
<p>We’re immediately going to see another example of this same phenomenon once we look at the equation governing <img src="https://latex.codecogs.com/png.latex?%5Cdot%7BF%7D">. Interferons are named as such because they “interfere” with virus production (so <a href="https://en.wikipedia.org/wiki/Interferon">Wikipedia</a> tells me). In this model, it seems like they do so only by means of reducing the number of infected cells as <img src="https://latex.codecogs.com/png.latex?%0A%20%20%5Cdot%7BI%7D%5Coverset%7B-%7D%7B=%7D%5Ckappa%20IF%0A"> since there is no contribution to <img src="https://latex.codecogs.com/png.latex?%5Cdot%7BV%7D"> that directly involves the quantity <img src="https://latex.codecogs.com/png.latex?F">. Furthermore, the equation governing <img src="https://latex.codecogs.com/png.latex?F"> is <img src="https://latex.codecogs.com/png.latex?%0A%5Cdot%7BF%7D%20=%20qI%20-%20dF%0A"> where <img src="https://latex.codecogs.com/png.latex?q"> is the interferon production rate and <img src="https://latex.codecogs.com/png.latex?d"> is the interferon degradation rate. To me, it sounds like neither of these terms are anything to do with the interferon-infected cell interaction term <img src="https://latex.codecogs.com/png.latex?%5Cdot%7BI%7D%5Coverset%7B-%7D%7B=%7D%5Ckappa%20IF">, but <em>I could very well be wrong</em>. Either way, let’s commit my guess to our diagram:</p>
<div class="cell" data-layout-align="center">
<div class="cell-output-display">
<div>
<p></p><figure class="figure"><p></p>
<div>
<pre class="mermaid mermaid-js">flowchart LR
  I("`**I**nfected cells`")
  F("`Inter**f**erons`")
  X{{I-F interaction}}
  Y[interferon production]
  Z{{interferon degradation}}
  I --&gt;|𝜅| X
  F --&gt;|0| X
  I --&gt;|0| Y
  Y --&gt;|𝑞| F
  F --&gt;|𝑑| Z
  classDef transition fill:#53b6b2
  classDef death fill:#ddd,color:#555
  class X death
  class Y transition
  class Z death
</pre>
</div>
<p></p></figure><p></p>
</div>
</div>
</div>
<p>As a convenient shorthand, rather than labelling an arrow with a <img src="https://latex.codecogs.com/png.latex?0">, from now on I’ll just draw a dotted arrow with no label. In particular, for example, our diagram now says that interferons do not get “used up” in the interferon-infected cell interaction.</p>
<p>We are led to consider the important question: what is the difference between an interaction that takes some input <img src="https://latex.codecogs.com/png.latex?X"> but doesn’t “consume” it, and an interaction that does not take <img src="https://latex.codecogs.com/png.latex?X"> as an input but instead accepts it as a parameter to modulate its rate? Again, we are making explicit in this model one of my assumptions:</p>
<div class="callout callout-style-simple callout-warning no-icon callout-titled" title="Assumption made explicit">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon no-icon"></i>
</div>
<div class="callout-title-container flex-fill">
<span class="screen-reader-only">Warning</span>Assumption made explicit
</div>
</div>
<div class="callout-body-container callout-body">
<p>We are not distinguishing between “zero-consumption” and “parametrised-rate” interactions.</p>
</div>
</div>
</section>
<section id="merging-or-separating-interactions" class="level3" data-number="2.2.3">
<h3 data-number="2.2.3" data-anchor-id="merging-or-separating-interactions"><span class="header-section-number">2.2.3</span> Merging or separating interactions</h3>
<p>Looking back at the system of ODEs, there are three terms given by the monomial <img src="https://latex.codecogs.com/png.latex?I">, namely <img src="https://latex.codecogs.com/png.latex?%0A%5Cbegin%7Baligned%7D%0A%20%20%5Cdot%7BV%7D%20&amp;%5Coverset%7B+%7D%7B=%7D%20pI%0A%5C%5C%5Cdot%7BI%7D%20&amp;%5Coverset%7B-%7D%7B=%7D%20%5Cdelta%20I%0A%5C%5C%5Cdot%7BF%7D%20&amp;%5Coverset%7B+%7D%7B=%7D%20qI.%0A%5Cend%7Baligned%7D%0A"> Without looking up what the parameters <img src="https://latex.codecogs.com/png.latex?p">, <img src="https://latex.codecogs.com/png.latex?%5Cdelta">, and <img src="https://latex.codecogs.com/png.latex?q"> mean, and just thinking about these as abstract ODEs, with no real context, there are multiple ways that we could build a diagram to recover them:</p>
<div class="quarto-layout-panel" data-layout="[50,50]">
<div class="quarto-layout-row quarto-layout-valign-top">
<div class="quarto-layout-cell" style="flex-basis: 50.0%;justify-content: flex-start;">
<ol type="1">
<li>There is a single interaction giving rise to all three monomial contributions</li>
</ol>
</div>
<div class="cell quarto-layout-cell" style="flex-basis: 50.0%;justify-content: flex-start;">
<div class="cell-output-display">
<div>
<p></p><figure class="figure"><p></p>
<div>
<pre class="mermaid mermaid-js">flowchart LR
  V("`**V**irus`")
  I("`**I**nfected cells`")
  F("`Inter**f**erons`")
  X[1]
  I --&gt;|𝛿| X
  X --&gt;|𝑝| V
  X --&gt;|𝑞| F
  classDef transition fill:#53b6b2
  class X transition
</pre>
</div>
<p></p></figure><p></p>
</div>
</div>
</div>
</div>
</div>
<div class="quarto-layout-panel" data-layout="[50,50]">
<div class="quarto-layout-row quarto-layout-valign-top">
<div class="quarto-layout-cell" style="flex-basis: 50.0%;justify-content: flex-start;">
<ol start="2" type="1">
<li>There are two interactions, with e.g.&nbsp;one pairing up the <img src="https://latex.codecogs.com/png.latex?(+pI,+qI)"> terms and the other contributing just the <img src="https://latex.codecogs.com/png.latex?-%5Cdelta%20I"> term<br>
<br>
(or either of the two other possible pairings: <img src="https://latex.codecogs.com/png.latex?(+pI,-%5Cdelta%20I)"> and <img src="https://latex.codecogs.com/png.latex?+qI">, or <img src="https://latex.codecogs.com/png.latex?(+qI,-%5Cdelta%20I)"> and <img src="https://latex.codecogs.com/png.latex?+pI">)</li>
</ol>
</div>
<div class="cell quarto-layout-cell" style="flex-basis: 50.0%;justify-content: flex-start;">
<div class="cell-output-display">
<div>
<p></p><figure class="figure"><p></p>
<div>
<pre class="mermaid mermaid-js">flowchart LR
  V("`**V**irus`")
  I("`**I**nfected cells`")
  F("`Inter**f**erons`")
  X{{2a}}
  Y[2b]
  I --&gt;|𝛿| X
  I -.-&gt; Y
  Y --&gt;|𝑝| F
  Y --&gt;|𝑞| V
  classDef transition fill:#53b6b2
  classDef death fill:#ddd,color:#555
  class X death
  class Y transition
</pre>
</div>
<p></p></figure><p></p>
</div>
</div>
</div>
</div>
</div>
<div class="quarto-layout-panel" data-layout="[50,50]">
<div class="quarto-layout-row quarto-layout-valign-top">
<div class="quarto-layout-cell" style="flex-basis: 50.0%;justify-content: flex-start;">
<ol start="3" type="1">
<li>There are three interactions, with each one contributing a single monomial term</li>
</ol>
</div>
<div class="cell quarto-layout-cell" style="flex-basis: 50.0%;justify-content: flex-start;">
<div class="cell-output-display">
<div>
<p></p><figure class="figure"><p></p>
<div>
<pre class="mermaid mermaid-js">flowchart LR
  V("`**V**irus`")
  I("`**I**nfected cells`")
  F("`Inter**f**erons`")
  X{{3a}}
  Y[3b]
  Z[3c]
  I --&gt;|𝛿| X
  I -.-&gt; Y
  I -.-&gt; Z
  Y --&gt;|𝑝| F
  Z --&gt;|𝑞| V
  classDef transition fill:#53b6b2
  classDef death fill:#ddd,color:#555
  class X death
  class Y transition
  class Z transition
</pre>
</div>
<p></p></figure><p></p>
</div>
</div>
</div>
</div>
</div>
<p>Although all three of these options describe exactly the same quantitative information (i.e the same system of ODEs), they clearly suggest different contextual information, namely “what are the actually interactions that are happening?”. The first and third option are at opposite ends of the spectrum, saying that everything all happens together or that everything all happens completely independently. Yet again, I do not have the biological intuition to know which one is correct, but, yet again, building this diagram rather than merely giving the ODEs means that I have to commit to one of them as an explicit assumption.</p>
<p>Reading the parameter table, we see that <img src="https://latex.codecogs.com/png.latex?p"> is the viral production rate, <img src="https://latex.codecogs.com/png.latex?q"> is the interferon production rate, and <img src="https://latex.codecogs.com/png.latex?%5Cdelta"> is the death/removal rate of infected cells. Unfortunately, I can’t tell from this which option from the above is the best representation. But since we’ve already accounted for the interferon-infected cell interference in the <img src="https://latex.codecogs.com/png.latex?%5Cdot%7BI%7D%5Coverset%7B-%7D%7B=%7D%5Ckappa%20IF"> term, I’m going to go ahead and pick option 3, saying that these three interactions are all relatively independent of one another.</p>
<div class="callout callout-style-simple callout-warning no-icon callout-titled" title="Assumption made explicit">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon no-icon"></i>
</div>
<div class="callout-title-container flex-fill">
<span class="screen-reader-only">Warning</span>Assumption made explicit
</div>
</div>
<div class="callout-body-container callout-body">
<p>We don’t <em>have to</em> group together all contributions with the same monomial form. In fact only do so when we want to suggest that these contributions arise from the same interaction or process or physical phenomenon or …</p>
</div>
</div>
<p>At this point, it might seem like what we’re doing is entirely the <em>opposite</em> of building some flexible model that will be useful for collaboration. We keep having to lock in assumptions and make choices and commit to them, and we’re not allowed any wriggle room. But this isn’t true.</p>
<p>Right now we’re building a single diagram (or a single model, if you like), and we’re (somewhat secretly) using category theory to do so: there are boxes and arrows between them. But category theory also lets us step back, zoom out, and do all the same tricks one dimension higher. What that means here is that we can think of this diagram itself as an object, and then ask what a morphism between such objects should be. For example, a morphism between diagrams could consists of an assignment of variable boxes (the green ones) to variable boxes, and <em>collections/sequences of</em> interaction boxes (the blue ones) to interaction boxes. This post is not the place to spell out the details, but we can give an example of this example: there should be a morphism from option 3 to option 2, given by “gluing together” interactions 3b and 3c into the single interaction 2b.</p>
<div class="cell" data-layout-align="center">
<div class="cell-output-display">
<div>
<p></p><figure class="figure"><p></p>
<div>
<pre class="mermaid mermaid-js">flowchart LR
  subgraph source
    direction LR
    I1("`**I**nfected cells`")
    V1("`**V**irus`")
    F1("`Inter**f**erons`")
    X1{{3a}}
    Y1[3b]
    Z1[3c]
    I1 --&gt;|𝛿| X1
    I1 -.-&gt; Y1
    I1 -.-&gt; Z1
    Y1 --&gt;|𝑝| F1
    Z1 --&gt;|𝑞| V1
  end
  subgraph target
    direction LR
    V2("`**V**irus`")
    I2("`**I**nfected cells`")
    F2("`Inter**f**erons`")
    X2{{2a}}
    Y2[2b]
    I2 --&gt;|𝛿| X2
    I2 -.-&gt; Y2
    Y2 --&gt;|𝑝| F2
    Y2 --&gt;|𝑞| V2
  end
  source --&gt;|morphism| target
  classDef transition fill:#53b6b2
  classDef death fill:#ddd,color:#555
  class X1 death
  class Y1 transition
  class Z1 transition
  class X2 death
  class Y2 transition
  classDef box fill:#fff,stroke:#555
  class source box
  class target box
</pre>
</div>
<p></p></figure><p></p>
</div>
</div>
</div>
<div class="callout callout-style-simple callout-none no-icon callout-titled" title="Future topics">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon no-icon"></i>
</div>
<div class="callout-title-container flex-fill">
<span class="screen-reader-only">None</span>Future topics
</div>
</div>
<div class="callout-body-container callout-body">
<p>By studying the <em>category</em> (as opposed to the mere <em>set</em>) of these categorical objects, we gain the ability to express how different assumptions relate to one another.</p>
</div>
</div>
</section>
<section id="the-importance-of-brackets" class="level3" data-number="2.2.4">
<h3 data-number="2.2.4" data-anchor-id="the-importance-of-brackets"><span class="header-section-number">2.2.4</span> The importance of brackets</h3>
<p>This post is getting quite long, so here I’m just going to point out a problem for us to revisit in the future.</p>
<p>When solving ODEs, we are allowed to factor and expand out brackets as much as we want. Of course, mathematics say we can! For example, consider the two ODEs below: <img src="https://latex.codecogs.com/png.latex?%0A%20%20%5Cdot%7BB%7D%20=%20m_1V(1-B)%0A%20%20%5Ctag%7B$%5Cdagger$%7D%0A"> <img src="https://latex.codecogs.com/png.latex?%0A%20%20%5Cdot%7BB%7D%20=%20m_1V%20-%20m_1VB%0A%20%20%5Ctag%7B$%5Cddagger$%7D%0A"> Of course, by simply expanding out the right-hand side of (<img src="https://latex.codecogs.com/png.latex?%5Cdagger">), or factoring the right-hand side of (<img src="https://latex.codecogs.com/png.latex?%5Cddagger">), we can see that these equations are identical in terms of their solutions. But the key phrase is “<em>in terms of their solutions</em>”. Looking back at the original system of ODEs, note that there are many terms that could be factored but which have <em>not</em> been factored, e.g.&nbsp;in the equation for <img src="https://latex.codecogs.com/png.latex?%5Cdot%7BV%7D"> we have <img src="https://latex.codecogs.com/png.latex?cV+%5Cmu%20VA"> instead of <img src="https://latex.codecogs.com/png.latex?V(c+%5Cmu%20A)">, so why specifically write <img src="https://latex.codecogs.com/png.latex?%5Cdot%7BB%7D%5Coverset%7B+%7D%7B=%7Dm_1V(1-B)">? Well, let’s consider how we would draw diagrams for (<img src="https://latex.codecogs.com/png.latex?%5Cdagger">) and (<img src="https://latex.codecogs.com/png.latex?%5Cddagger">).</p>
<div class="cell" data-layout-align="center">
<div class="cell-output-display">
<div>
<p></p><figure class="figure"><p></p>
<div>
<pre class="mermaid mermaid-js">flowchart TB
  subgraph dagger ["Diagram&amp;nbsp;(†)"]
    direction LR
    V("`**V**irus`")
    B("`**B**-cells`")
    X[X]
    V -.-&gt; X
    X --&gt;|"𝑚₁(1-𝐵)"| B
  end
  classDef transition fill:#53b6b2
  class X transition
  classDef box fill:#fff,stroke:#555
  class dagger box
</pre>
</div>
<p></p></figure><p></p>
</div>
</div>
</div>
<div class="cell" data-layout-align="center">
<div class="cell-output-display">
<div>
<p></p><figure class="figure"><p></p>
<div>
<pre class="mermaid mermaid-js">flowchart TB
  subgraph ddagger ["Diagram (‡)"]
    direction LR
    V("`**V**irus`")
    B("`**B**-cells`")
    X[X]
    Y[Y]
    V -.-&gt; X
    X --&gt;|𝑚₁| B
    V -.-&gt; Y
    B --&gt;|𝑚₁| Y
  end
  classDef transition fill:#53b6b2
  class X transition
  class Y transition
  classDef box fill:#fff,stroke:#555
  class ddagger box
</pre>
</div>
<p></p></figure><p></p>
</div>
</div>
</div>
<p>We can now see that there is a different problem with each of these diagrams:</p>
<ol type="1">
<li><p>In Diagram&nbsp;(†) we are cheating the mathematics.</p>
<p>We label an arrow with <img src="https://latex.codecogs.com/png.latex?m_1(1-B)">, which is not a fixed real-valued parameter but rather a time-varying parameter that depends on the state variable <img src="https://latex.codecogs.com/png.latex?B">. This means that our formal mathematical story is no longer honest and our diagrams return to being mere pictures on a page.</p></li>
<li><p>In Diagram (‡) we are misconstruing the original system of ODEs.</p>
<p>It makes sense to read the single term contribution <img src="https://latex.codecogs.com/png.latex?%5Cdot%7BB%7D%5Coverset%7B+%7D%7B=%7Dm_1V(1-B)"> as saying that <img src="https://latex.codecogs.com/png.latex?B"> grows relative to <img src="https://latex.codecogs.com/png.latex?V"> with factor <img src="https://latex.codecogs.com/png.latex?m_1"> <em>but in a self-regulating way</em> that slowly turns off this process as <img src="https://latex.codecogs.com/png.latex?B"> grows from <img src="https://latex.codecogs.com/png.latex?0"> to <img src="https://latex.codecogs.com/png.latex?1">. But in the diagram there are two <em>separate</em> processes, and it doesn’t suggest that one is modulating the other, merely that they might happen to cancel out.</p></li>
</ol>
<p>The first problem is semi-fixable, but I definitely cannot claim to have a complete answer. It’s relatively straightforward to allow for a more expressive labelling of the arrows, but this problem of state variables themselves appearing in the parameters requires more thought.</p>
<div class="callout callout-style-simple callout-none no-icon callout-titled" title="Future topics">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon no-icon"></i>
</div>
<div class="callout-title-container flex-fill">
<span class="screen-reader-only">None</span>Future topics
</div>
</div>
<div class="callout-body-container callout-body">
<p>Using the theory of graded categories, we can allow for more complex labels on the arrows. Through a sort of <a href="../../blog/2025-11-07-dots-from-double-theories">DOTS</a> approach to migrations of theories, we could allow different parts of the diagram to follow different labelling rules. Finally, by machine composition, we can substitute parameters for (functions of) state variables.</p>
</div>
</div>
<p>The second problem is a bit more amenable to the tools in our current toolkit. What we are noticing is the following:</p>
<div class="callout callout-style-simple callout-warning no-icon callout-titled" title="Assumption made explicit">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon no-icon"></i>
</div>
<div class="callout-title-container flex-fill">
<span class="screen-reader-only">Warning</span>Assumption made explicit
</div>
</div>
<div class="callout-body-container callout-body">
<p>“Interactions in the diagrams” and “monomials in the system of ODEs” are in a one-to-one correspondence.</p>
</div>
</div>
<p>We could consider trying to change our made-up rules to amend this, but we have another option. Imagine taking the diagram and drawing a box around the two interactions:</p>
<div class="cell" data-layout-align="center">
<div class="cell-output-display">
<div>
<p></p><figure class="figure"><p></p>
<div>
<pre class="mermaid mermaid-js">flowchart LR
  V("`**V**irus`")
  subgraph boxed ["V–B interaction"]
    X[X]
    Y[Y]
  end
  B("`**B**-cells`")
  V -.-&gt; X
  X --&gt;|𝑚₁| B
  V -.-&gt; Y
  B --&gt;|𝑚₁| Y
  classDef transition fill:#53b6b2
  class X transition
  class Y transition
  classDef box fill:#fff,stroke:#555
  class boxed box
</pre>
</div>
<p></p></figure><p></p>
</div>
</div>
</div>
<p>Now we take that box and close the lid, black-boxing what’s inside of it, and just labelling it with a big “V–B interaction” sticker:</p>
<div class="cell" data-layout-align="center">
<div class="cell-output-display">
<div>
<p></p><figure class="figure"><p></p>
<div>
<pre class="mermaid mermaid-js">flowchart LR
  V("`**V**irus`")
  T["V–B interaction"]
  B("`**B**-cells`")
  V -.-&gt; T
  T --&gt; B
  B --&gt; T
  classDef boxed-transition fill:#53b6b2
  class T boxed-transition
</pre>
</div>
<p></p></figure><p></p>
</div>
</div>
</div>
<p>As for what this means mathematically — how we update the rules to our formalism — this is again a story that deserves a bit more time to be properly told. Note that we also need to figure out how to label the arrows between the interaction box and <img src="https://latex.codecogs.com/png.latex?B">, since if we just label them both with <img src="https://latex.codecogs.com/png.latex?m_1"> then we won’t recover the correct equations.</p>
<div class="callout callout-style-simple callout-none no-icon callout-titled" title="Future topics">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon no-icon"></i>
</div>
<div class="callout-title-container flex-fill">
<span class="screen-reader-only">None</span>Future topics
</div>
</div>
<div class="callout-body-container callout-body">
<p>We can black-box (and un-black-box) parts of a model in a compositional (or “decompositional”) way.</p>
</div>
</div>
<p>To wrap up this current blog post we’re just going to cheat a bit, doing the same trick as in Diagram&nbsp;(†).</p>
</section>
<section id="our-final-diagram" class="level3" data-number="2.2.5">
<h3 data-number="2.2.5" data-anchor-id="our-final-diagram"><span class="header-section-number">2.2.5</span> Our final diagram</h3>
<p>We’ve pointed out essentially all of the complications and considerations of drawing a diagram for this specific system of ODEs. We should really talk more about the growth term <img src="https://latex.codecogs.com/png.latex?gT(1-(T+1)/C_T)"> for <img src="https://latex.codecogs.com/png.latex?T">, but it’s somewhat related to the problems of the <img src="https://latex.codecogs.com/png.latex?m_1V(1-B)"> term we just discussed, so I’m going to just mark both of them with a ⚠️ symbol for now.</p>
<p>All in all, we can write everything down in one big diagram:</p>
<div class="cell" data-layout-align="center">
<div class="cell-output-display">
<div>
<p></p><figure class="figure"><p></p>
<div>
<pre class="mermaid mermaid-js">flowchart TB
  T("`**T**arget cells`")
  V("`**V**irus`")
  I("`**I**nfected cells`")
  F("`Inter**f**erons`")
  A("`**A**ntibodies`")
  B("`**B**-cells`")
  X0[⚠️ target-cell growth ⚠️]
  X1[infection]
  X2{{interferon interference}}
  X3[virus production]
  X4[interferon production]
  Z3{{F death}}
  Y1[B-cell activation]
  Y2[antibody response]
  Y3[antibody-virion binding]
  Z1{{V death}}
  Z2{{I death}}
  Z4{{A death}}
  Z5{{B death}}
  T --&gt; X0
  I --&gt; X0
  X0 --&gt; T
  T --&gt;|𝛽'| X1
  V --&gt;|𝛽| X1
  X1 --&gt;|𝛽'| I
  I --&gt;|𝜅| X2
  F -.-&gt; X2
  I -.-&gt; X3
  X3 --&gt;|𝑝| V
  I -.-&gt; X4
  X4 --&gt;|𝑞| F
  V -.-&gt; Y1
  Y1 --&gt;|"⚠️ 𝑚₁(1-𝐵) ⚠️"| B
  B -.-&gt; Y2
  Y2 --&gt;|𝑚₃| A
  V --&gt;|𝜇| Y3
  A --&gt;|𝜇'| Y3
  V --&gt;|𝑐| Z1
  I --&gt;|𝛿| Z2
  F --&gt;|𝑑| Z3
  A --&gt;|𝑟| Z4
  B --&gt;|𝑚₂| Z5
  classDef transition fill:#53b6b2
  classDef death fill:#ddd,color:#555
  class X0 transition
  class X1 transition
  class X2 death
  class X3 transition
  class X4 transition
  class Y1 transition
  class Y2 transition
  class Y3 transition
  class Z1 death
  class Z2 death
  class Z3 death
  class Z4 death
  class Z5 death
</pre>
</div>
<p></p></figure><p></p>
</div>
</div>
</div>
<p><em>… so why does this blog post have a sequel?</em></p>
</section>
</section>
</section>
<section id="problems" class="level1" data-number="3">
<h1 data-number="3"><span class="header-section-number">3</span> Problems</h1>
<p>Writing this blog post took a very long time, and part of the reason for that is <em>how many mistakes I kept on making</em>. The diagrams here are written in <a href="https://mermaid.js.org">Mermaid</a>, which I typed by hand. I’ve included the code for the final diagram below, so you can see what it looks like.</p>
<div class="callout callout-style-simple callout-none no-icon callout-titled" title="Mermaid code ⬇︎ (click to expand)">
<div class="callout-header d-flex align-content-center collapsed" data-bs-toggle="collapse" data-bs-target=".callout-10-contents" aria-controls="callout-10" aria-expanded="false" aria-label="Toggle callout">
<div class="callout-icon-container">
<i class="callout-icon no-icon"></i>
</div>
<div class="callout-title-container flex-fill">
<span class="screen-reader-only">None</span>Mermaid code ⬇︎ (click to expand)
</div>
<div class="callout-btn-toggle d-inline-block border-0 py-1 ps-1 pe-0 float-end"><i class="callout-toggle"></i></div>
</div>
<div id="callout-10" class="callout-10-contents callout-collapse collapse">
<div class="callout-body-container callout-body">
<pre><code>flowchart TB
  T("`**T**arget cells`")
  V("`**V**irus`")
  I("`**I**nfected cells`")
  F("`Inter**f**erons`")
  A("`**A**ntibodies`")
  B("`**B**-cells`")
  X0[⚠️ target-cell growth ⚠️]
  X1[infection]
  X2{{interferon interference}}
  X3[virus production]
  X4[interferon production]
  Z3{{F death}}
  Y1[B-cell activation]
  Y2[antibody response]
  Y3[antibody-virion binding]
  Z1{{V death}}
  Z2{{I death}}
  Z4{{A death}}
  Z5{{B death}}
  T --&gt; X0
  I --&gt; X0
  X0 --&gt; T
  T --&gt;|𝛽'| X1
  V --&gt;|𝛽| X1
  X1 --&gt;|𝛽'| I
  I --&gt;|𝜅| X2
  F -.-&gt; X2
  I -.-&gt; X3
  X3 --&gt;|𝑝| V
  I -.-&gt; X4
  X4 --&gt;|𝑞| F
  V -.-&gt; Y1
  Y1 --&gt;|"⚠️ 𝑚₁(1-𝐵) ⚠️"| B
  B -.-&gt; Y2
  Y2 --&gt;|𝑚₃| A
  V --&gt;|𝜇| Y3
  A --&gt;|𝜇'| Y3
  V --&gt;|𝑐| Z1
  I --&gt;|𝛿| Z2
  F --&gt;|𝑑| Z3
  A --&gt;|𝑟| Z4
  B --&gt;|𝑚₂| Z5
  classDef transition fill:#53b6b2
  classDef death fill:#ddd,color:#555
  class X0 transition
  class X1 transition
  class X2 death
  class X3 transition
  class X4 transition
  class Y1 transition
  class Y2 transition
  class Y3 transition
  class Z1 death
  class Z2 death
  class Z3 death
  class Z4 death
  class Z5 death</code></pre>
</div>
</div>
</div>
<p>The mistakes I kept on making in writing this post were essentially all of the following form:</p>
<ul>
<li>I write down the equations generated by a part of the diagram and then realise that I’ve drawn an arrow between the wrong boxes, or in the wrong direction, or gotten two parameter labels swapped around, or …</li>
<li>I count the number of interaction boxes and the number of monomial terms and see they don’t match up, and realise that I’ve missed a term</li>
<li>I realise that I’ve just made a typo and this has lead to two things being swapped around, or a box called “inteferon” being created alongside one called “interferon”</li>
<li>I make some mistake in the Mermaid code that means it won’t render</li>
</ul>
<p>Since I was trying to recover a specific system of ODEs, my constant test was “take the diagram, turn it back into equations, and compare it to the original”. This helped me spot the above mistakes, but is <em>itself</em> vulnerable to a meta-mistake (which I also made many times), namely:</p>
<div class="callout callout-style-simple callout-none no-icon callout-titled" title="The meta-mistake">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon no-icon"></i>
</div>
<div class="callout-title-container flex-fill">
<span class="screen-reader-only">None</span>The meta-mistake
</div>
</div>
<div class="callout-body-container callout-body">
<p><em>I often make errors in the process of turning the diagram into equations.</em></p>
</div>
</div>
<p>Fixing this last problem would dramatically improve my ability to fix all the other problems, and this is precisely the type of problem that sounds like something computers should be good at doing. In fact, I think that <em>all</em> of the types of problems that I’ve pointed out here are things that computers are good at helping us to avoid. Some of the simpler problems (mistakes in the Mermaid code, and typos in names of boxes) are solved by using a <a href="https://en.wikipedia.org/wiki/Structure_editor"><em>structure editor</em></a> rather than a text editor.</p>
<p>Hey, what do you know — <a href="https://catcolab.org/">CatColab</a> is a structure editor! But although it has an analysis for mass-action dynamics for Petri nets (and what we’ve been drawing are essentially Petri nets), it doesn’t support this variation where we give different rate coefficients for each input and output place of each transition; in CatColab, you can only give a rate coefficient for each transition.</p>
<p>However, the CatColab codebase is now mature and modular enough that this is not a problem. After some conversation with <a href="../../people/evan-patterson">Evan</a> and <a href="../../people/jason-brown">Jason</a>, I spent a week implementing this feature so that I could repeat the above model-building exercise directly in CatColab. In <a href="../../blog/2026-04-18-extending-mass-action-semantics-2">the sequel</a> to this blog post, I’m going to talk a bit about the actual development process, the changes we had to make, and how things now look in CatColab.</p>



</section>

<script defer="" src="https://comments.topos.institute/comentario.js"></script>

<div id="quarto-appendix" class="default"><section class="quarto-appendix-contents" id="quarto-bibliography"><h2 class="anchored quarto-appendix-heading">References</h2><div id="refs" class="references csl-bib-body hanging-indent" data-entry-spacing="0">
<div id="ref-BP2017" class="csl-entry">
Baez, John C., and Blake S. Pollard. 2017. <span>“A Compositional Framework for Reaction Networks.”</span> <em>Rev. Math. Phys.</em> 29. <a href="https://doi.org/10.1142/S0129055X17500283">https://doi.org/10.1142/S0129055X17500283</a>.
</div>
<div id="ref-HLIHHZF" class="csl-entry">
Hoyer-Leitzel, A., S. M. Iams, A. J. Haslam-Hype, M. L. Zeeman, and N. H. Fefferman. 2023. <span>“An Immuno-Epidemiological Model for Transient Immune Protection: A Case Study for Viral Respiratory Infections.”</span> <em>Infectious Disease Modelling</em> 8: 855–64. <a href="https://doi.org/10.1016/j.idm.2023.07.004">https://doi.org/10.1016/j.idm.2023.07.004</a>.
</div>
</div></section></div> ]]></description>
  <category>CatColab</category>
  <category>modeling</category>
  <guid>https://topos.institute/blog/2026-03-16-extending-mass-action-semantics-1/</guid>
  <pubDate>Mon, 16 Mar 2026 00:00:00 GMT</pubDate>
</item>
<item>
  <title>Blog / Composition of attractor lattices</title>
  <dc:creator>Tony Wehbe</dc:creator>
  <link>https://topos.institute/blog/2026-01-30-composition-of-attractor-lattices/</link>
  <description><![CDATA[ 





<section id="motivation" class="level1" data-number="1">
<h1 data-number="1"><span class="header-section-number">1</span> Motivation</h1>
<p>Order shows up everywhere in our daily lives — in how we arrange objects, make decisions, or observe patterns. Mathematically, order is expressed as a relation on a set of objects, and I am particularly fascinated by how order reveals itself in the study of dynamical systems.</p>
<p>A dynamical system describes how a system evolves over time. Dynamical systems theory uses invariant sets to understand the system’s long-term behavior—patterns that persist as time goes on. A cornerstone of this perspective is Conley’s fundamental decomposition theorem, which shows that the global asymptotic dynamics of any system can be described entirely in terms of its attractors. This perspective leads to a beautiful algebraic insight: the collection of all attractors in a system naturally forms a bounded distributive lattice. Before defining attractors and exploring this lattice structure, we first need to set the stage by introducing what do we mean by a dynamical system.</p>
</section>
<section id="attractors-in-dynamical-systems" class="level1" data-number="2">
<h1 data-number="2"><span class="header-section-number">2</span> Attractors in dynamical systems</h1>
<p>We begin by recalling the definition of a dynamical system. A <em>dynamical system</em> on topological space <img src="https://latex.codecogs.com/png.latex?X"> is a continuous map <img src="https://latex.codecogs.com/png.latex?%5Cphi%20:%20%5Cmathbb%7BT%7D%20%5Ctimes%20X%20%5Cto%20X"> that satisfies</p>
<ol type="1">
<li><p><img src="https://latex.codecogs.com/png.latex?%5Cphi(0,x)%20=%20x"> for all <img src="https://latex.codecogs.com/png.latex?x%20%5Cin%20X">,</p></li>
<li><p><img src="https://latex.codecogs.com/png.latex?%5Cphi(t,%5Cphi(s,x))%20=%20%5Cphi(t+s,x)"> for all <img src="https://latex.codecogs.com/png.latex?s,t%20%5Cin%20%5Cmathbb%7BT%7D"> and <img src="https://latex.codecogs.com/png.latex?x%20%5Cin%20X">,</p></li>
</ol>
<p>where <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BT%7D"> is the time domain, either <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BZ%7D"> or <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BR%7D">. Next, we recall the definition of attractors and show how they form a bounded distributive lattice. We then illustrate this with a concrete example.</p>
<p>Let <img src="https://latex.codecogs.com/png.latex?X"> be a compact Hausdorff space. For a point <img src="https://latex.codecogs.com/png.latex?x%20%5Cin%20X">, the <em>orbit</em> of <img src="https://latex.codecogs.com/png.latex?x"> describes how the system evolves in time starting from <img src="https://latex.codecogs.com/png.latex?x"> is <img src="https://latex.codecogs.com/png.latex?%5Cgamma_x(t)%20:=%20%5Cphi(t,x),%20%5Ctext%7Bwhere%20%7D%20t%20%5Cin%20%5Cmathbb%7BT%7D."> In applications, differential equations yield examples of dynamical systems with continuous time <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BT%7D%20=%20%5Cmathbb%7BR%7D">. These continuous-time dynamical systems are called flows. We illustrate this correspondence with an example later on. Throughout this post, we focus on continuous-time dynamical systems, though many results extend to discrete-time systems. A subset <img src="https://latex.codecogs.com/png.latex?S%20%5Csubseteq%20X"> is called <em>invariant</em> if it contains its whole orbit. Formally, <img src="https://latex.codecogs.com/png.latex?S"> is invariant if <img src="https://latex.codecogs.com/png.latex?%5Cbigcup_%7Bt%20%5Cin%20%5Cmathbb%7BR%7D%7D%20%5Cphi(t,S)%20=%20S%20."> The collection of all invariant sets of <img src="https://latex.codecogs.com/png.latex?%5Cphi"> is denoted by <img src="https://latex.codecogs.com/png.latex?%5Ctext%7BInvset%7D(%5Cphi)">. Given a set <img src="https://latex.codecogs.com/png.latex?U%20%5Csubseteq%20X">, the <em>maximal invariant set in <img src="https://latex.codecogs.com/png.latex?U"></em> is the union of all of the invariant sets that it contains. Formally, <img src="https://latex.codecogs.com/png.latex?%5Coperatorname%7BInv%7D_%5Cphi(U)%20:=%20%5Cbigcup_%7BS%20%5Csubseteq%20U%20%5Cmid%20S%20%5Cin%20%5Ctext%7BInvset%7D(%5Cphi)%20%7D%20S."> A subset <img src="https://latex.codecogs.com/png.latex?U%20%5Csubseteq%20X"> is called an <em>attracting neighborhood</em> if eventually the orbit of every state in the closure of <img src="https://latex.codecogs.com/png.latex?U"> ends up in its interior. In other words, if there exists <img src="https://latex.codecogs.com/png.latex?%5Ctau%20%3E%200"> such that for all <img src="https://latex.codecogs.com/png.latex?t%20%5Cgeq%20%5Ctau"> <img src="https://latex.codecogs.com/png.latex?%5Cphi(t,%20%5Coperatorname%7Bcl%7D(U))%20%5Csubseteq%20%5Coperatorname%7Bint%7D(U)."> Now, <img src="https://latex.codecogs.com/png.latex?A%20%5Csubseteq%20X"> is an <em>attractor</em> if it is the maximal invariant set of an attracting neighborhood. Formally, <img src="https://latex.codecogs.com/png.latex?A"> is an attractor if there exists a compact <img src="https://latex.codecogs.com/png.latex?U%20%5Csubseteq%20X"> such that <img src="https://latex.codecogs.com/png.latex?A%20=%20%5Coperatorname%7BInv%7D_%5Cphi(U)."> The collection of all attractors of a dynamical system, denoted <img src="https://latex.codecogs.com/png.latex?%7B%5Cmathsf%7BAtt%7D%7D(%5Cphi)">, forms a bounded, distributive lattice with order given by subset inclusion, see <span class="citation" data-cites="Kalies2014">[@Kalies2014]</span>. The lattice operations are given by <img src="https://latex.codecogs.com/png.latex?A%20%5Cvee%20B%20:=%20A%20%5Ccup%20B,%0A%5Cqquad%0AA%20%5Cwedge%20B%20:=%20%5Coperatorname%7BInv%7D_%5Cphi(A%20%5Ccap%20B)."></p>
<section id="example-the-flow-dotx-x---x3" class="level2" data-number="2.1">
<h2 data-number="2.1" data-anchor-id="example-the-flow-dotx-x---x3"><span class="header-section-number">2.1</span> Example: The flow <img src="https://latex.codecogs.com/png.latex?%5Cdot%7Bx%7D%20=%20x%20-%20x%5E3"></h2>
<p>Consider the flow on <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BR%7D"> generated by <img src="https://latex.codecogs.com/png.latex?%5Cdot%20x%20=%20x%20-%20x%5E3">. Its phase portrait is shown in Figure&nbsp;1.</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><a href="figure-1.png" class="lightbox" data-gallery="quarto-lightbox-gallery-1" title="Figure 1. Phase space for the system \dot{x}=x-x^3. The systems has attracting equilibria at x=-1 and x=1, and a repelling equilibrium at x=0. The vectors indicate the direction of the flow."><img src="https://topos.institute/blog/2026-01-30-composition-of-attractor-lattices/figure-1.png" class="img-fluid figure-img" width="500" alt="Figure 1. Phase space for the system \dot{x}=x-x^3. The systems has attracting equilibria at x=-1 and x=1, and a repelling equilibrium at x=0. The vectors indicate the direction of the flow."></a></p>
<figcaption><em>Figure 1.</em> Phase space for the system <img src="https://latex.codecogs.com/png.latex?%5Cdot%7Bx%7D=x-x%5E3">. The systems has attracting equilibria at <img src="https://latex.codecogs.com/png.latex?x=-1"> and <img src="https://latex.codecogs.com/png.latex?x=1">, and a repelling equilibrium at <img src="https://latex.codecogs.com/png.latex?x=0">. The vectors indicate the direction of the flow.</figcaption>
</figure>
</div>
<p>Consider the following maximal invariant sets: <img src="https://latex.codecogs.com/png.latex?%5C%7B0%5C%7D%20=%20%5Crm%7BInv%7D(%5B-0.1,0.1%5D),%20%5Cquad%0A%5C%7B-1%5C%7D%20=%20%5Crm%7BInv%7D(%5B-1.1,-0.9%5D),%20%5Cquad%0A%5C%7B1%5C%7D%20=%20%5Crm%7BInv%7D(%5B0.9,1.1%5D),"> <img src="https://latex.codecogs.com/png.latex?%5B-1,0%5D%20=%20%5Crm%7BInv%7D(%5B-1.1,0.1%5D),%20%5Cquad%0A%5B0,1%5D%20=%20%5Crm%7BInv%7D(%5B-0.1,1.1%5D),%20%5Cquad%0A%5B-1,1%5D%20=%20%5Crm%7BInv%7D(%5B-1.1,1.1%5D)."> Since the compact neighborhoods <img src="https://latex.codecogs.com/png.latex?%5B-1.1,-0.9%5D,%20%5Cquad%20%5B0.9,1.1%5D,%20%5Cquad%20%5B-1.1,-0.9%5D%5Ccup%5B0.9,1.1%5D,%20%5Cquad%20%5B-1.1,1.1%5D"> are attracting neighborhoods the following sets are attractors. <img src="https://latex.codecogs.com/png.latex?%5C%7B-1%5C%7D,%20%5Cquad%20%5C%7B1%5C%7D,%20%5Cquad%20%5C%7B-1,1%5C%7D,%20%5Cquad%20%5B-1,1%5D."> As in any dynamical system, the empty set <img src="https://latex.codecogs.com/png.latex?%5Cvarnothing"> is always an attractor and a bottom element of the attractor lattice, ordered by inclusion. Thus, the attractor lattice for this system is shown in Figure&nbsp;2.</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><a href="figure-2.png" class="lightbox" data-gallery="quarto-lightbox-gallery-2" title="Figure 2. The attractor lattice of the system \dot{x}=x-x^3."><img src="https://topos.institute/blog/2026-01-30-composition-of-attractor-lattices/figure-2.png" class="img-fluid figure-img" width="200" alt="Figure 2. The attractor lattice of the system \dot{x}=x-x^3."></a></p>
<figcaption><em>Figure 2</em>. The attractor lattice of the system <img src="https://latex.codecogs.com/png.latex?%5Cdot%7Bx%7D=x-x%5E3">.</figcaption>
</figure>
</div>
<p>Even though <img src="https://latex.codecogs.com/png.latex?%5B-1,0%5D"> and <img src="https://latex.codecogs.com/png.latex?%5B0,1%5D"> are maximal invariant sets they <em>not</em> attractors. Note that <img src="https://latex.codecogs.com/png.latex?%5B-1.1,0.1%5D"> and <img src="https://latex.codecogs.com/png.latex?%5B-0.1,1.1%5D"> are compact neighborhoods but they are not attracting. This one-dimensional system illustrates attractors and their lattice structure.</p>
</section>
</section>
<section id="attractor-lattices-in-decoupled-product-systems" class="level1" data-number="3">
<h1 data-number="3"><span class="header-section-number">3</span> Attractor lattices in decoupled product systems</h1>
<p>Let <img src="https://latex.codecogs.com/png.latex?%5Cphi_1%5Ccolon%20%5Cmathbb%7BT%7D%5Ctimes%20X_1%5Cto%20X_1"> and <img src="https://latex.codecogs.com/png.latex?%5Cphi_2%5Ccolon%20%5Cmathbb%7BT%7D%5Ctimes%20X_2%5Cto%20X_2"> be two dynamical systems on compact, Hausdorff spaces. The <em>product system</em> <img src="https://latex.codecogs.com/png.latex?%5CPhi%5Ccolon%20%5Cmathbb%7BT%7D%5Ctimes%20(X_1%5Ctimes%20X_2)%5Cto%20X_1%5Ctimes%20X_2"> is defined by <img src="https://latex.codecogs.com/png.latex?%5CPhi((x,y),t)=(%5Cphi_1(x,t),%5Cphi_2(y,t))">.</p>
<section id="decoupled-case-mathsfatt_phi-vs.-mathsfatt_phi_1-times-mathsfatt_phi_2" class="level2" data-number="3.1">
<h2 data-number="3.1" data-anchor-id="decoupled-case-mathsfatt_phi-vs.-mathsfatt_phi_1-times-mathsfatt_phi_2"><span class="header-section-number">3.1</span> Decoupled case: <img src="https://latex.codecogs.com/png.latex?%7B%5Cmathsf%7BAtt%7D%7D_%7B%5CPhi%7D"> vs.&nbsp;<img src="https://latex.codecogs.com/png.latex?%7B%5Cmathsf%7BAtt%7D%7D_%7B%5Cphi_1%7D%20%5Ctimes%20%7B%5Cmathsf%7BAtt%7D%7D_%7B%5Cphi_2%7D"></h2>
<p>To study the relationship between the attractor lattice of a product system and the attractor lattices of its components, we begin with the following decoupled system <img src="https://latex.codecogs.com/png.latex?%5Cdot%20x_1%20=%20x_1%20-%20x_1%5E3,%0A%5Cqquad%0A%5Cdot%20x_2%20=%20-x_2."></p>
<p>Their attractor lattices are shown in Figure&nbsp;3.</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><a href="figure-3.png" class="lightbox" data-gallery="quarto-lightbox-gallery-3" title="Figure 3. Attractor lattices of the individual systems."><img src="https://topos.institute/blog/2026-01-30-composition-of-attractor-lattices/figure-3.png" class="img-fluid figure-img" width="550" alt="Figure 3. Attractor lattices of the individual systems."></a></p>
<figcaption><em>Figure 3</em>. Attractor lattices of the individual systems.</figcaption>
</figure>
</div>
<p>A natural question is how the cartesian product <img src="https://latex.codecogs.com/png.latex?%7B%5Cmathsf%7BAtt%7D%7D_%7B%5Cphi_1%7D%20%5Ctimes%20%7B%5Cmathsf%7BAtt%7D%7D_%7B%5Cphi_2%7D"> compares to the attractor lattice <img src="https://latex.codecogs.com/png.latex?%7B%5Cmathsf%7BAtt%7D%7D_%7B%5CPhi%7D"> of the product system. The comparison is shown in Figure&nbsp;4.</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><a href="figure-4.png" class="lightbox" data-gallery="quarto-lightbox-gallery-4" title="Figure 4. Comparison between \mathsf{Att}_{\phi_1}\times\mathsf{Att}_{\phi_2} and \mathsf{Att}_\Phi."><img src="https://topos.institute/blog/2026-01-30-composition-of-attractor-lattices/figure-4.png" class="no-border img-fluid figure-img" alt="Figure 4. Comparison between \mathsf{Att}_{\phi_1}\times\mathsf{Att}_{\phi_2} and \mathsf{Att}_\Phi."></a></p>
<figcaption><em>Figure 4</em>. Comparison between <img src="https://latex.codecogs.com/png.latex?%5Cmathsf%7BAtt%7D_%7B%5Cphi_1%7D%5Ctimes%5Cmathsf%7BAtt%7D_%7B%5Cphi_2%7D"> and <img src="https://latex.codecogs.com/png.latex?%5Cmathsf%7BAtt%7D_%5CPhi">.</figcaption>
</figure>
</div>
<p>Notice that <img src="https://latex.codecogs.com/png.latex?%7B%5Cmathsf%7BAtt%7D%7D_%7B%5Cphi_1%7D%20%5Ctimes%20%7B%5Cmathsf%7BAtt%7D%7D_%7B%5Cphi_2%7D"> contains strictly more elements than <img src="https://latex.codecogs.com/png.latex?%7B%5Cmathsf%7BAtt%7D%7D_%7B%5CPhi%7D">. To connect the two lattices we just compared, it helps to introduce the idea of <em>realization maps</em>. Our goal is therefore to construct a suitable realization map that connects the two lattices. For instance, pairs involving the empty set such as <img src="https://latex.codecogs.com/png.latex?(%7B1%7D,%5Cvarnothing)"> or <img src="https://latex.codecogs.com/png.latex?(%5Cvarnothing,%7B0%7D)"> are both realized as the empty set in <img src="https://latex.codecogs.com/png.latex?%7B%5Cmathsf%7BAtt%7D%7D_%7B%5CPhi%7D">. On the other hand, pairs not involving the empty set are faithfully realized; for example, <img src="https://latex.codecogs.com/png.latex?(%5B-1,1%5D,%5C%7B0%5C%7D)%20%5C;%5Cmapsto%5C;%20%5B-1,1%5D%5Ctimes%5C%7B0%5C%7D."> This discrepancy motivates the introduction of the realization map <img src="https://latex.codecogs.com/png.latex?%5Chat%7B%5Crho%7D"> next. Given two attractors <img src="https://latex.codecogs.com/png.latex?A%20%5Cin%20%7B%5Cmathsf%7BAtt%7D%7D_%7B%5Cphi_1%7D"> and <img src="https://latex.codecogs.com/png.latex?B%20%5Cin%20%7B%5Cmathsf%7BAtt%7D%7D_%7B%5Cphi_2%7D">, we can form their Cartesian product <img src="https://latex.codecogs.com/png.latex?A%20%5Ctimes%20B">. This motivates the map <img src="https://latex.codecogs.com/png.latex?%5Crho:%5C%20%7B%5Cmathsf%7BAtt%7D%7D_%7B%5Cphi_1%7D%5Ctimes%7B%5Cmathsf%7BAtt%7D%7D_%7B%5Cphi_2%7D%20%5C;%5Clongrightarrow%5C;%20%7B%5Cmathsf%7BAtt%7D%7D_%7B%5CPhi%7D,%0A%5Cqquad%0A%5Crho(A,B)%20=%20A%20%5Ctimes%20B."></p>
<p>The map <img src="https://latex.codecogs.com/png.latex?%5Crho"> is a meet–semilattice homomorphism. However, it is not injective because of pairs that include the empty set. To fix this, we identify all such pairs using <img src="https://latex.codecogs.com/png.latex?%5Cker%7B%5Crho%7D">. After this identification, we obtain the induced map <img src="https://latex.codecogs.com/png.latex?%5Chat%7B%5Crho%7D:%5C%0A%7B(%7B%5Cmathsf%7BAtt%7D%7D_%7B%5Cphi_1%7D%5Ctimes%7B%5Cmathsf%7BAtt%7D%7D_%7B%5Cphi_2%7D)%7D%20/%7B%5Cker(%5Crho)%7D%0A%5C;%5Clongrightarrow%5C;%0A%7B%5Cmathsf%7BAtt%7D%7D_%7B%5CPhi%7D,%0A%5Cqquad%0A%5Chat%7B%5Crho%7D(A,B)%20=%20A%20%5Ctimes%20B,"> which is now injective.</p>
<p>One important result here is that this map is not always <em>surjective</em>. This means that there are emergent attractors in the product system that cannot be written as a direct product of attractors from the two subsystems. We will next look at an explicit example of this.</p>
</section>
<section id="corners-the-product-forgot" class="level2" data-number="3.2">
<h2 data-number="3.2" data-anchor-id="corners-the-product-forgot"><span class="header-section-number">3.2</span> Corners the product forgot</h2>
<p>To see why surjectivity fails, consider the following decoupled system <img src="https://latex.codecogs.com/png.latex?%5Cdot%7Bx_1%7D%20=%20x_1(1-x_1),%20%5Cqquad%20%5Cdot%7Bx_2%7D%20=%20x_2(1-x_2),"> with phase space <img src="https://latex.codecogs.com/png.latex?%5B0,1%5D%5Ctimes%5B0,1%5D">. Its phase portrait is shown in Figure&nbsp;5. Each subsystem has the attractors <img src="https://latex.codecogs.com/png.latex?%5Cvarnothing">, <img src="https://latex.codecogs.com/png.latex?%5C%7B1%5C%7D">, and <img src="https://latex.codecogs.com/png.latex?%5B0,1%5D">.</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><a href="figure-5.png" class="lightbox" data-gallery="quarto-lightbox-gallery-5" title="Figure 5. Phase space of \dot{x}_1=x_1(1-x_1), \dot{x}_2=x_2(1-x_2)."><img src="https://topos.institute/blog/2026-01-30-composition-of-attractor-lattices/figure-5.png" class="img-fluid figure-img" width="250" alt="Figure 5. Phase space of \dot{x}_1=x_1(1-x_1), \dot{x}_2=x_2(1-x_2)."></a></p>
<figcaption><em>Figure 5</em>. Phase space of <img src="https://latex.codecogs.com/png.latex?%5Cdot%7Bx%7D_1=x_1(1-x_1)">, <img src="https://latex.codecogs.com/png.latex?%5Cdot%7Bx%7D_2=x_2(1-x_2)">.</figcaption>
</figure>
</div>
<p>Now, the realization map <img src="https://latex.codecogs.com/png.latex?%5Chat%7B%5Crho%7D"> of this example is shown in Figure&nbsp;6.</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><a href="figure-6.png" class="lightbox" data-gallery="quarto-lightbox-gallery-6" title="Figure 6. Realization map from (\mathsf{Att}_{\phi_1}\times\mathsf{Att}_{\phi_2})/\mathrm{ker}(\rho) to \mathsf{Att}_\Phi. Note the presence of new “corner” attractor on the right which is not a result of any realization map."><img src="https://topos.institute/blog/2026-01-30-composition-of-attractor-lattices/figure-6.png" class="img-fluid figure-img" width="600" alt="Figure 6. Realization map from (\mathsf{Att}_{\phi_1}\times\mathsf{Att}_{\phi_2})/\mathrm{ker}(\rho) to \mathsf{Att}_\Phi. Note the presence of new “corner” attractor on the right which is not a result of any realization map."></a></p>
<figcaption><em>Figure 6</em>. Realization map from <img src="https://latex.codecogs.com/png.latex?(%5Cmathsf%7BAtt%7D_%7B%5Cphi_1%7D%5Ctimes%5Cmathsf%7BAtt%7D_%7B%5Cphi_2%7D)/%5Cmathrm%7Bker%7D(%5Crho)"> to <img src="https://latex.codecogs.com/png.latex?%5Cmathsf%7BAtt%7D_%5CPhi">. Note the presence of new “corner” attractor on the right which is not a result of any realization map.</figcaption>
</figure>
</div>
<p>However, the product system <img src="https://latex.codecogs.com/png.latex?%5CPhi"> admits additional attractors that do not arise as simple Cartesian products. In particular, there is a “corner” attractor <img src="https://latex.codecogs.com/png.latex?(%5B0,1%5D%20%5Ctimes%20%5C%7B1%5C%7D)%20%5Ccup%20(%5C%7B1%5C%7D%20%5Ctimes%20%5B0,1%5D)"> which is a result of the interaction of both systems. It belongs to <img src="https://latex.codecogs.com/png.latex?%7B%5Cmathsf%7BAtt%7D%7D_%7B%5CPhi%7D"> but is not in an image of <img src="https://latex.codecogs.com/png.latex?%5Chat%7B%5Crho%7D">. Interestingly, the missing attractor can be recovered algebraically: If we close the image of <img src="https://latex.codecogs.com/png.latex?%5Chat%7B%5Crho%7D"> under joins, we obtain the full lattice <img src="https://latex.codecogs.com/png.latex?%7B%5Cmathsf%7BAtt%7D%7D_%7B%5CPhi%7D"> in the continuous case. One of my projects was to investigate whether the following equivalence holds: <img src="https://latex.codecogs.com/png.latex?C%5E%7B%5Cvee%7D%5Cbig(%5Cmathrm%7BIm%7D(%5Chat%7B%5Crho%7D)%5Cbig)%20%5Ccong%20%7B%5Cmathsf%7BAtt%7D%7D_%7B%5CPhi%7D,"> where <img src="https://latex.codecogs.com/png.latex?C%5E%7B%5Cvee%7D"> denotes join-closure. However, for discrete maps, this remains only a sublattice of <img src="https://latex.codecogs.com/png.latex?%7B%5Cmathsf%7BAtt%7D%7D_%7B%5CPhi%7D">.</p>
<hr>
<p>This shows that while the map <img src="https://latex.codecogs.com/png.latex?%5Chat%7B%5Crho%7D"> provides a faithful embedding of the product of lattices into the combined system lattice, it does not capture all attractors of the product system in general: new attractors may appear that are not simple products.</p>
</section>
</section>
<section id="conclusion" class="level1" data-number="4">
<h1 data-number="4"><span class="header-section-number">4</span> Conclusion</h1>
<p>In this post, we studied how attractor lattices behave when combining systems. The decoupled case highlights both the algebraic structure that persists and the limitations of product constructions. Moving forward, the coupled setting requires richer tools: cascade products and, more generally, sheaf-theoretic frameworks offer a natural way to extend these ideas to more general dynamical interactions. This next question will be my focus for the next couple of months.</p>
<p>Lastly, I would like to thank Sophie for her guidance and the entire Topos team for making my time there fulfilling and deeply inspiring. I learned a lot from everyone and look forward to building on these ideas in the months ahead. I would also like to thank my advisor, Dr.&nbsp;William Kalies, for suggesting this project and for his guidance, ideas, and numerous discussions that were instrumental in shaping this draft.</p>


</section>

<script defer="" src="https://comments.topos.institute/comentario.js"></script>

 ]]></description>
  <guid>https://topos.institute/blog/2026-01-30-composition-of-attractor-lattices/</guid>
  <pubDate>Fri, 30 Jan 2026 00:00:00 GMT</pubDate>
  <media:content url="https://topos.institute/blog/2026-01-30-composition-of-attractor-lattices/figure-6.png" medium="image" type="image/png" height="67" width="144"/>
</item>
<item>
  <title>Blog / CatColab v0.4: Robin</title>
  <dc:creator>Tim Hosgood</dc:creator>
  <link>https://topos.institute/blog/2026-01-08-catcolab-0-4-robin/</link>
  <description><![CDATA[ 





<p>Continuing our theme of naming CatColab releases after increasingly larger (yet still very tiny) birds, we’ve recently released <strong>v0.4: Robin</strong>. There are quite a few new features to showcase: some big and some small, some visible and some hidden. For those interested in implementation details, you can view the non-curated list of <a href="https://github.com/ToposInstitute/CatColab/releases">release notes on GitHub</a>. Note that this blog post also talks about features from the previous release (v0.3) since we missed doing a blog post for that one — we were just over-excited adding features and polishing bits.</p>
<div class="small">
<p>CatColab is a collaborative environment for formal, interoperable, conceptual modeling. For an introduction to CatColab, visit the <a href="https://catcolab.org/help">help page</a>.</p>
</div>
<section id="new-features-and-updates" class="level2">
<h2 data-anchor-id="new-features-and-updates">New features and updates</h2>
<section id="petri-nets" class="level3">
<h3 data-anchor-id="petri-nets">Petri nets</h3>
<p>Petri nets are important and widely used graphical formalism for modeling processes that can consume and emit typed tokens, from concurrent computer systems to biochemical reaction networks. To quote from <a href="https://catcolab.org/help/logics/petri-net">catcolab.org/help/logics/petri-net</a>:</p>
<blockquote class="blockquote">
<p><strong>Petri nets</strong> were invented to express discrete-event dynamical systems with concurrency, or networks of resources and processes, describing how various states (called <strong>places</strong>) relate to one another in terms of <strong>transitions</strong>. Each transition has incoming and outgoing arrows (called <strong>arcs</strong>) connected to places, which describe the <strong>input</strong> and <strong>output</strong> places of the transition (respectively).</p>
<p>One way of understanding Petri nets is through their <strong>token semantics</strong>. We place a number of “tokens” in each place and then check all the transitions to see if all their input places have a token: if so, then we can “fire” the transition, moving the tokens from the input places to the output places; if not, then nothing happens. In many classical references the token semantics are built directly in to the definition of Petri nets (often called a <strong>marking</strong> or <strong>tokening</strong>), but an unmarked Petri net is already itself a useful formal gadget, analogous to how can be useful to consider an ordinary differential equation without giving its initial conditions.</p>
</blockquote>
<p>Quite a few category theorists have written about Petri nets; some of John Baez’s <a href="https://johncarlosbaez.wordpress.com/?s=petri">blog posts</a> give a pretty comprehensive overview. There is a plethora of literature concerning <strong>Petri nets</strong> in all their various flavours and guises, and it’s a non-trivial task to try to figure out where different sources actually agree or disagree. The version that we currently have implemented in CatColab is that of <em>free presentations of symmetric monoidal categories</em>, though you don’t need to actually care about this in order to be able to use them.</p>
<p>For an example, below is a screenshot (and a link to the CatColab notebook) of a Petri net describing the pathway by which a certain bacteria breaks glucose down into lactate, taken from an introductory book on systems biology.</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><a href="images/l-lactis-glycolysis-petri-net.png" class="lightbox" data-gallery="quarto-lightbox-gallery-1" title="A Petri net modelling the (partial) glycolysis pathway of Lactococcus lactis, taken from E.O. Voit’s Systems Biology: A Very Short Introduction (Oxford University Press, 2020). Model available directly on CatColab."><img src="https://topos.institute/blog/2026-01-08-catcolab-0-4-robin/images/l-lactis-glycolysis-petri-net.png" class="border img-fluid figure-img" alt="A Petri net modelling the (partial) glycolysis pathway of Lactococcus lactis, taken from E.O. Voit’s Systems Biology: A Very Short Introduction (Oxford University Press, 2020). Model available directly on CatColab."></a></p>
<figcaption>A Petri net modelling the (partial) glycolysis pathway of <em>Lactococcus lactis</em>, taken from E.O. Voit’s <em>Systems Biology: A Very Short Introduction</em> (Oxford University Press, 2020). Model available directly <a href="https://catcolab.org/model/019bb3e0-0cf3-7290-8ec8-2ee9e3b420a6/analysis/019bb3e2-1880-7fe3-8759-2172a8d074d4">on CatColab</a>.</figcaption>
</figure>
</div>
<p>With this new logic there come also three new analyses, thanks to some grand efforts:</p>
<ol type="1">
<li>ODE simulation based on population-level mass-action dynamics</li>
<li>Stochastic simulation based on individual-level mass-action dynamics (thanks to Matt Cuffaro!)</li>
<li>Model checking of sub-reachability from initial state (thanks to Kris Brown!)</li>
</ol>
<p>For full details, you can read the <a href="https://catcolab.org/help/logics/petri-net">Petri nets documentation</a>, but in brief the first analysis checks whether or not certain tokening states can be reached from a given initial state, and the second and third analysis simulate so-called mass-action dynamics, which envisions Petri nets as describing concentrations of quantities and the reactions that can take place between them. The third analysis, in particular, in particularly exciting, since it is the first instance of a <em>stochastic</em> analysis inside CatColab.</p>
</section>
<section id="compositional-models-of-discrete-theories" class="level3">
<h3 data-anchor-id="compositional-models-of-discrete-theories">Compositional models (of discrete theories)</h3>
<p>Something that we at Topos have been talking about for a while as a fundamental capability of a categorical approach to modelling (far from just in conversations about CatColab) is the ability to <em>compose</em> models. If somebody has made a model describing some system, which I then want to view as a component of my other system, I would like to able to <strong>instantiate</strong> it and use it within my model. This is now possible <em>for certain theories</em><sup>1</sup> in CatColab!</p>
<p>As a small example, we can create a causal loop diagram with two variables, one positive link, and one negative link: <img src="https://latex.codecogs.com/png.latex?%0A%5Cbegin%7Baligned%7D%0A%20%20%5Ctexttt%7BPrey%7D%20&amp;%5Cxrightarrow%7B%5Ctexttt%7Bfeeds%7D%7D%5E+%20%5Ctexttt%7BPredator%7D%0A%5C%5C%5Ctexttt%7BPredator%7D%20&amp;%5Cxrightarrow%7B%5Ctexttt%7Beats%7D%7D%5E-%20%5Ctexttt%7BPrey%7D%0A%5Cend%7Baligned%7D%0A"> This is a “toy model” (or, more properly, a <strong>motif</strong>) for a general predator–prey scenario, where an increase in the population of prey can cause an increase in the population of predators (more food for them to eat), but such an increase can cause a decrease in the population of prey (more predators to eat them).</p>
<p>Now say we want to actually build a two-level model, where we have foxes, rabbits, and grass. Here the foxes and rabbits form a predator–prey relationship, as do the rabbits and grass, so we would like our model to reflect this symmetry. In CatColab, we have a new cell type: <strong>Instantiate</strong>. This lets us import an existing model and bind its exposed variables to those in our larger model, as we show in the screenshot below.</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><a href="images/fox-rabbit-grass-compositional.png" class="lightbox" data-gallery="quarto-lightbox-gallery-2" title="A two-level predator–prey causal loop diagram, where we have two instantiations of the predator–prey causal loop diagram and assign them to our three variables."><img src="https://topos.institute/blog/2026-01-08-catcolab-0-4-robin/images/fox-rabbit-grass-compositional.png" class="border img-fluid figure-img" alt="A two-level predator–prey causal loop diagram, where we have two instantiations of the predator–prey causal loop diagram and assign them to our three variables."></a></p>
<figcaption>A two-level predator–prey causal loop diagram, where we have two instantiations of the predator–prey causal loop diagram and assign them to our three variables.</figcaption>
</figure>
</div>
<p>Even this relatively simple example illustrates the idea that many complex models are built out of a library of such “standard components”.</p>
<p>Those of you familiar with object-oriented programming, or <code>struct</code>s in languages like C or Rust, might find the notation rather suggestive, where we write <code>Rabbit–Grass.feeds</code> to refer to the <code>feeds</code> arrow in the <code>Rabbit–Grass</code> instantiation. This blog post isn’t the place to delve properly into this analogy, but we will at least mention some of the mathematics here.</p>
<p>Under the hood, the compositional models feature of CatColab is based on recent work by Owen Lynch on <code>DoubleTT</code> (where the TT stands for type theory), which is what allows for our implementation of instantiation. The <a href="https://github.com/ToposInstitute/CatColab/blob/main/packages/catlog/examples/test.dbltt.snapshot"><code>test.dbltt.snapshot</code></a> example showcases some of the functionality of <code>DoubleTT</code>. For example, we can define a type called <code>Graph</code> as</p>
<pre><code>type Graph := [
  V : Entity,
  E : Entity,
  src : (Id Entity)[E, V],
  tgt : (Id Entity)[E, V]
]</code></pre>
<p>and we are then able to define a type called <code>Graph2</code> as</p>
<pre><code>type Graph2 := [
  V : Entity,
  g1 : Graph &amp; [ .V := V],
  g2 : Graph &amp; [ .V := V]
]</code></pre>
<p>which results in the type that we get from taking two copies of <code>Graph</code> and “gluing them along their vertex object”, i.e.&nbsp;the type of a graph with two colours of edges.</p>
</section>
<section id="documents-and-landing-page" class="level3">
<h3 data-anchor-id="documents-and-landing-page">Documents and landing page</h3>
<p>Since joining our team not so long ago, Kaspar Bumke has been hard at work in overhauling the user experience. One of my personal biggest complaints was that every time I opened up CatColab it created a new blank document, which was compounded by the fact that there was no ability to delete documents. Both of these usability problems, amongst others, have now been solved!</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><a href="images/landing-page.png" class="lightbox" data-gallery="quarto-lightbox-gallery-3" title="The landing page for both catcolab.org and next.catcolab.org."><img src="https://topos.institute/blog/2026-01-08-catcolab-0-4-robin/images/landing-page.png" class="border img-fluid figure-img" style="width:80.0%" alt="The landing page for both catcolab.org and next.catcolab.org."></a></p>
<figcaption>The landing page for both <a href="https://catcolab.org">catcolab.org</a> and <a href="next.catcolab.org">next.catcolab.org</a>.</figcaption>
</figure>
</div>
<p>The landing page for CatColab is now a nice splash page with all the useful links, including one to “My documents”, and when viewing your documents you can soft delete them (i.e.&nbsp;move them to a recycling bin and recover them at a future date). This is just the start of a much larger project focussed on improving UI/UX around documents.</p>
</section>
<section id="rich-text-and-ui-refresh" class="level3">
<h3 data-anchor-id="rich-text-and-ui-refresh">Rich text and UI refresh</h3>
<p>As in the screenshot of the <em>L. lactis</em> glycolysis Petri net model above, analyses open in a side-pane as opposed to a whole new page, making it much easier to understand how analyses change as you modify the underlying model. With v0.4, this panel-based navigation is now present throughout all of CatColab! Not only that, but analysis documents are now first-class, in the sense that they can be named, permissioned, and shared just like any model document can.</p>
<p>Another thing from the Petri net screenshot that’s a bit more subtle, but just as useful, is the capability to have <em>rich-text</em> cells within a model. This means that we can support not just formatting like bold and italic, but also links and mathematics (rendered with KaTeX). Getting this to work has been remarkably subtle, and it’s really thanks to Jason Moggridge for fixing the myriad of little frustrating bugs that blocked us from releasing this for so long. The basic issue is that our rich-text support is based on <a href="https://github.com/automerge/automerge-prosemirror"><code>automerge-prosemirror</code></a>, which uses features of the Automerge document format going beyond standard JSON. So we had to re-architect our backend to make Automerge docs, rather JSON objects, the source of truth. This was supported by our friends over at <a href="https://www.inkandswitch.com">Ink &amp; Switch</a>, who are the lovely people behind <a href="https://automerge.org">Automerge</a> itself.</p>
</section>
</section>
<section id="what-next" class="level2">
<h2 data-anchor-id="what-next">What next?</h2>
<p>CatColab is now at the stage where we can start having serious conversations with experts from different disciplines and try to understand what they want and need from software. We have some exciting conversations planned already (for example, the AIM workshop on <a href="https://aimath.org/workshops/upcoming/formalmodel/">Formal scientific modeling: a case study in global health</a>), but we’re entering into 2026 with more ideas and possibilities than we will ever possibly have time to work on to completeness.</p>
<p>But this is good news! Not only is it exciting for <em>us</em> to have a wide choice of possible projects, but it can also be exciting for <em>you</em> to be involved in helping steer the direction. If you’re interested in the software, the underlying mathematics, the ways in which it could fit into existing (or possible) real-world contexts, or have questions or desiderata, then we’d love to hear from you and chat about it all. The easiest way to join in the conversation is in our Zulip:</p>
<div class="text-center">
<p><a href="https://catcolab.zulipchat.com" class="btn btn-outline-secondary"> CatColab Zulip</a></p>
</div>


</section>


<script defer="" src="https://comments.topos.institute/comentario.js"></script>

<div id="quarto-appendix" class="default"><section id="footnotes" class="footnotes footnotes-end-of-document"><h2 class="anchored quarto-appendix-heading">Footnotes</h2>

<ol>
<li id="fn1"><p>At the moment, only <strong>discrete</strong> theories support this compositionality, but we are working on implementing this for more complex theories for a future release.↩︎</p></li>
</ol>
</section></div> ]]></description>
  <category>CatColab</category>
  <guid>https://topos.institute/blog/2026-01-08-catcolab-0-4-robin/</guid>
  <pubDate>Thu, 08 Jan 2026 00:00:00 GMT</pubDate>
  <media:content url="https://topos.institute/blog/2026-01-08-catcolab-0-4-robin/robin.jpg" medium="image" type="image/jpeg"/>
</item>
<item>
  <title>Blog / Call for 2026 Summer Research Associates</title>
  <dc:creator>Kris Brown</dc:creator>
  <link>https://topos.institute/blog/2025-11-24-summer-ra-announcement-2026/</link>
  <description><![CDATA[ 





<p>For early-career researchers, we’re excited to open up applications for our Summer Research Associate (RA) program. These positions require collaboration within a multi-disciplinary research environment consisting of mathematicians, computational and computer scientists, and domain scientists (both theoretical and experimental) conducting basic and applied research in support of Topos’ mission. Each Summer RA will complete a specific Topos project, and will write a blog post by the last week of their employment. These projects may include an internal talk, software contribution, or paper. Please visit <a href="https://topos.site/summer">here</a> to see the accomplishments of the previous cohorts.</p>
<div class="text-center">
<p><a href="../../community/jobs/summer-ra-2026" class="btn btn-outline-secondary">Call for applications</a></p>
</div>
<p>This year there are two tracks for Summer RAs: a <strong>research</strong> track and an <strong>engineering</strong> track.</p>
<p>Topics for <strong>research</strong>-track RAs may include:</p>
<ul>
<li>Computational category theory using <a href="https://catcolab.org">CatColab</a> (Rust/Typescript skills recommended)</li>
<li>Double category theory</li>
<li>Categorical statistics</li>
<li>Polynomial functors</li>
<li>Interacting dynamical systems</li>
<li>Hybrid dynamical systems, attractor theory and fast-slow dynamics</li>
<li>Proof assistants and structure editors</li>
<li>Philosophical and ethical aspects of applied category theory</li>
</ul>
<p>For <strong>engineering</strong>-track RAs, we have projects related to CatColab, which is our first step at Topos toward building production-grade software intended for users without specialized mathematical training. CatColab is a web application with a novel category-theoretic core written in Rust, backed by a server also written in Rust. Its frontend, written in TypeScript/SolidJS, features real-time collaborative editing within a notebook-style interface. This is a unique opportunity to contribute to an open source software system that draws on cutting-edge research to support collective inquiry for the public benefit. <strong>Engineering</strong>-track RAs do not need to know any category theory to be a good fit for this role (though an ideal candidate would have some familiarity with the subject). If you’ve worked on a technical, production-quality web app, ideally using Rust or TypeScript, and you’re excited about CatColab, then we’d like to hear from you.</p>
<p>You can read more about all the past RAs and their projects on the <a href="../../summer/">Summer RA page</a>, or read about each year’s cohort by following the links in the captions below.</p>
<div class="quarto-layout-panel" data-layout-ncol="2">
<div class="quarto-layout-row">
<div class="quarto-layout-cell" style="flex-basis: 50.0%;justify-content: flex-start;">
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><a href="2025-group.jpg" class="lightbox" data-gallery="quarto-lightbox-gallery-1" title="The 2025 group"><img src="https://topos.institute/blog/2025-11-24-summer-ra-announcement-2026/2025-group.jpg" class="img-fluid figure-img" alt="The 2025 group"></a></p>
<figcaption>The <a href="../../blog/2021-07-19-summer-research-associates/">2025 group</a></figcaption>
</figure>
</div>
</div>
<div class="quarto-layout-cell" style="flex-basis: 50.0%;justify-content: flex-start;">
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><a href="2024-group.jpg" class="lightbox" data-gallery="quarto-lightbox-gallery-2" title="The 2024 group"><img src="https://topos.institute/blog/2025-11-24-summer-ra-announcement-2026/2024-group.jpg" class="img-fluid figure-img" alt="The 2024 group"></a></p>
<figcaption>The <a href="../../blog/2024-07-29-summer-research-associates-2024/">2024 group</a></figcaption>
</figure>
</div>
</div>
</div>
<div class="quarto-layout-row">
<div class="quarto-layout-cell" style="flex-basis: 50.0%;justify-content: flex-start;">
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><a href="2023-group.jpg" class="lightbox" data-gallery="quarto-lightbox-gallery-3" title="The 2023 group"><img src="https://topos.institute/blog/2025-11-24-summer-ra-announcement-2026/2023-group.jpg" class="img-fluid figure-img" alt="The 2023 group"></a></p>
<figcaption>The <a href="../../blog/2023-10-09-summer-research-assistants-2023/">2023 group</a></figcaption>
</figure>
</div>
</div>
<div class="quarto-layout-cell" style="flex-basis: 50.0%;justify-content: flex-start;">
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><a href="2022-group.jpg" class="lightbox" data-gallery="quarto-lightbox-gallery-4" title="The 2022 group"><img src="https://topos.institute/blog/2025-11-24-summer-ra-announcement-2026/2022-group.jpg" class="img-fluid figure-img" alt="The 2022 group"></a></p>
<figcaption>The <a href="../../blog/2022-07-14-summer-research-associates-2022/">2022 group</a></figcaption>
</figure>
</div>
</div>
</div>
</div>
<p>Applications are now open. The position is full-time (~40 hours per week) and paid at a rate between 30 and 50 USD per hour, depending on experience.</p>
<p>For full details on how to apply, see the call for applications below. Note that the deadline for applications is <strong>January 16th, 2026</strong>.</p>
<div class="text-center">
<p><a href="../../community/jobs/summer-ra-2026" class="btn btn-outline-secondary">Call for applications</a></p>
</div>



<script defer="" src="https://comments.topos.institute/comentario.js"></script>

 ]]></description>
  <category>hiring</category>
  <category>personnel</category>
  <guid>https://topos.institute/blog/2025-11-24-summer-ra-announcement-2026/</guid>
  <pubDate>Mon, 24 Nov 2025 00:00:00 GMT</pubDate>
  <media:content url="https://topos.institute/blog/2025-11-24-summer-ra-announcement-2026/all-past-groups.png" medium="image" type="image/png" height="103" width="144"/>
</item>
<item>
  <title>Blog / Set-sets</title>
  <dc:creator>Aaron Fairbanks</dc:creator>
  <link>https://topos.institute/blog/2025-11-21-set-sets/</link>
  <description><![CDATA[ 





<p>Background assumed: categories, functors, (pre)sheaves, monads, algebraic theories, topological spaces.</p>
<section id="algebra-vs.-coalgebra" class="level2" data-number="1">
<h2 data-number="1" data-anchor-id="algebra-vs.-coalgebra"><span class="header-section-number">1</span> Algebra vs.&nbsp;coalgebra</h2>
<p>Algebra is about operations that take multiple inputs and yield one output. For example, the usual addition operation <img src="https://latex.codecogs.com/png.latex?+"> takes two inputs (say <img src="https://latex.codecogs.com/png.latex?3"> and <img src="https://latex.codecogs.com/png.latex?5">) and produces one output (say <img src="https://latex.codecogs.com/png.latex?8">).</p>
<div class="tikz">
<img src="https://topos.institute/blog/2025-11-21-set-sets/_svgs/6e2311a4c653e559edf83ea70fe994080a5307c4.svg" class="img-fluid">
</div>
<p>Dually, coalgebra is about <em>co-operations</em>, which take one input and yield multiple outputs. These multiple outputs are produced in a bunch, possibly without order. For example, in an undirected graph, each edge is assigned an unordered pair of vertices.</p>
<div class="tikz">
<img src="https://topos.institute/blog/2025-11-21-set-sets/_svgs/d3868d02c7f1cff31d7ad2620e8663d532b706c6.svg" class="img-fluid">
</div>
<p>To put it another way: in algebra, a unique <em>element</em> is assigned to each <em>operation filled with elements</em>, whereas in coalgebra, a unique <em>co-operation filled with elements</em> is assigned to each <em>element</em>.</p>
<div id="fig-co" class="quarto-float quarto-figure quarto-figure-center">
<figure class="quarto-float quarto-float-fig figure">
<div aria-describedby="fig-co-caption-0ceaefa1-69ba-4598-a22c-09a6ac19f8ca">
<div class="tikz">
<a href="_svgs/fa8775a0b9a5b934a8ac6291afa39f48ccd07ba4.svg" class="lightbox" data-gallery="quarto-lightbox-gallery-1" title="Figure&nbsp;1: The difference between algebra and coalgebra."><img src="https://topos.institute/blog/2025-11-21-set-sets/_svgs/fa8775a0b9a5b934a8ac6291afa39f48ccd07ba4.svg" class="img-fluid figure-img"></a>
</div>
</div>
<figcaption class="quarto-float-caption-bottom quarto-float-caption quarto-float-fig" id="fig-co-caption-0ceaefa1-69ba-4598-a22c-09a6ac19f8ca">
Figure&nbsp;1: The difference between algebra and coalgebra.
</figcaption>
</figure>
</div>
<p>Before giving some examples of coalgebraic structures in more detail, first let’s discuss what “(co)operation” means.</p>
</section>
<section id="encoding-cooperations" class="level2" data-number="2">
<h2 data-number="2" data-anchor-id="encoding-cooperations"><span class="header-section-number">2</span> Encoding (co)operations</h2>
<p>Both operations and co-operations are <em>expressions with slots capable of being filled with elements</em>. This will be made precise by the concept of a functor <img src="https://latex.codecogs.com/png.latex?%5Cmathbf%7BSet%7D%20%5Cto%20%5Cmathbf%7BSet%7D">. It may not be obvious at first, but such a functor is essentially equivalent to some expressions that can be filled with elements, subject to equations.</p>
<p>This is easiest to illustrate with an example. Suppose we are interested in a binary expression <img src="https://latex.codecogs.com/png.latex?x%20+%20y">, subject to the equation <img src="https://latex.codecogs.com/png.latex?x%20+%20y%20=%20y%20+%20x">.</p>
<div class="tikz">
<img src="https://topos.institute/blog/2025-11-21-set-sets/_svgs/2f3f94bd3911abfc2bb827fb0467937f4b8e6766.svg" class="img-fluid">
</div>
<p>This determines a functor <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BX%7D%20%5Ccolon%20%5Cmathbf%7BSet%7D%20%5Cto%20%5Cmathbf%7BSet%7D"> as follows. Given any set <img src="https://latex.codecogs.com/png.latex?S">, we obtain a set <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BX%7D(S)"> of <em>expressions filled with elements of <img src="https://latex.codecogs.com/png.latex?S"></em> (modulo equations obtained from the given one by substitution). In this example, <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BX%7D(S)"> amounts to unordered pairs of elements in <img src="https://latex.codecogs.com/png.latex?S">.</p>
<div id="fig-plus" class="quarto-float quarto-figure quarto-figure-center">
<figure class="quarto-float quarto-float-fig figure">
<div aria-describedby="fig-plus-caption-0ceaefa1-69ba-4598-a22c-09a6ac19f8ca">
<p><img src="https://latex.codecogs.com/png.latex?%5Cbegin%7Balign*%7D%0A%5Cmathcal%7BX%7D(%5Cemptyset)%20&amp;=%20%5Cemptyset%20%5C%5C%5B.5em%5D%0A%5Cmathcal%7BX%7D(%5C%7Bx%5C%7D)%20&amp;=%20%5Cleft%5C%7B%5Cboxed%7Bx%20+%20x%7D%5Cright%5C%7D%20%5C%5C%5B.5em%5D%0A%5Cmathcal%7BX%7D(%5C%7Bx,%20y%5C%7D)%20&amp;=%20%5Cleft%5C%7B%5Cboxed%7Bx%20+%20x%7D,%5C,%20%5Csubstack%7B%5Cboxed%7Bx%20+%20y%7D%5C%5C%20=%5C%5C%20%5Cboxed%7By%20+%20x%7D%7D,%5C,%20%5Cboxed%7By%20+%20y%7D%5Cright%5C%7D%20%5C%5C%5B.5em%5D%0A%5Cmathcal%7BX%7D(%5C%7Bx,%20y,%20z%5C%7D)%20&amp;=%20%5Cleft%5C%7B%5Cboxed%7Bx%20+%20x%7D,%5C,%20%5Csubstack%7B%5Cboxed%7Bx%20+%20y%7D%5C%5C%20=%5C%5C%20%5Cboxed%7By%20+%20x%7D%7D,%5C,%20%5Cboxed%7By%20+%20y%7D,%5C,%20%5Csubstack%7B%5Cboxed%7By%20+%20z%7D%5C%5C%20=%5C%5C%20%5Cboxed%7Bz%20+%20y%7D%7D,%5C,%20%5Cboxed%7Bz%20+%20z%7D,%5C,%20%5Csubstack%7B%5Cboxed%7Bx%20+%20z%7D%5C%5C%20=%5C%5C%20%5Cboxed%7Bz%20+%20x%7D%7D%5Cright%5C%7D%0A%5Cend%7Balign*%7D"></p>
</div>
<figcaption class="quarto-float-caption-bottom quarto-float-caption quarto-float-fig" id="fig-plus-caption-0ceaefa1-69ba-4598-a22c-09a6ac19f8ca">
Figure&nbsp;2: Some values of <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BX%7D">.
</figcaption>
</figure>
</div>
<p>Expressions can be re-filled: given any <img src="https://latex.codecogs.com/png.latex?%5Cphi%20%5Cin%20%5Cmathcal%7BX%7D(S)"> (an expression filled with elements of <img src="https://latex.codecogs.com/png.latex?S">) and a map of sets <img src="https://latex.codecogs.com/png.latex?f%20%5Ccolon%20S%20%5Cto%20T">, define <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BX%7D(f)(%5Cphi)%20%5Cin%20%5Cmathcal%7BX%7D(T)"> (an expression filled with elements of <img src="https://latex.codecogs.com/png.latex?T">) by relabeling/substitution.</p>
<div id="fig-relabel" class="quarto-float quarto-figure quarto-figure-center">
<figure class="quarto-float quarto-float-fig figure">
<div aria-describedby="fig-relabel-caption-0ceaefa1-69ba-4598-a22c-09a6ac19f8ca">
<div class="tikz">
<a href="_svgs/7640786cd2b7cb27be5efe0088435f67879c23e1.svg" class="lightbox" data-gallery="quarto-lightbox-gallery-2" title="Figure&nbsp;3: Re-filling of expressions with respect to a map of sets f."><img src="https://topos.institute/blog/2025-11-21-set-sets/_svgs/7640786cd2b7cb27be5efe0088435f67879c23e1.svg" class="img-fluid figure-img"></a>
</div>
</div>
<figcaption class="quarto-float-caption-bottom quarto-float-caption quarto-float-fig" id="fig-relabel-caption-0ceaefa1-69ba-4598-a22c-09a6ac19f8ca">
Figure&nbsp;3: Re-filling of expressions with respect to a map of sets <img src="https://latex.codecogs.com/png.latex?f">.
</figcaption>
</figure>
</div>
<p>This indeed amounts to a functor <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BX%7D%20%5Ccolon%20%5Cmathbf%7BSet%7D%20%5Cto%20%5Cmathbf%7BSet%7D">. Formally,</p>
<div class="text-center">
<p>a binary expression <img src="https://latex.codecogs.com/png.latex?x%20+%20y">, subject to the equation <img src="https://latex.codecogs.com/png.latex?x%20+%20y%20=%20y%20+%20x"></p>
</div>
<p>translates to a <em>presentation</em> of this functor by <em>generators and relations</em>. That is, <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BX%7D"> is the functor <img src="https://latex.codecogs.com/png.latex?%5Cmathbf%7BSet%7D%20%5Cto%20%5Cmathbf%7BSet%7D"> presented by</p>
<div class="text-center">
<p>a generator <img src="https://latex.codecogs.com/png.latex?%5Cboxed%7Bx%20+%20y%7D%20%5Cin%20%5Cmathcal%7BX%7D(%5C%7Bx,y%5C%7D)"> and a relation <img src="https://latex.codecogs.com/png.latex?%5Cboxed%7Bx%20+%20y%7D%20=%20%5Cboxed%7By%20+%20x%7D"></p>
</div>
<p>where <img src="https://latex.codecogs.com/png.latex?%5Cboxed%7By%20+%20x%7D%20%5Cin%20%5Cmathcal%7BX%7D(%5C%7Bx,y%5C%7D)"> denotes the term derived from <img src="https://latex.codecogs.com/png.latex?%5Cboxed%7Bx%20+%20y%7D%20%5Cin%20%5Cmathcal%7BX%7D(%5C%7Bx,y%5C%7D)"> by applying the function <img src="https://latex.codecogs.com/png.latex?f"> sending <img src="https://latex.codecogs.com/png.latex?x%20%5Cmapsto%20y">, <img src="https://latex.codecogs.com/png.latex?y%20%5Cmapsto%20x">, that is, <img src="https://latex.codecogs.com/png.latex?%5Cboxed%7By%20+%20x%7D%20%5Ccoloneqq%20%5Cmathcal%7BX%7D(f)(%5Cboxed%7Bx%20+%20y%7D)">.</p>
<p>Just like any other kind of algebraic structure, all functors <img src="https://latex.codecogs.com/png.latex?%5Cmathbf%7BSet%7D%20%5Cto%20%5Cmathbf%7BSet%7D"> may similarly be presented by generators and relations. (In more jargon, this is the “co-Yoneda lemma”: every <img src="https://latex.codecogs.com/png.latex?%5Cmathbf%7BSet%7D">-valued functor is a colimit of functors free on one generator.) That means any functor <img src="https://latex.codecogs.com/png.latex?%5Cmathbf%7BSet%7D%20%5Cto%20%5Cmathbf%7BSet%7D"> may be viewed in this way as some expressions subject to some equations.</p>
<p>A functor <img src="https://latex.codecogs.com/png.latex?%5Cmathbf%7BC%7D%20%5Cto%20%5Cmathbf%7BSet%7D"> is sometimes called a <em><img src="https://latex.codecogs.com/png.latex?%5Cmathbf%7BC%7D">-set</em> for short. From here on, a functor <img src="https://latex.codecogs.com/png.latex?%5Cmathbf%7BSet%7D%20%5Cto%20%5Cmathbf%7BSet%7D"> will be called a <em><img src="https://latex.codecogs.com/png.latex?%5Cmathbf%7BSet%7D">-set</em> for short.</p>
<section id="example-polynomial-functors" class="level3" data-number="2.1">
<h3 data-number="2.1" data-anchor-id="example-polynomial-functors"><span class="header-section-number">2.1</span> Example: polynomial functors</h3>
<p>Especially simple are expressions subject to no equations, which correspond to freely generated <img src="https://latex.codecogs.com/png.latex?%5Cmathbf%7BSet%7D">-sets (presented by generators and no relations).</p>
<p>For instance, suppose we are interested in a binary expression <img src="https://latex.codecogs.com/png.latex?x%20+%20y">, a binary expression <img src="https://latex.codecogs.com/png.latex?x%20%5Ctimes%20y">, a binary expression <img src="https://latex.codecogs.com/png.latex?x%20%5Cdiv%20y">, and a unary expression <img src="https://latex.codecogs.com/png.latex?-x">, together satisfying no equations.</p>
<div class="tikz">
<img src="https://topos.institute/blog/2025-11-21-set-sets/_svgs/093e4a702ee9d20d54d93ccbd7ded225fa84fcaf.svg" class="img-fluid">
</div>
<p>This corresponds to a <img src="https://latex.codecogs.com/png.latex?%5Cmathbf%7BSet%7D">-set <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BX%7D%20%5Ccolon%20%5Cmathbf%7BSet%7D%20%5Cto%20%5Cmathbf%7BSet%7D"> where, as always, <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BX%7D(S)"> is the set of <em>expressions filled with elements of <img src="https://latex.codecogs.com/png.latex?S"></em>.</p>
<div id="fig-poly" class="quarto-float quarto-figure quarto-figure-center">
<figure class="quarto-float quarto-float-fig figure">
<div aria-describedby="fig-poly-caption-0ceaefa1-69ba-4598-a22c-09a6ac19f8ca">
<p><img src="https://latex.codecogs.com/png.latex?%0A%5Cbegin%7Balign*%7D%0A%5Cmathcal%7BX%7D(%5Cemptyset)%20&amp;=%20%5Cemptyset%20%5C%5C%5B.5em%5D%0A%5Cmathcal%7BX%7D(%5C%7Bx%5C%7D)%20&amp;=%20%5Cleft%5C%7B%5Cboxed%7Bx%20+%20x%7D,%5C,%20%5Cboxed%7Bx%20%5Ctimes%20x%7D,%5C,%20%5Cboxed%7Bx%20%5Cdiv%20x%7D,%5C,%20%5Cboxed%7B-x%7D%5Cright%5C%7D%20%5C%5C%5B.5em%5D%0A%5Cmathcal%7BX%7D(%5C%7Bx,%20y%5C%7D)%20&amp;=%20%5Cleft%5C%7B%5Cboxed%7Bx%20+%20x%7D,%5C,%20%5Cboxed%7Bx%20+%20y%7D,%5C,%20%5Cboxed%7By%20+%20x%7D,%5C,%20%5Cboxed%7By%20+%20y%7D,%5Cright.%5C%5C%0A&amp;%20%5Cqquad%5Cleft.%5Cboxed%7Bx%20%5Ctimes%20x%7D,%5C,%20%5Cboxed%7Bx%20%5Ctimes%20y%7D,%5C,%20%5Cboxed%7By%20%5Ctimes%20x%7D,%5C,%20%5Cboxed%7By%20%5Ctimes%20y%7D,%5Cright.%5C%5C%5B.25em%5D%0A&amp;%20%5Cqquad%5Cleft.%5Cboxed%7Bx%20%5Cdiv%20x%7D,%5C,%20%5Cboxed%7Bx%20%5Cdiv%20y%7D,%5C,%20%5Cboxed%7By%20%5Cdiv%20x%7D,%5C,%20%5Cboxed%7By%20%5Cdiv%20y%7D,%5Cright.%5C%5C%0A&amp;%20%5Cqquad%5Cleft.%5Cboxed%7B-x%7D,%5C,%20%5Cboxed%7B-y%7D%5C,%5Cright%5C%7D%0A%5Cend%7Balign*%7D%0A"></p>
</div>
<figcaption class="quarto-float-caption-bottom quarto-float-caption quarto-float-fig" id="fig-poly-caption-0ceaefa1-69ba-4598-a22c-09a6ac19f8ca">
Figure&nbsp;4: Some values of <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BX%7D">.
</figcaption>
</figure>
</div>
<p>In this example, <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BX%7D"> may be described by the formula <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BX%7D(S)%20=%20S%5E2%20+%20S%5E2%20+%20S%5E2%20+%20S%5E1%20=%203S%5E2%20+%20S."> Here <img src="https://latex.codecogs.com/png.latex?S%5EN"> is the set of <img src="https://latex.codecogs.com/png.latex?N">-tuples of elements of <img src="https://latex.codecogs.com/png.latex?S">, that is, the set of functions <img src="https://latex.codecogs.com/png.latex?%5Cmathbf%7BSet%7D(N,%20S)">, counting the possible ways of filling an <img src="https://latex.codecogs.com/png.latex?N">-ary expression with <img src="https://latex.codecogs.com/png.latex?S"> elements. The functor with formula <img src="https://latex.codecogs.com/png.latex?S%5EN"> itself is the <img src="https://latex.codecogs.com/png.latex?%5Cmathbf%7BSet%7D">-set presented by a single <img src="https://latex.codecogs.com/png.latex?N">-ary generator and no relations.</p>
<p>(This is the Yoneda lemma: representable <img src="https://latex.codecogs.com/png.latex?%5Cmathbf%7BSet%7D">-valued functors are free on one generator.)</p>
<p>In general, such freely generated <img src="https://latex.codecogs.com/png.latex?%5Cmathbf%7BSet%7D">-sets are called <em>polynomials</em>, since they are described by formulas <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BX%7D(S)%20=%20%5Csum_%7Bi%20%5Cin%20I%7D%20S%5E%7BN_i%7D."></p>
</section>
<section id="technical-aside-support" class="level3" data-number="2.2">
<h3 data-number="2.2" data-anchor-id="technical-aside-support"><span class="header-section-number">2.2</span> Technical aside: support</h3>
<div class="callout callout-style-simple callout-note no-icon callout-titled">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon no-icon"></i>
</div>
<div class="callout-title-container flex-fill">
<span class="screen-reader-only">Note</span>Note
</div>
</div>
<div class="callout-body-container callout-body">
<p>This section discusses a more subtle and technical aspect of <img src="https://latex.codecogs.com/png.latex?%5Cmathbf%7BSet%7D">-sets that is not central. It can be skipped.</p>
</div>
</div>
<p>Suppose <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BX%7D"> is a <img src="https://latex.codecogs.com/png.latex?%5Cmathbf%7BSet%7D">-set and <img src="https://latex.codecogs.com/png.latex?%5Cphi%20%5Cin%20%5Cmathcal%7BX%7D(S)">. If as usual we interpret <img src="https://latex.codecogs.com/png.latex?%5Cphi"> as an <em>expression filled with elements of <img src="https://latex.codecogs.com/png.latex?S"></em>, a simple question to ask is: which elements of <img src="https://latex.codecogs.com/png.latex?S"> appear in <img src="https://latex.codecogs.com/png.latex?%5Cphi">?</p>
<p>For instance, in either of the earlier examples, the expression <img src="https://latex.codecogs.com/png.latex?%5Cboxed%7Bx%20+%20x%7D%20%5Cin%20%5Cmathcal%7BX%7D(%5C%7Bx,%20y%5C%7D)"> features only the element <img src="https://latex.codecogs.com/png.latex?x">. The expression <img src="https://latex.codecogs.com/png.latex?%5Cboxed%7By%20+%20y%7D%20%5Cin%20%5Cmathcal%7BX%7D(%5C%7Bx,%20y%5C%7D)"> on the other hand features only the element <img src="https://latex.codecogs.com/png.latex?y">, and the expression <img src="https://latex.codecogs.com/png.latex?%5Cboxed%7Bx%20+%20y%7D%20%5Cin%20%5Cmathcal%7BX%7D(%5C%7Bx,%20y%5C%7D)"> features both elements <img src="https://latex.codecogs.com/png.latex?x"> and <img src="https://latex.codecogs.com/png.latex?y">. This seems to be a simple idea, but it is actually subtle.</p>
<div class="callout callout-style-simple callout-tip no-icon callout-titled">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon no-icon"></i>
</div>
<div class="callout-title-container flex-fill">
<span class="screen-reader-only">Tip</span>Definition
</div>
</div>
<div class="callout-body-container callout-body">
<p>A subset <img src="https://latex.codecogs.com/png.latex?u%20%5Ccolon%20U%20%5Chookrightarrow%20S"> is a <em>strong support</em> of <img src="https://latex.codecogs.com/png.latex?%5Cphi%20%5Cin%20%5Cmathcal%7BX%7D(S)"> if <img src="https://latex.codecogs.com/png.latex?%5Cphi"> is in the image of <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BX%7D(u)%20%5Ccolon%20%5Cmathcal%7BX%7D(U)%20%5Cto%20%5Cmathcal%7BX%7D(S)">.</p>
</div>
</div>
<p>This means that <img src="https://latex.codecogs.com/png.latex?%5Cphi"> can be expressed such that it only features elements of <img src="https://latex.codecogs.com/png.latex?U">. Above, <img src="https://latex.codecogs.com/png.latex?%5C%7Bx%5C%7D%20%5Csubseteq%20%5C%7Bx,%20y%5C%7D"> is a strong support of <img src="https://latex.codecogs.com/png.latex?%5Cboxed%7Bx%20+%20x%7D"> but neither <img src="https://latex.codecogs.com/png.latex?%5Cboxed%7By%20+%20y%7D"> nor <img src="https://latex.codecogs.com/png.latex?%5Cboxed%7Bx%20+%20y%7D">.</p>
<p>Perhaps counterintuitively, it is not necessary for <img src="https://latex.codecogs.com/png.latex?%5Cphi"> to have a <em>smallest</em> strong support. In fact, strong supports are not in general even closed under finite intersections. Consider a unary expression <img src="https://latex.codecogs.com/png.latex?%5Cphi(x)"> subject to the equation <img src="https://latex.codecogs.com/png.latex?%5Cphi(x)%20=%20%5Cphi(y)">, effectively eliminating the dependence of the expression on <img src="https://latex.codecogs.com/png.latex?x">. This corresponds to a <img src="https://latex.codecogs.com/png.latex?%5Cmathbf%7BSet%7D">-set <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BX%7D"> such that <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BX%7D(S)"> is empty if <img src="https://latex.codecogs.com/png.latex?S"> is empty and otherwise has one element.</p>
<div id="fig-const" class="quarto-float quarto-figure quarto-figure-center">
<figure class="quarto-float quarto-float-fig figure">
<div aria-describedby="fig-const-caption-0ceaefa1-69ba-4598-a22c-09a6ac19f8ca">
<p><img src="https://latex.codecogs.com/png.latex?%5Cbegin%7Balign*%7D%0A%5Cmathcal%7BX%7D(%5Cemptyset)%20&amp;=%20%5Cemptyset%20%5C%5C%5B.5em%5D%0A%5Cmathcal%7BX%7D(%5C%7Bx%5C%7D)%20&amp;=%20%5Cleft%5C%7B%5Cboxed%7B%5Cphi(x)%7D%5Cright%5C%7D%20%5C%5C%5B.5em%5D%0A%5Cmathcal%7BX%7D(%5C%7Bx,%20y%5C%7D)%20&amp;=%20%5Cleft%5C%7B%5Cboxed%7B%5Cphi(x)%7D%20=%20%5Cboxed%7B%5Cphi(y)%7D%5Cright%5C%7D%20%5C%5C%5B.5em%5D%0A%5Cmathcal%7BX%7D(%5C%7Bx,%20y,%20z%5C%7D)%20&amp;=%20%5Cleft%5C%7B%5Cboxed%7B%5Cphi(x)%7D%20=%20%5Cboxed%7B%5Cphi(y)%7D%20=%20%5Cboxed%7B%5Cphi(z)%7D%5Cright%5C%7D%0A%5Cend%7Balign*%7D"></p>
</div>
<figcaption class="quarto-float-caption-bottom quarto-float-caption quarto-float-fig" id="fig-const-caption-0ceaefa1-69ba-4598-a22c-09a6ac19f8ca">
Figure&nbsp;5: Some values of <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BX%7D">.
</figcaption>
</figure>
</div>
<p>Although the subsets <img src="https://latex.codecogs.com/png.latex?%5C%7Bx%5C%7D"> and <img src="https://latex.codecogs.com/png.latex?%5C%7By%5C%7D"> of <img src="https://latex.codecogs.com/png.latex?%5C%7Bx,%20y%5C%7D"> are both strong supports of the expression <img src="https://latex.codecogs.com/png.latex?%5Cboxed%7B%5Cphi(x)%7D%20=%20%5Cboxed%7B%5Cphi(y)%7D%20%5Cin%20%5Cmathcal%7BX%7D(%5C%7Bx,%20y%5C%7D)">, their intersection, the empty subset, is not.</p>
<p>A slightly different definition can partially resolve this defect. To aid readability we use the “action” notation <img src="https://latex.codecogs.com/png.latex?f%20%5Ccdot%20%5Cphi"> to denote <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BX%7D(f)(%5Cphi)"> where <img src="https://latex.codecogs.com/png.latex?%5Cphi%20%5Cin%20%5Cmathcal%7BX%7D(S)"> and <img src="https://latex.codecogs.com/png.latex?f%20%5Ccolon%20S%20%5Cto%20T">.</p>
<div class="callout callout-style-simple callout-tip no-icon callout-titled">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon no-icon"></i>
</div>
<div class="callout-title-container flex-fill">
<span class="screen-reader-only">Tip</span>Definition
</div>
</div>
<div class="callout-body-container callout-body">
<p>A subset <img src="https://latex.codecogs.com/png.latex?u%20%5Ccolon%20U%20%5Chookrightarrow%20S"> is a <em>support</em> of <img src="https://latex.codecogs.com/png.latex?%5Cphi%20%5Cin%20%5Cmathcal%7BX%7D(S)"> if for any maps <img src="https://latex.codecogs.com/png.latex?f,%20g%20%5Ccolon%20S%20%5Cto%20T"> such that <img src="https://latex.codecogs.com/png.latex?f%20%5Ccirc%20u%20=%20g%20%5Ccirc%20u">, we have <img src="https://latex.codecogs.com/png.latex?f%20%5Ccdot%20%5Cphi%20=%20g%20%5Ccdot%20%5Cphi">.</p>
</div>
</div>
<p>This means whenever <img src="https://latex.codecogs.com/png.latex?f"> and <img src="https://latex.codecogs.com/png.latex?g"> agree on <img src="https://latex.codecogs.com/png.latex?U">, their relabeling actions agree on <img src="https://latex.codecogs.com/png.latex?%5Cphi">, i.e.&nbsp;<img src="https://latex.codecogs.com/png.latex?%5Cphi"> only “depends on” elements in <img src="https://latex.codecogs.com/png.latex?U">. With this definition, one can show that any finite intersection of supports of <img src="https://latex.codecogs.com/png.latex?%5Cphi"> is again a support of <img src="https://latex.codecogs.com/png.latex?%5Cphi">.</p>
<p>(The two definitions are extremely close: strong support implies support, and conversely support implies strong support for all subsets <img src="https://latex.codecogs.com/png.latex?U"> that are nonempty.)</p>
<p>However, it is still not necessary for <img src="https://latex.codecogs.com/png.latex?%5Cphi"> to have a <em>smallest</em> support, if we consider infinite expressions. Consider an expression <img src="https://latex.codecogs.com/png.latex?%5Cphi(x_0,%20x_1,%20x_2,%20%5Cldots)"> involving a sequence of infinitely many elements, subject to the infinitely many equations <img src="https://latex.codecogs.com/png.latex?%5Cphi(x_0,%20x_1,%20x_2,%20%5Cldots)%20=%20%5Cphi(y,%20x_1,%20x_2,%20%5Cldots)%20=%20%5Cphi(x_0,%20y,%20x_2,%20%5Cldots)%20=%20%5Cphi(x_0,%20x_1,%20y,%20%5Cldots)%20=%20%5C;%5Ccdots"></p>
<p>effectively eliminating the dependence of the expression on any single <img src="https://latex.codecogs.com/png.latex?x_i">. In the corresponding <img src="https://latex.codecogs.com/png.latex?%5Cmathbf%7BSet%7D">-set <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BX%7D">, the set <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BX%7D(S)"> consists of “sequences in <img src="https://latex.codecogs.com/png.latex?S"> modulo eventual agreement”: two sequences <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BN%7D%20%5Cto%20S"> are equivalent if they agree on all but finitely many indices. Here a sequence with infinitely many distinct elements has no smallest support, because a support is a subset including all but finitely many of the elements in the sequence, and there is no smallest such subset.</p>
<p>Although <img src="https://latex.codecogs.com/png.latex?%5Cphi"> may not have a smallest support, it does have a <em>filter</em> of supports. That is, supports are closed under supersets and finite intersections, analogous to the neighborhoods of a point in a topological space. (Conversely, for any filter <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BF%7D"> on a set <img src="https://latex.codecogs.com/png.latex?N">, one can construct a <img src="https://latex.codecogs.com/png.latex?%5Cmathbf%7BSet%7D">-set on an <img src="https://latex.codecogs.com/png.latex?N">-ary generator whose supports are the subsets of <img src="https://latex.codecogs.com/png.latex?N"> in <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BF%7D">, via appropriate relations.)</p>
<p>In summary, an infinite expression (modulo equality) may have no particular smallest set of elements it depends on. Thus an operation may only depend on ever-shrinkingly small subsets of its inputs. Dually, a co-operation might output an “infinitesimal neighborhood”, in the sense that only elements within ever-shrinkingly small subsets of its outputs have assigned values. For this reason there is a close relationship between topological spaces and coalgebraic structures.</p>
</section>
</section>
<section id="examples-of-coalgebras" class="level2" data-number="3">
<h2 data-number="3" data-anchor-id="examples-of-coalgebras"><span class="header-section-number">3</span> Examples of (co)algebras</h2>
<p>The following seems a reasonable way of making precise the previously informal terms “operation” and “co-operation”: a <em>(co)operation</em> is a <em>generator for a presentation of a <img src="https://latex.codecogs.com/png.latex?%5Cmathbf%7BSet%7D">-set</em>. (It is an expression <img src="https://latex.codecogs.com/png.latex?%5Cphi%20%5Cin%20%5Cmathcal%7BX%7D(S)"> with <img src="https://latex.codecogs.com/png.latex?S"> many slots that can be filled with elements.) Whether we call this an operation or a co-operation depends on whether we are interested in algebra or coalgebra.</p>
<p>Given a <img src="https://latex.codecogs.com/png.latex?%5Cmathbf%7BSet%7D">-set <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BX%7D">, an <em>algebra</em> is a map <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BX%7D(S)%20%5Cto%20S"> (assigning to each <em>operation filled with elements</em> a unique <em>element</em>). A <em>coalgebra</em> is a map <img src="https://latex.codecogs.com/png.latex?S%20%5Cto%20%5Cmathcal%7BX%7D(S)"> (assigning to each <em>element</em> a unique <em>co-operation filled with elements</em>). In the context of an algebra, the elements that fill the expressions act as inputs, whereas in the context of a coalgebra, the elements that fill the expressions act as outputs.</p>
<p>For example, an algebra <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BX%7D(S)%20%5Cto%20S"> for the <img src="https://latex.codecogs.com/png.latex?%5Cmathbf%7BSet%7D">-set <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BX%7D"> described earlier presented by an <img src="https://latex.codecogs.com/png.latex?x%20+%20y"> subject to the equation <img src="https://latex.codecogs.com/png.latex?x%20+%20y%20=%20y%20+%20x"> is a set with a commutative binary operation, whereas a coalgebra <img src="https://latex.codecogs.com/png.latex?S%20%5Cto%20%5Cmathcal%7BX%7D(S)"> is a set with a “commutative binary co-operation”, assigning each element an unordered pair of elements.</p>
<p>Likely most readers are more familiar with algebra/operations than coalgebra/co-operations, so here are some examples of the latter.</p>
<section id="directed-multigraphs" class="level3" data-number="3.1">
<h3 data-number="3.1" data-anchor-id="directed-multigraphs"><span class="header-section-number">3.1</span> Directed multigraphs</h3>
<p>Directed multigraphs (a.k.a. <em>quivers</em>) can be modeled as coalgebras, using an <em>edge</em> co-operation and a <em>vertex</em> co-operation.</p>
<div class="tikz">
<img src="https://topos.institute/blog/2025-11-21-set-sets/_svgs/c658401b7e37826ccc3083744e929a44d7634dda.svg" class="img-fluid">
</div>
<p>The edge co-operation <img src="https://latex.codecogs.com/png.latex?e"> has two outputs (<img src="https://latex.codecogs.com/png.latex?s"> and <img src="https://latex.codecogs.com/png.latex?t">), and the vertex co-operation <img src="https://latex.codecogs.com/png.latex?v"> has zero outputs. Together these two expressions <img src="https://latex.codecogs.com/png.latex?e(s,%20t)%20%5Cin%20%5Cmathcal%7BX%7D(%5C%7Bs,%20t%5C%7D)"> and <img src="https://latex.codecogs.com/png.latex?v()%20%5Cin%20%5Cmathcal%7BX%7D(%5Cemptyset)"> generate a polynomial (i.e.&nbsp;freely generated) <img src="https://latex.codecogs.com/png.latex?%5Cmathbf%7BSet%7D">-set:</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BX%7D(S)%20=%20S%5E2%20+%20S%5E0%20=%20S%5E2%20+%201."> Pictured below is a directed multigraph with four edges and four vertices, providing an example of a coalgebra <img src="https://latex.codecogs.com/png.latex?S%20%5Cto%20%5Cmathcal%7BX%7D(S)">. In this case the set <img src="https://latex.codecogs.com/png.latex?S"> has ten elements, four of which are assigned the <em>edge</em> co-operation, each thus outputting two elements, and six of which are assigned the <em>vertex</em> co-operation, each thus outputting no elements.</p>
<div id="fig-dir" class="quarto-float quarto-figure quarto-figure-center">
<figure class="quarto-float quarto-float-fig figure">
<div aria-describedby="fig-dir-caption-0ceaefa1-69ba-4598-a22c-09a6ac19f8ca">
<div class="tikz">
<a href="_svgs/9f01ba5b7c0f1f57be2b9aa1e0afb25567a4827e.svg" class="lightbox" data-gallery="quarto-lightbox-gallery-3" title="Figure&nbsp;6: A directed multigraph."><img src="https://topos.institute/blog/2025-11-21-set-sets/_svgs/9f01ba5b7c0f1f57be2b9aa1e0afb25567a4827e.svg" class="img-fluid figure-img"></a>
</div>
</div>
<figcaption class="quarto-float-caption-bottom quarto-float-caption quarto-float-fig" id="fig-dir-caption-0ceaefa1-69ba-4598-a22c-09a6ac19f8ca">
Figure&nbsp;6: A directed multigraph.
</figcaption>
</figure>
</div>
<p>Not all coalgebras of this <img src="https://latex.codecogs.com/png.latex?%5Cmathbf%7BSet%7D">-set <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BX%7D"> cohere as directed multigraphs: it is necessary to impose the additional condition that the two outputs of each edge are vertices, not edges. The the ability to specify such conditions on coalgebras is provided by the concept of a <em>comonad</em>.</p>
<div class="callout callout-style-simple callout-note no-icon callout-titled">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon no-icon"></i>
</div>
<div class="callout-title-container flex-fill">
<span class="screen-reader-only">Note</span>Further reading
</div>
</div>
<div class="callout-body-container callout-body">
<p>So far we have seen that the structure of a functor <img src="https://latex.codecogs.com/png.latex?%5Cmathbf%7BSet%7D%20%5Cto%20%5Cmathbf%7BSet%7D"> encodes expressions related by equations. A key aspect of universal (co)algebra is missing: relations between <em>nested</em> expressions. For example, in the structure of a <img src="https://latex.codecogs.com/png.latex?%5Cmathbf%7BSet%7D">-set generated by an operation <img src="https://latex.codecogs.com/png.latex?x%20+%20y">, we cannot express the associativity equation <img src="https://latex.codecogs.com/png.latex?(x%20+%20y)%20+%20z%20=%20x%20+%20(y%20+%20z)">, which we may wish to impose on algebras. Likewise, in the structure of a <img src="https://latex.codecogs.com/png.latex?%5Cmathbf%7BSet%7D">-set generated by “edge” and “vertex” co-operations <img src="https://latex.codecogs.com/png.latex?e(x,%20y)"> and <img src="https://latex.codecogs.com/png.latex?v()"> as above, we cannot express that the outputs of an edge are both vertices.</p>
<p>The additional structure of a monad or comonad expresses relationships between expressions <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BX%7D(S)"> and nested expressions <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BX%7D(%5Cmathcal%7BX%7D(S))"> (“<em>expressions filled with expressions filled with elements of <img src="https://latex.codecogs.com/png.latex?S"></em>”). Details are outside the scope of this post, but we refer the interested reader to <span class="citation" data-cites="maclane">(Mac Lane 1998)</span> or <span class="citation" data-cites="riehl">(Riehl 2017)</span> for prerequisite material on monads, then to <span class="citation" data-cites="adamek-porst">(Adamek and Porst 2003)</span> where it is shown that just as monads may be presented by operations and equations, comonads may be presented by co-operations and “co-equations”.</p>
<p>In particular, there is a comonad on <img src="https://latex.codecogs.com/png.latex?%5Cmathbf%7BSet%7D"> for which coalgebras are directed multigraphs.</p>
</div>
</div>
<p>Note that a directed multigraph may be equivalently described as a functor <img src="https://latex.codecogs.com/png.latex?%5Cmathbf%7BC%7D">-set (a functor <img src="https://latex.codecogs.com/png.latex?%5Cmathbf%7BC%7D%20%5Cto%20%5Cmathbf%7BSet%7D">) where <img src="https://latex.codecogs.com/png.latex?%5Cmathbf%7BC%7D"> is the category:</p>
<div class="text-center">
<!-- https://q.uiver.app/#q=WzAsMixbMCwwLCJlIl0sWzEsMCwidiJdLFswLDEsInQiLDIseyJvZmZzZXQiOjJ9XSxbMCwxLCJzIiwwLHsib2Zmc2V0IjotMX1dXQ== -->
<iframe class="quiver-embed" src="https://q.uiver.app/#q=WzAsMixbMCwwLCJlIl0sWzEsMCwidiJdLFswLDEsInQiLDIseyJvZmZzZXQiOjJ9XSxbMCwxLCJzIiwwLHsib2Zmc2V0IjotMX1dXQ==&amp;embed" width="304" height="176" style="border-radius: 8px; border: none;">
</iframe>
</div>
<p>In general, <img src="https://latex.codecogs.com/png.latex?%5Cmathbf%7BC%7D">-sets for any category <img src="https://latex.codecogs.com/png.latex?%5Cmathbf%7BC%7D"> can be modeled as coalgebras of a polynomial <img src="https://latex.codecogs.com/png.latex?%5Cmathbf%7BSet%7D">-set. Namely, there is a co-operation for each object, whose outputs are all the arrows out of the object.</p>
<div class="tikz">
<img src="https://topos.institute/blog/2025-11-21-set-sets/_svgs/ebedd06154d798c295f1b16026349749da8535c4.svg" class="img-fluid">
</div>
<p>(In the directed graph example above, the identity arrows were omitted from the co-operations for simplicity. If they were included, then <img src="https://latex.codecogs.com/png.latex?e"> would become an operation with three outputs <img src="https://latex.codecogs.com/png.latex?s">, <img src="https://latex.codecogs.com/png.latex?t">, and <img src="https://latex.codecogs.com/png.latex?%5Cmathrm%7Bid%7D_e">, and <img src="https://latex.codecogs.com/png.latex?v"> would become an operation with one output <img src="https://latex.codecogs.com/png.latex?%5Cmathrm%7Bid%7D_v">. The corresponding polynomial <img src="https://latex.codecogs.com/png.latex?%5Cmathbf%7BSet%7D">-set has formula <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BX%7D(S)%20=%20S%5E3%20+%20S%5E1">.)</p>
<p>Additional associativity and unit constraints are needed to ensure the elements and assigned co-operations cohere as a <img src="https://latex.codecogs.com/png.latex?%5Cmathbf%7BC%7D">-set. For any category <img src="https://latex.codecogs.com/png.latex?%5Cmathbf%7BC%7D">, there is a comonad on <img src="https://latex.codecogs.com/png.latex?%5Cmathbf%7BSet%7D"> whose coalgebras are <img src="https://latex.codecogs.com/png.latex?%5Cmathbf%7BC%7D">-sets. In fact, it was noticed only relatively recently <span class="citation" data-cites="ahman-uustalu">(Ahman and Uustalu 2016)</span> that comonads on <img src="https://latex.codecogs.com/png.latex?%5Cmathbf%7BSet%7D"> given by polynomial formulas are precisely the same as (small) categories.</p>
<p>Viewing a <img src="https://latex.codecogs.com/png.latex?%5Cmathbf%7BC%7D">-set as a coalgebra, the co-operation assigned to an element specifies the type of the element and produces at once all elements derived from that type. The same intuition may be applied to more general coalgebras of <img src="https://latex.codecogs.com/png.latex?%5Cmathbf%7BSet%7D">-sets.</p>
</section>
<section id="undirected-multigraphs" class="level3" data-number="3.2">
<h3 data-number="3.2" data-anchor-id="undirected-multigraphs"><span class="header-section-number">3.2</span> Undirected multigraphs</h3>
<p>There are coalgebraic structures besides <img src="https://latex.codecogs.com/png.latex?%5Cmathbf%7BC%7D">-sets, for example <em>undirected</em> multigraphs.</p>
<div class="tikz">
<img src="https://topos.institute/blog/2025-11-21-set-sets/_svgs/80d7704b8806c364c901233d6c1eeb972b5c8501.svg" class="img-fluid">
</div>
<p>In this case the two vertices output by the edge co-operation are <em>unordered</em> pair instead of an ordered pair. The generating co-operations <img src="https://latex.codecogs.com/png.latex?e(s,t)"> and <img src="https://latex.codecogs.com/png.latex?v()"> are as before, but this time with the relation <img src="https://latex.codecogs.com/png.latex?e(s,t)%20=%20e(t,s)">. The undirected multigraph below is an example of a coalgebra for the presented endofunctor.</p>
<div id="fig-undir" class="quarto-float quarto-figure quarto-figure-center">
<figure class="quarto-float quarto-float-fig figure">
<div aria-describedby="fig-undir-caption-0ceaefa1-69ba-4598-a22c-09a6ac19f8ca">
<div class="tikz">
<a href="_svgs/80842425417b63deae1a7ac9edaf6aab7dc160fe.svg" class="lightbox" data-gallery="quarto-lightbox-gallery-4" title="Figure&nbsp;7: An undirected multigraph."><img src="https://topos.institute/blog/2025-11-21-set-sets/_svgs/80842425417b63deae1a7ac9edaf6aab7dc160fe.svg" class="img-fluid figure-img"></a>
</div>
</div>
<figcaption class="quarto-float-caption-bottom quarto-float-caption quarto-float-fig" id="fig-undir-caption-0ceaefa1-69ba-4598-a22c-09a6ac19f8ca">
Figure&nbsp;7: An undirected multigraph.
</figcaption>
</figure>
</div>
<p>As in the case of directed multigraphs, there is a comonad on <img src="https://latex.codecogs.com/png.latex?%5Cmathbf%7BSet%7D"> whose coalgebras are undirected multigraphs. Perhaps it is reasonable to call this a “generalized category” <img src="https://latex.codecogs.com/png.latex?%5Cmathbf%7BC%7D">, for which “<img src="https://latex.codecogs.com/png.latex?%5Cmathbf%7BC%7D">-sets” are undirected multigraphs.</p>
</section>
<section id="sheaves" class="level3" data-number="3.3">
<h3 data-number="3.3" data-anchor-id="sheaves"><span class="header-section-number">3.3</span> Sheaves</h3>
<p>This final example is intended to whet your appetite, so do not be disturbed if some aspects remain puzzling.</p>
<p>A sheaf is a way of gluing regions of a topological space <img src="https://latex.codecogs.com/png.latex?%5Cmathbf%7BX%7D"> together into a larger space that locally resembles the original space. It can be modeled as a coalgebra, using a co-operation for each point of <img src="https://latex.codecogs.com/png.latex?%5Cmathbf%7BX%7D">, outputting the points in its “infinitesimal neighborhood”.</p>
<div class="tikz">
<img src="https://topos.institute/blog/2025-11-21-set-sets/_svgs/6fb900b11c73a27f9c28d57f5e866a8eda78b5a2.svg" class="img-fluid">
</div>
<p>That is, sheaves over <img src="https://latex.codecogs.com/png.latex?%5Cmathbf%7BX%7D"> are coalgebras for a <img src="https://latex.codecogs.com/png.latex?%5Cmathbf%7BSet%7D">-set <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BX%7D"> generated by a co-operation in <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BX%7D(%7C%5Cmathbf%7BX%7D%7C)"> for each point <img src="https://latex.codecogs.com/png.latex?x%5Cin%20%5Cmathbf%7BX%7D"> whose <em>supports</em> (see earlier section) are exactly the neighborhoods of <img src="https://latex.codecogs.com/png.latex?x">. More specifically,</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BX%7D(S)%20%5C;%20=%20%5C;%5Csum_%7Bx%20%5Cin%20%5Cmathbf%7BX%7D%7D%5C;%20%5Cmathop%7B%5Cmathrm%7Bcolim%7D%7D_%7BU%20%5Cin%20%5Cmathcal%7BN%7D_x%7D%20%5C;%20S%5EU"> where <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BN%7D_x"> is the neighborhood filter of <img src="https://latex.codecogs.com/png.latex?x">. In terms of generators and relations, this <img src="https://latex.codecogs.com/png.latex?%5Cmathbf%7BSet%7D">-set is defined as follows: for each point <img src="https://latex.codecogs.com/png.latex?x">, there is a <img src="https://latex.codecogs.com/png.latex?U">-ary generator for each neighborhood <img src="https://latex.codecogs.com/png.latex?U">, all of which are identified so as to only retain dependence on the elements that are within arbitrarily small neighborhoods of <img src="https://latex.codecogs.com/png.latex?x">. This determines a co-operation that essentially outputs an infinitesimal neighborhood’s worth of elements.</p>
<p>Again, additional associativity and unit constraints on a coalgebra are needed to ensure that the coalgebra coheres as a sheaf, and again this is captured via comonad structure. For any topological space <img src="https://latex.codecogs.com/png.latex?%5Cmathbf%7BX%7D">, there is a comonad on <img src="https://latex.codecogs.com/png.latex?%5Cmathbf%7BSet%7D">, with the above formula, whose coalgebras are sheaves over <img src="https://latex.codecogs.com/png.latex?%5Cmathbf%7BX%7D">, and the topological space can be recovered from the comonad. In this way, like categories, topological spaces are identified with a certain class of comonads on <img src="https://latex.codecogs.com/png.latex?%5Cmathbf%7BSet%7D">.</p>
<p>In fact, topological spaces play the same role in relation to general comonads on <img src="https://latex.codecogs.com/png.latex?%5Cmathbf%7BSet%7D"> as preorders do to categories. To learn about this analogy and related curiosities, stay tuned for the upcoming paper</p>
<div class="text-center">
<p><strong>COMONADS ON SET</strong></p>
<p>by Kevin Carlson, Aaron David Fairbanks, and David Spivak</p>
</div>
<p>where we will push as far as we can the perspective that comonads on <img src="https://latex.codecogs.com/png.latex?%5Cmathbf%7BSet%7D"> are a common generalization of both categories and topological spaces.</p>



</section>
</section>

<script defer="" src="https://comments.topos.institute/comentario.js"></script>

<div id="quarto-appendix" class="default"><section class="quarto-appendix-contents" id="quarto-bibliography"><h2 class="anchored quarto-appendix-heading">References</h2><div id="refs" class="references csl-bib-body hanging-indent" data-entry-spacing="0">
<div id="ref-adamek-porst" class="csl-entry">
Adamek, Jiri, and Hans-E. Porst. 2003. <span>“On Varieties and Covarieties in a Category.”</span> <em>Mathematical Structures in Computer Science</em> 13 (2): 201–32. <a href="https://doi.org/10.1017/S0960129502003882">https://doi.org/10.1017/S0960129502003882</a>.
</div>
<div id="ref-ahman-uustalu" class="csl-entry">
Ahman, Danel, and Tarmo Uustalu. 2016. <span>“Directed Containers as Categories.”</span> <em>EPTCS 207, 2016, Pp. 89-98</em>.
</div>
<div id="ref-maclane" class="csl-entry">
Mac Lane, Saunders. 1998. <em>Categories for the Working Mathematician</em>. 2nd ed. Graduate Texts in Mathematics 5. New York: Springer-Verlag.
</div>
<div id="ref-riehl" class="csl-entry">
Riehl, Emily. 2017. <em>Category Theory in Context</em>. Courier Dover Publications.
</div>
</div></section></div> ]]></description>
  <guid>https://topos.institute/blog/2025-11-21-set-sets/</guid>
  <pubDate>Fri, 21 Nov 2025 00:00:00 GMT</pubDate>
</item>
<item>
  <title>Blog / DOTS from double theories</title>
  <dc:creator>Tim Hosgood</dc:creator>
  <link>https://topos.institute/blog/2025-11-07-dots-from-double-theories/</link>
  <description><![CDATA[ 





<p><em>I am a triangles guy.</em></p>
<p><em>As my friends and family know, my maths research has always been “just about <a href="https://mathscinet.ams.org/mathscinet/msc/msc2020.html?s=18N50">triangles</a>”.</em> <em>When I was in Stockholm I made friends with some people who really liked cubes and squares.</em> <em>Around the same time, a coauthor told me that all my simplicial work was secretly cubical.</em> <em>I also ended up helping to organise two online workshops on double categories.</em> <em>Now I work full-time at Topos, where I hear about double categories multiple times a day.</em></p>
<p><em>I cannot escape the squares.</em></p>
<hr>
<p>DOTS stands for <em>double operadic theory of systems</em>, and Sophie and David Jaz recently wrote a paper on it <span class="citation" data-cites="LM2025">(Libkind and Myers 2025)</span>. Their paper works through a <em>lot</em> of examples (and they draw a <em>lot</em> of diagrams), which I’m not going to do today. I’m also not going to attempt to summarise the whole paper here, nor am I going to be particularly detailed or careful about proving things. Instead, I just want to tie this into the work that Evan and many others have been working on surrounding double theories and their use for <a href="../../work/catcolab/">CatColab</a> <span class="citation" data-cites="LP2023 CP2025">(Lambert and Patterson 2023; Carlson and Patterson 2025)</span>. To give some very small historical context, DOTS can be seen as a continuation of previous work on operadic composition for systems theories, such as <span class="citation" data-cites="LBPF2021">(Libkind et al. 2021)</span>.</p>
<section id="dots-is-do-ts" class="level2" data-number="1">
<h2 data-number="1" data-anchor-id="dots-is-do-ts"><span class="header-section-number">1</span> DOTS is DO ⦚ TS</h2>
<p>There are two things to say before trying to explain what DOTS is.</p>
<ol type="1">
<li><p>It’s easier to explain what <em>a</em> DOTS is, and then say that DOTS is the study of DOTSs. This is entirely analogous to the ambiguity in the phrase “type theory”: we can define what <em>a</em> type theory is, and then say that type theory is the study of type theories. This means I get to write fun-to-say sentences like “Graphs is a DOTS”.</p></li>
<li><p>DOTS should be read as a definition with an attitude all in one, split very neatly down the middle: DO ⦚ TS. That is, the <em>definition</em> part is (an algebra over) a <strong>d</strong>ouble <strong>o</strong>perad, and the attitude with which to interpret this definition is as a <strong>t</strong>heory of <strong>s</strong>ystems.</p></li>
</ol>
<p>So the rest of this post will be split following this idea. First we’ll look at the <strong>DO</strong> part, and then the <strong>TS</strong> part, and finally we’ll explain one way that double theories can fit into the story. But here’s the brief takeaway from all that follows:</p>
<blockquote class="blockquote">
<p>A DOTS is the data of three 1-categories, along with instructions for how to fit them together in such a way that we can think of them as “things”, “sub-things”, and “ways to glue things along their sub-things”. Furthermore, we can really say the word “system” instead of “thing”.</p>
</blockquote>
<p>This means that you can come along with your favourite systems theory — say, Petri nets, or undirected wiring diagrams with little systems of ODES inside of them, or … — and ask “do I have a DOTS?”. But just like how you might come along with your favourite category and ask “do I have a symmetric monoidal category?”, the answer might be “I can’t really tell you unless you’re a bit more specific about some of your extra structure”.</p>
</section>
<section id="what-is-a-do" class="level2" data-number="2">
<h2 data-number="2" data-anchor-id="what-is-a-do"><span class="header-section-number">2</span> What is a DO?</h2>
<p>The definition of an algebra over a double operad is a categorification of that of an algebra over an operad: if we take the definition of the former (that we are still yet to give) and replace every category in sight by a set then we will recover the classical definition of the latter. For now we’ll just give a definition of the <strong>DO</strong> part with seemingly arbitrary notation and conditions, but these will be explained once we look at the <strong>TS</strong> part.</p>
<p>Here <img src="https://latex.codecogs.com/png.latex?%5Cmathsf%7BBag%7D(%5Cmathcal%7BC%7D)"> is the category of <strong>bags</strong> of objects in <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BC%7D">, defined as the lax slice <img src="https://latex.codecogs.com/png.latex?%5Cmathsf%7BFinSet%7D%5E%5Cmathrm%7Bbij%7D%5Cdownarrow_%5Cmathrm%7Blax%7D%5Cmathcal%7BC%7D"> of the core of finite sets over <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BC%7D">. This is essentially a categorification of the notion of multisets of objects, <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BN%7D%5B%5Cmathcal%7BC%7D%5D%5Csimeq%5Cmathbb%7BN%7D%5E%5Cmathcal%7BC%7D">. Then an <strong>algebra over a double operad</strong> consists of</p>
<ol type="1">
<li>1-categories <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BS%7D">, <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BF%7D">, and <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BA%7D"></li>
<li>a functor <img src="https://latex.codecogs.com/png.latex?%5Cpartial%5Ccolon%5Cmathcal%7BS%7D%5Cto%5Cmathcal%7BF%7D"></li>
<li>a span <img src="https://latex.codecogs.com/png.latex?%5Cmathsf%7BBag%7D(%5Cmathcal%7BF%7D)%5Cxleftarrow%7B%5Csigma%7D%20%5Cmathcal%7BA%7D%5Cxrightarrow%7B%5Ctau%7D%20%5Cmathcal%7BF%7D"></li>
<li>a functor <img src="https://latex.codecogs.com/png.latex?c%5Ccolon%5Cmathcal%7BP%7D%5Cto%5Cmathcal%7BS%7D">, where <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BP%7D"> is the pullback of the cospan <img src="https://latex.codecogs.com/png.latex?%5Cmathsf%7BBag%7D(%5Cmathcal%7BS%7D)%5Cxrightarrow%7B%5Cmathsf%7BBag%7D(%5Cpartial)%7D%5Cmathsf%7BBag%7D(%5Cmathcal%7BF%7D)%5Cxleftarrow%7B%5Csigma%7D%5Cmathcal%7BA%7D"></li>
<li>(some coherence data that I’m not going to describe)</li>
</ol>
<p><em>such that</em> the following diagram commutes:</p>
<p><img src="https://topos.institute/blog/2025-11-07-dots-from-double-theories/diagram-1.png" class="img-fluid" style="width:60.0%"> <!-- \begin{tikzcd}[sep=large]
  & & \mathcal{S}
    \ar[d,"\partial"]
\\\mathcal{P}
    \ar[urr,bend left=10,"c"]
    \ar[dr,phantom,near start,"\lrcorner"]
    \ar[r] \ar[d]
  & \mathcal{A}
    \ar[r,swap,"\tau"] \ar[d,"\sigma"]
  & \mathcal{F}
\\\mathsf{Bag}(\mathcal{S})
    \ar[r,swap,"\mathsf{Bag}(\partial)"]
  & \mathsf{Bag}(\mathcal{F})
\end{tikzcd} --></p>
</section>
<section id="what-is-a-ts-or-why-is-a-do" class="level2" data-number="3">
<h2 data-number="3" data-anchor-id="what-is-a-ts-or-why-is-a-do"><span class="header-section-number">3</span> What is a TS? (or: <em>Why</em> is a DO?)</h2>
<p>So we’ve given a pretty unintuitive definition of an algebra over a double operad, but why? This is where the attitude comes in, by defining some terminology.</p>
<ul>
<li><p>Objects in <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BS%7D"> are called <strong>systems</strong>, and the morphisms are called <strong>morphisms of systems</strong>. Don’t worry too much about what the word “system” means here. Think of this as a classic nLab-style definition: a system is just an object in the category of systems.</p></li>
<li><p>Objects in <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BF%7D"> are called <strong>interfaces</strong>; the functor <img src="https://latex.codecogs.com/png.latex?%5Cpartial"> takes a system to its interface, which can be thought of as its “boundary”, or as the part of the system that other systems can see and interact with.</p></li>
<li><p>Objects in <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BA%7D"> are called <strong>interactions</strong>, which take a whole bag<sup>1</sup> of interfaces as an input and a single interface as an output and tell us what the composition should be. (This part is just like how an algebra for an operad tells me about composition.)</p></li>
<li><p>The functor <img src="https://latex.codecogs.com/png.latex?c%5Ccolon%5Cmathcal%7BP%7D%5Cto%5Cmathcal%7BS%7D"> is called the <strong>composition map</strong>. It takes a bag of systems and an interaction that can take their interfaces as input (i.e.&nbsp;the pullback <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BP%7D">) and returns a system; the diagram commuting tells us that the system it returns has precisely the interface specified by the interaction pattern.</p></li>
</ul>
</section>
<section id="double-theories-give-dots" class="level2" data-number="4">
<h2 data-number="4" data-anchor-id="double-theories-give-dots"><span class="header-section-number">4</span> Double theories give DOTS</h2>
<p>Recall <span class="citation" data-cites="LP2023">(Lambert and Patterson 2023)</span> that a <strong>double theory</strong> <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BT%7D"> is simply a double category “with an attitude”, where that attitude is that we should be interested in its <strong>models</strong>, i.e.&nbsp;(lax) double functors <img src="https://latex.codecogs.com/png.latex?M%5Ccolon%5Cmathbb%7BT%7D%5Cto%5Cmathbb%7BS%7D%5Cmathsf%7Bpan%7D(%5Cmathsf%7BSet%7D)">.</p>
<p>It turns out that any double theory <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BT%7D"> gives rise to a DOTS by looking at its models, in the following way:</p>
<ol type="1">
<li>The three categories:
<ul>
<li><img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BS%7D"> is the category of pairs of models of <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BT%7D"></li>
<li><img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BF%7D"> is the category of models of <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BT%7D"></li>
<li><img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BA%7D"> is the category of <strong>multi-cospans in <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BF%7D"></strong>, i.e.&nbsp;an object is of the form <img src="https://latex.codecogs.com/png.latex?%0A%20%20%20%20(M_i%20%5Crightarrow%20N%20%5Cleftarrow%20L)_%7Bi=1,%5Cldots,n%7D%0A%20%20"> for some <img src="https://latex.codecogs.com/png.latex?n%5Cin%5Cmathbb%7BN%7D">.</li>
</ul></li>
<li>The functor <img src="https://latex.codecogs.com/png.latex?%5Cpartial%5Ccolon%5Cmathcal%7BS%7D%5Cto%5Cmathcal%7BF%7D"> is given by projection onto the second component. This means that we might as well write the objects of <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BS%7D"> as <img src="https://latex.codecogs.com/png.latex?(M,%5Cpartial%20M)">.</li>
<li>The left leg (resp. right leg) of the span <img src="https://latex.codecogs.com/png.latex?%5Cmathsf%7BBag%7D(%5Cmathcal%7BF%7D)%5Cleftarrow%5Cmathcal%7BA%7D%5Crightarrow%5Cmathcal%7BF%7D"> is given by the source map (resp. target map) of the multi-cospans.</li>
<li>The functor <img src="https://latex.codecogs.com/png.latex?c%5Ccolon%5Cmathcal%7BP%7D%5Cto%5Cmathcal%7BS%7D"> is given by taking the colimit.</li>
<li>Everything just works I promise.<sup>2</sup></li>
</ol>
<p>This is a very particular kind of DOTS, known as a <strong>colimit</strong> DOTS (because <img src="https://latex.codecogs.com/png.latex?c=%5Coperatorname%7Bcolim%7D">).</p>
</section>
<section id="so-which-for-what" class="level2" data-number="5">
<h2 data-number="5" data-anchor-id="so-which-for-what"><span class="header-section-number">5</span> So which for what?</h2>
<p>Although double theories give specific examples of DOTS<sup>3</sup>, studying them in their own right is still interesting. One thing that is particularly powerful about double theories and their models is that we can cleanly peel apart “shape” and “meaning” (syntax and semantics). For example, a really nice thing about basing CatColab to on the language of models of double theories is that we get this separation: I can build a causal loop diagram, and then <em>afterwards</em> decide if I want to interpret the objects and arrows as defining some linear system of ODEs.<sup>4</sup></p>
<p>However, DOTS lets us specify interaction patterns (and thus compositions) much more flexibly, and talk about systems that don’t “look like categories”. This is something that double theories struggle with, since the simplest double theory — the point — already has categories as its models.</p>



</section>


<script defer="" src="https://comments.topos.institute/comentario.js"></script>

<div id="quarto-appendix" class="default"><section class="quarto-appendix-contents" id="quarto-bibliography"><h2 class="anchored quarto-appendix-heading">References</h2><div id="refs" class="references csl-bib-body hanging-indent" data-entry-spacing="0">
<div id="ref-CP2025" class="csl-entry">
Carlson, Kevin, and Evan Patterson. 2025. <span>“Instances of Models of Double-Categorical Theories.”</span> <a href="https://arxiv.org/abs/2510.08861">https://arxiv.org/abs/2510.08861</a>.
</div>
<div id="ref-LP2023" class="csl-entry">
Lambert, Michael, and Evan Patterson. 2023. <span>“Cartesian Double Theories: A Double-Categorical Framework for Categorical Doctrines.”</span> <a href="https://arxiv.org/abs/2310.05384">https://arxiv.org/abs/2310.05384</a>.
</div>
<div id="ref-LBPF2021" class="csl-entry">
Libkind, Sophie, Andrew Baas, Evan Patterson, and James Fairbanks. 2021. <span>“Operadic Modeling of Dynamical Systems: Mathematics and Computation.”</span> <a href="https://arxiv.org/abs/2105.12282">https://arxiv.org/abs/2105.12282</a>.
</div>
<div id="ref-LM2025" class="csl-entry">
Libkind, Sophie, and David Jaz Myers. 2025. <span>“Towards a Double Operadic Theory of Systems.”</span> <a href="https://arxiv.org/abs/2505.18329">https://arxiv.org/abs/2505.18329</a>.
</div>
</div></section><section id="footnotes" class="footnotes footnotes-end-of-document"><h2 class="anchored quarto-appendix-heading">Footnotes</h2>

<ol>
<li id="fn1"><p>Instead of talking about bags we could just say that everything is symmetric monoidal, and that the <img src="https://latex.codecogs.com/png.latex?n">-ary interactions come from the monoidal structure. But bags are neat because they’re the free symmetric monoidal widget, and then we don’t have to worry about all our functors being monoidal or anything like that.↩︎</p></li>
<li id="fn2"><p>This is my attempt at a more honest “this proof is left as an exercise for the reader”. Also, I never told you what the coherences we had to check were anyway. Really, the answer is “refer to <span class="citation" data-cites="LM2025">(Libkind and Myers 2025)</span>”.↩︎</p></li>
<li id="fn3"><p>In fact, what I’ve sketched out here is just one way of many (i.e.&nbsp;at least two) that they can do so.↩︎</p></li>
<li id="fn4"><p>See e.g.&nbsp;the <a href="https://catcolab.org/help/logics/causal-loop">CatColab causal loop diagram documentation</a>, which describes two different ODE semantics: linear and Lotka–Volterra.↩︎</p></li>
</ol>
</section></div> ]]></description>
  <category>double categories</category>
  <category>category theory</category>
  <category>systems theory</category>
  <guid>https://topos.institute/blog/2025-11-07-dots-from-double-theories/</guid>
  <pubDate>Fri, 07 Nov 2025 00:00:00 GMT</pubDate>
</item>
<item>
  <title>Blog / Open position: Director of UK Operations</title>
  <dc:creator>Tim Hosgood</dc:creator>
  <link>https://topos.institute/blog/2025-10-07-director-of-uk-operations/</link>
  <description><![CDATA[ 





<p>Like an aspiring <a href="https://www.youtube.com/watch?v=mSB71jNq-yQ">superb lyrebird</a> who’s just a bit slow, I find myself echoing the call of Brendan <a href="../../blog/2022-05-20-operations-job-advert">almost three and a half years ago</a>:</p>
<blockquote class="blockquote">
<p>In a research-focussed organisation, researchers often emerge as the stars. After all, they develop the breakthrough ideas, write the papers, prototype the technologies — and they are the most visible, meeting other experts and giving public talks. Topos, however, is more than just a collection of researchers: we are a community pioneering a new, international, and interdisciplinary tech organisation. We do this to help create a future where the systems around us, large and small, allow every member of society to flourish.</p>
<p>As we explore in our research, healthy systems require careful balancing of each part and the ways they fit together, communicate, and evolve. While our researchers study the fundamental nature of these ideas and how they inform construction of powerful and prosocial technologies, it’s our operations team that embodies this work day-in-day-out at Topos.</p>
</blockquote>
<p>I’ve been working for the past two years on setting up an office based in Oxford, UK. This has been made possible, of course, only by the help of an incredible research team here — <a href="../../people/david-jaz">David Jaz</a>, <a href="../../people/owen-lynch">Owen Lynch</a>, <a href="../../people/xiaoyan-li">Xiaoyan Li</a>, <a href="../../people/jason-brown">Jason Brown</a>, and <a href="../../people/jose-siqueira">José Siqueira</a> — but importantly also by our wonderful operations and administration group: <a href="../../people/beth-williams">Beth Williams</a>, <a href="../../people/molly-white">Molly White</a>, <a href="../../people/tish-tanski">Tish Tanski</a> (and external help from the team at <a href="https://impact-ops.org">Impact Ops</a>); all supported by <a href="../../people/brendan-fong">Brendan Fong</a>. I’m incredibly grateful to all these people (and more) for trusting me with this role, but now we’ve reached a point where operations, finance, systems, strategy, culture need a dedicated senior UK lead, so we’re launching a call for a <strong>Director of UK Operations</strong>.</p>
<p><a href="../../community/jobs/uk-2025-ops" class="btn btn-outline-secondary">Call for applications: Director of UK Operations</a></p>
<p><strong>Applications close on the 20th of October</strong>. You can find all the information in the call for applications, as well as details on how to apply. If you know anybody who might be interested, then please do forward on the link!</p>
<p><em>p.s. I’m not leaving Topos, just partially sidestepping into some different responsibilities here. #newyearnewyou</em></p>



<script defer="" src="https://comments.topos.institute/comentario.js"></script>

 ]]></description>
  <category>Topos</category>
  <category>hiring</category>
  <guid>https://topos.institute/blog/2025-10-07-director-of-uk-operations/</guid>
  <pubDate>Tue, 07 Oct 2025 00:00:00 GMT</pubDate>
  <media:content url="https://topos.institute/blog/2025-10-07-director-of-uk-operations/menura-superba.jpg" medium="image" type="image/jpeg"/>
</item>
<item>
  <title>Blog / Free PLTL algebras and a coalgebraic extension of hyperdoctrines</title>
  <dc:creator>Q Le</dc:creator>
  <link>https://topos.institute/blog/2025-09-26-free-pltl-algebras-and-hyperdoctrines/</link>
  <description><![CDATA[ 





<div class="callout callout-style-simple callout-none no-icon">
<div class="callout-body d-flex">
<div class="callout-icon-container">
<i class="callout-icon no-icon"></i>
</div>
<div class="callout-body-container">
<p><em>Communicated by <a href="../../people/jose-siqueira">José Siqueira</a>.</em></p>
<p>This summer, Q joined us as a summer research intern as part of a joint project with the Mathematics Department at the University of Oxford, co-supervised by Kobi Kremnizer. This blog post is a brief summary of some of the work that they did with us.</p>
</div>
</div>
</div>
<section id="introduction" class="level2" data-number="1">
<h2 data-number="1" data-anchor-id="introduction"><span class="header-section-number">1</span> Introduction</h2>
<p>Time was. Time is. Time will be.</p>
<p>Time is a concept embedded in our reality. Yet, when we consider the truth of statements, the logics we conceive might not have temporal aspects. Whether in propositional logic, predicate logic or epistemic logic, once a statement holds, it holds <em>forever</em>, no matter the time or the place.</p>
<p>But there are times and places when and where this is not true. Though the statement “it is raining” might not be true now, it might be true the <em>next</em> day. And if you are outside tomorrow, soaking in the rain, the statement “Rain is hitting you” might only hold <em>until</em> you arrive home.</p>
<p>Though many logics do not have the ability to describe these time-dependent statements, a family of modal logics do, known as <strong>temporal logics</strong>. There are many types of temporal logic: interval temporal logic <span class="citation" data-cites="DellaMonicaDario2011ITLA MoszkowskiBen2012ACAS">(see Della Monica et al. 2011; also Moszkowski 2012)</span>, Lamport’s temporal logic of actions <span class="citation" data-cites="LamportLeslie1994Ttlo RabinovichA.1998Otot">(see Lamport 1994; also Rabinovich 1998)</span>, computation tree logic <span class="citation" data-cites="reynolds2001">(see Reynolds 2001)</span>, and other possibilities. Each temporal logic is grounded in a specific (philosophical) interpretation of time, contains differing modalities for time, and has numerous applications beyond mathematics and philosophy, such as in the formal verification of computational systems.</p>
<p>As with any logic, a natural question arises: is there a corresponding algebra to it? This question comes from mathematical logic, whereby given a logical theory <img src="https://latex.codecogs.com/png.latex?T">, one asks whether one can construct the Lindenbaum-Tarski algebra <img src="https://latex.codecogs.com/png.latex?A"> induced by <img src="https://latex.codecogs.com/png.latex?T">. When <img src="https://latex.codecogs.com/png.latex?T"> consists of propositional tautologies and the logic is classical, one finds that the Lindenbaum-Tarski algebra is the Boolean algebra. Likewise, if <img src="https://latex.codecogs.com/png.latex?T"> is the theory of intuitionistic logic, then the Lindenbaum-Tarski algebra is the Heyting algebra. We therefore ask: for which temporal logics can we apply Tarski’s method<sup>1</sup> and develop <em>temporal</em> algebras?</p>
<p>In this post, we’ll be focusing on a form of temporal logic called propositional linear temporal logic (PLTL), with the hopes of upgrading statements (that is, predicates) on interfaces that use classical logic into statements on systems that are time-dependent. To do this, we will work through four key parts:</p>
<ol type="1">
<li><p>We describe the axioms and rules of PLTL. From this, we can develop its theory.</p></li>
<li><p>We develop the category of PLTL algebras, describe the free PLTL algebra of a poset (such as a Boolean or Heyting algebra), and consider the PLTL algebras induced by a monad from this free-forgetful adjunction.</p></li>
<li><p>We tie this into José Siqueira’s recent work <span class="citation" data-cites="SiqueiraJosé2025Dror">(see Siqueira 2025)</span> on hyperdoctrines (which describe underlying logics such as classical or intuitionistic propositional logic), and how to temporalise them using PLTL.</p></li>
<li><p>We give the example of the stream comonad, which describes <img src="https://latex.codecogs.com/png.latex?%5Comega">-sequences, and how to temporalise statements about these sequences.</p></li>
</ol>
</section>
<section id="pltl" class="level2" data-number="2">
<h2 data-number="2" data-anchor-id="pltl"><span class="header-section-number">2</span> PLTL</h2>
<p>Let us introduce PLTL, as described in <span class="citation" data-cites="reynolds2001">Reynolds (2001)</span>.</p>
<section id="axioms-and-rules-of-pltl" class="level3" data-number="2.1">
<h3 data-number="2.1" data-anchor-id="axioms-and-rules-of-pltl"><span class="header-section-number">2.1</span> Axioms and Rules of PLTL</h3>
<p>Suppose we have a countable set of atomic propositions, denoted <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BL%7D">. We can then consider all the well-formed formulae constructed from <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BL%7D"> using <img src="https://latex.codecogs.com/png.latex?%5Ctop,%20%5Cneg,%20%5Cland"> (assuming a classical logic), which achieves the propositional part of PLTL.</p>
<p>Suppose we wish to consider how the truth value of propositions may change over time. How should we interpret time?</p>
<p>One way to view time is as a linear timeline in countably many discrete steps, starting from the present and heading to the future. We observe this as a <img src="https://latex.codecogs.com/png.latex?%5Comega">-sequence <img src="https://latex.codecogs.com/png.latex?w"> of time instants <img src="https://latex.codecogs.com/png.latex?w_i"> for <img src="https://latex.codecogs.com/png.latex?i%20%5Cin%20%5Cmathbb%7BN%7D">, where <img src="https://latex.codecogs.com/png.latex?w_0"> marks the present moment.</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><a href="image1.png" class="lightbox" data-gallery="quarto-lightbox-gallery-1" title="Linear time frame of w = \langle w_0, w_1, w_2, w_3, \dots\rangle."><img src="https://topos.institute/blog/2025-09-26-free-pltl-algebras-and-hyperdoctrines/image1.png" height="80" alt="Linear time frame of w = \langle w_0, w_1, w_2, w_3, \dots\rangle." class="figure-img"></a></p>
<figcaption>Linear time frame of <img src="https://latex.codecogs.com/png.latex?w%20=%20%5Clangle%20w_0,%20w_1,%20w_2,%20w_3,%20%5Cdots%5Crangle">.</figcaption>
</figure>
</div>
<p>At each time instant <img src="https://latex.codecogs.com/png.latex?w_i">, we evaluate whether a proposition is true or not at that instant. We also consider how the future looks <em>from</em> <img src="https://latex.codecogs.com/png.latex?w_i">: this leads to defining the notation <img src="https://latex.codecogs.com/png.latex?w_%7B%5Cgeq%20i%7D%20=%20%5Clangle%20w_i,%20w_%7Bi+1%7D,%20w_%7Bi+2%7D,%20%5Cdots%20%5Crangle">, which is simply the linear timeline <img src="https://latex.codecogs.com/png.latex?w"> starting from time instant <img src="https://latex.codecogs.com/png.latex?w_i">. Thus, we formally view <img src="https://latex.codecogs.com/png.latex?w_i"> as the subset of well-formed PLTL formulae which are true at that time instant.</p>
<p>We introduce two temporal connectives alongside the two classical connectives <img src="https://latex.codecogs.com/png.latex?%5Cneg"> and <img src="https://latex.codecogs.com/png.latex?%5Cland">: <img src="https://latex.codecogs.com/png.latex?X">, a unary operator denoting the <em>neXt</em> time instant, and <img src="https://latex.codecogs.com/png.latex?U">, a binary operator where <img src="https://latex.codecogs.com/png.latex?%5Calpha%20U%20%5Cbeta"> denotes <img src="https://latex.codecogs.com/png.latex?%5Calpha"> holding <img src="https://latex.codecogs.com/png.latex?%5Cbeta">, from which we can recursively build well-formed formulae of PLTL from <img src="https://latex.codecogs.com/png.latex?%5Ctop"> and the atomic propositions in <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BL%7D">.</p>
<p>The truth of a PLTL formula is evaluated at these <img src="https://latex.codecogs.com/png.latex?%5Comega">-sequences. We define <img src="https://latex.codecogs.com/png.latex?w%20%5CvDash%20%5Calpha"> if and only if the formula <img src="https://latex.codecogs.com/png.latex?%5Calpha"> is true of the sequence <img src="https://latex.codecogs.com/png.latex?w"> by recursion:</p>
<ul>
<li><img src="https://latex.codecogs.com/png.latex?w%20%5CvDash%20%5Ctop">,</li>
<li><img src="https://latex.codecogs.com/png.latex?w%20%5CvDash%20p"> if and only if <img src="https://latex.codecogs.com/png.latex?p%20%5Cin%20w_0">, for any atomic <img src="https://latex.codecogs.com/png.latex?p%20%5Cin%20%5Cmathcal%7BL%7D">,</li>
<li><img src="https://latex.codecogs.com/png.latex?w%20%5CvDash%20%5Cneg%20%5Calpha"> if and only if <img src="https://latex.codecogs.com/png.latex?w%20%5Cnot%20%5CvDash%20%5Calpha">,</li>
<li><img src="https://latex.codecogs.com/png.latex?w%20%5CvDash%20%5Calpha%20%5Cland%20%5Cbeta"> if and only if <img src="https://latex.codecogs.com/png.latex?w%20%5CvDash%20%5Calpha"> and <img src="https://latex.codecogs.com/png.latex?w%20%5CvDash%20%5Cbeta">,</li>
<li><img src="https://latex.codecogs.com/png.latex?w%20%5CvDash%20X%5Calpha"> if and only if <img src="https://latex.codecogs.com/png.latex?w_%7B%5Cgeq%201%7D%20%5CvDash%20%5Calpha">,</li>
<li><img src="https://latex.codecogs.com/png.latex?w%20%5CvDash%20%5Calpha%20U%20%5Cbeta"> if and only if there is some <img src="https://latex.codecogs.com/png.latex?i%20%5Cgeq%200"> such that <img src="https://latex.codecogs.com/png.latex?w_%7B%5Cgeq%20i%7D%20%5CvDash%20%5Cbeta"> and for each <img src="https://latex.codecogs.com/png.latex?0%20%5Cleq%20j%20%3C%20i">, <img src="https://latex.codecogs.com/png.latex?w_%7B%5Cgeq%20j%7D%20%5CvDash%20%5Calpha">.</li>
</ul>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><a href="image2.png" class="lightbox" data-gallery="quarto-lightbox-gallery-2" title="A linear time frame w in which w \vDash \alpha, w \vDash X \alpha and w \vDash \alpha U \beta."><img src="https://topos.institute/blog/2025-09-26-free-pltl-algebras-and-hyperdoctrines/image2.png" height="100" alt="A linear time frame w in which w \vDash \alpha, w \vDash X \alpha and w \vDash \alpha U \beta." class="figure-img"></a></p>
<figcaption>A linear time frame <img src="https://latex.codecogs.com/png.latex?w"> in which <img src="https://latex.codecogs.com/png.latex?w%20%5CvDash%20%5Calpha">, <img src="https://latex.codecogs.com/png.latex?w%20%5CvDash%20X%20%5Calpha"> and <img src="https://latex.codecogs.com/png.latex?w%20%5CvDash%20%5Calpha%20U%20%5Cbeta">.</figcaption>
</figure>
</div>
<p>We then define satisfiablity and logical validity, <img src="https://latex.codecogs.com/png.latex?%5CvDash_%7BPL%7D%20%5Calpha">, as usual. We also define two derived temporal connectives: <img src="https://latex.codecogs.com/png.latex?F%20%5Calpha%20=%20%5Ctop%20U%20%5Calpha"> for a future operator and <img src="https://latex.codecogs.com/png.latex?G%20%5Calpha%20=%20%5Cneg%20F%20%5Cneg%20%5Calpha"> for a guarantee/global operator.</p>
<p>There is also, of course, a syntactic side to this story<sup>2</sup>; what we just described is a sound and complete semantics for the associated notion of proof (<span class="citation" data-cites="reynolds2001">Reynolds (2001)</span>). We use this deductive system to define a notion of derivability <img src="https://latex.codecogs.com/png.latex?%5Cvdash_%7BPL%7D"> in the usual manner.</p>
</section>
<section id="free-forgetful-adjunctions-of-algebras-and-posets" class="level3" data-number="2.2">
<h3 data-number="2.2" data-anchor-id="free-forgetful-adjunctions-of-algebras-and-posets"><span class="header-section-number">2.2</span> Free-Forgetful Adjunctions of Algebras and (Po)Sets</h3>
<p>Let us observe the following adjunctions and the fact that Boolean algebras and Heyting algebras may be seen as the respective algebras for classical and intuitionistic logic:</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><a href="image3.png" class="lightbox" data-gallery="quarto-lightbox-gallery-3" title="The free-forgetful adjunctions between \textbf{Set}, \textbf{BoolAlg}, and \textbf{HeyAlg}."><img src="https://topos.institute/blog/2025-09-26-free-pltl-algebras-and-hyperdoctrines/image3.png" height="100" alt="The free-forgetful adjunctions between \textbf{Set}, \textbf{BoolAlg}, and \textbf{HeyAlg}." class="figure-img"></a></p>
<figcaption>The free-forgetful adjunctions between <img src="https://latex.codecogs.com/png.latex?%5Ctextbf%7BSet%7D">, <img src="https://latex.codecogs.com/png.latex?%5Ctextbf%7BBoolAlg%7D">, and <img src="https://latex.codecogs.com/png.latex?%5Ctextbf%7BHeyAlg%7D">.</figcaption>
</figure>
</div>
<p>One may ask for an analogy with PLTL. To this aim, we must answer what a PLTL algebra is, what the morphisms between PLTL algebras are, and what the free construction of a PLTL algebra looks like on a poset. This will allow us to consider PLTL algebras as a category, which we can use to temporalise statements later!</p>
<section id="what-is-a-pltl-algebra" class="level4" data-number="2.2.1">
<h4 data-number="2.2.1" data-anchor-id="what-is-a-pltl-algebra"><span class="header-section-number">2.2.1</span> What is a PLTL Algebra?</h4>
<p>We fix a signature <img src="https://latex.codecogs.com/png.latex?%5CSigma_%7BPL%7D"> with constants <img src="https://latex.codecogs.com/png.latex?%5Cbot,%20%5Ctop">, unary operators <img src="https://latex.codecogs.com/png.latex?%5Cneg,%20X">, and binary operators <img src="https://latex.codecogs.com/png.latex?%5Cland,%20U">. We can then define a theory <img src="https://latex.codecogs.com/png.latex?T_P"> for PLTL as consisting of a bounded distributive lattice with complements with imposed inequalities corresponding to our axiom schema for PLTL<sup>3</sup>.</p>
<p>With this theory <img src="https://latex.codecogs.com/png.latex?T_P">, we can then define the category of PLTL algebras, <img src="https://latex.codecogs.com/png.latex?%5Ctextbf%7BPLTL-Alg%7D">, as the category with:</p>
<ul>
<li>Objects as tuples <img src="https://latex.codecogs.com/png.latex?A%20=%20(%7CA%7C,%20%5Cleq_A;%20%5Cbot%5EA,%20%5Ctop%5EA,%20%5Cneg%5EA,%20X%5EA,%20%5Cland%5EA,%20U%5EA)">, where <img src="https://latex.codecogs.com/png.latex?%7CA%7C"> is a set, <img src="https://latex.codecogs.com/png.latex?(%7CA%7C,%20%5Cleq_A)"> is a poset, and the operators of <img src="https://latex.codecogs.com/png.latex?A"> (including the derived operators <img src="https://latex.codecogs.com/png.latex?F%5EA"> and <img src="https://latex.codecogs.com/png.latex?G%5EA">) satisfy the axioms of <img src="https://latex.codecogs.com/png.latex?T_%7BPL%7D">, and</li>
<li>Morphisms as monotone homomorphisms <img src="https://latex.codecogs.com/png.latex?h:%20A%20%5Crightarrow%20B"> preserving all the symbols, including the derived classical and temporal connectives.</li>
</ul>
<p>It is worth noting a free-forgetful adjunction between <img src="https://latex.codecogs.com/png.latex?%5Ctextbf%7BBoolAlg%7D"> and <img src="https://latex.codecogs.com/png.latex?%5Ctextbf%7BPLTL-Alg%7D">, but we relegate this as an interesting observation.</p>
</section>
<section id="what-is-the-free-pltl-algebra-of-a-poset" class="level4" data-number="2.2.2">
<h4 data-number="2.2.2" data-anchor-id="what-is-the-free-pltl-algebra-of-a-poset"><span class="header-section-number">2.2.2</span> What is the free PLTL algebra of a poset?</h4>
<p>Given a poset <img src="https://latex.codecogs.com/png.latex?(P,%20%5Cleq_1)">, we may view inequalities <img src="https://latex.codecogs.com/png.latex?p%20%5Cleq_1%20q"> as axioms stemming from <img src="https://latex.codecogs.com/png.latex?P">, and so encode the order of <img src="https://latex.codecogs.com/png.latex?P"> by setting <img src="https://latex.codecogs.com/png.latex?%5Ctext%7BTh%7D_P%20%5Ccoloneqq%20%5C%7Bp%20%5Crightarrow%5EP%20q%20:%20p%20%5Cleq_1%20q%20%5C%7D">.</p>
<p>To construct the free PLTL algebra of <img src="https://latex.codecogs.com/png.latex?P">, we perform the Lindenbaum-Tarski method. We first recursively build a set <img src="https://latex.codecogs.com/png.latex?F(P)"> as follows:</p>
<ul>
<li><img src="https://latex.codecogs.com/png.latex?P%20%5Csubseteq%20F(P)">,</li>
<li><img src="https://latex.codecogs.com/png.latex?%5Cphi%20%5Cland%5EP%20%5Cpsi,%20%5Cphi%20U%5EP%20%5Cpsi%20%5Cin%20F(P)"> for <img src="https://latex.codecogs.com/png.latex?%5Cphi,%20%5Cpsi%20%5Cin%20F(P)">,</li>
<li><img src="https://latex.codecogs.com/png.latex?%5Cbot%5EP,%20%5Ctop%5EP%20%5Cin%20F(P)">, and</li>
<li><img src="https://latex.codecogs.com/png.latex?%5Cneg%5EP%20%5Cphi,%20X%5EP%5Cphi%20%5Cin%20F(P)"> for <img src="https://latex.codecogs.com/png.latex?%5Cphi%20%5Cin%20F(P)">.</li>
</ul>
<p>We can then define a new theory <img src="https://latex.codecogs.com/png.latex?T_%7BP%7D%20%5Ccoloneqq%20T_%7BPL%7D%20%5Ccup%20%5Ctext%7BTh%7D_P">, which can be seen as the theory of PLTL combined with the imposed theory from the poset <img src="https://latex.codecogs.com/png.latex?P">.</p>
<p>We can also define an equivalence relation<sup>4</sup> on <img src="https://latex.codecogs.com/png.latex?F(P)"> via <img src="https://latex.codecogs.com/png.latex?%5Cphi%20%5Csim_%7BT_P%7D%20%5Cpsi"> if and only if <img src="https://latex.codecogs.com/png.latex?T_P%20%5Cvdash%20%5Cphi%20%5Cleftrightarrow%5EP%20%5Cpsi"> (that is, if <img src="https://latex.codecogs.com/png.latex?%5Cphi"> and <img src="https://latex.codecogs.com/png.latex?%5Cpsi"> are equivalent in the theory of <img src="https://latex.codecogs.com/png.latex?T_P">).</p>
<p>We thus obtain the Lindenbaum-Tarski algebra of <img src="https://latex.codecogs.com/png.latex?T_P">, denoted by <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BF%7D_%7BPL%7D(P)%20%5Ccoloneqq%20F(P)/%5Csim_%7BT_P%7D">. We can also define an ordering <img src="https://latex.codecogs.com/png.latex?%5Cleq_2"> on <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BF%7D_%7BPL%7D(P)"> via <img src="https://latex.codecogs.com/png.latex?%5B%5Cphi%5D%20%5Cleq_2%20%5B%5Cpsi%5D"> if and only if <img src="https://latex.codecogs.com/png.latex?T_%7BP%7D%20%5Cvdash%20%5Cphi%20%5Crightarrow%5EP%20%5Cpsi">. This makes <img src="https://latex.codecogs.com/png.latex?(%5Cmathcal%7BF%7D_%7BPL%7D(P),%20%5Cleq_2)"> into a poset, and in fact a PLTL-Algebra.</p>
<p>Intuitively, this poset is simply all the well-formed PLTL formulae from a beginning poset of propositions <img src="https://latex.codecogs.com/png.latex?P"> (think classical or intuitionistic propositional logic), quotiented by logical equivalence.</p>
</section>
</section>
<section id="the-eilenberg-moore-category-of-pltl-algebras" class="level3" data-number="2.3">
<h3 data-number="2.3" data-anchor-id="the-eilenberg-moore-category-of-pltl-algebras"><span class="header-section-number">2.3</span> The Eilenberg-Moore Category of PLTL Algebras</h3>
<p>Of course<sup>5</sup>, this construction <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BF%7D_%7BPL%7D:%5Ctextbf%7BPos%7D%20%5Crightarrow%20%5Ctextbf%7BPLTL-Alg%7D"> is functorial, and we may observe the following free-forgetful adjunction:</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><a href="image4.png" class="lightbox" data-gallery="quarto-lightbox-gallery-4" title="The free-forgetful adjunctions between \textbf{Pos} and \textbf{PLTL-Alg}."><img src="https://topos.institute/blog/2025-09-26-free-pltl-algebras-and-hyperdoctrines/image4.png" height="100" alt="The free-forgetful adjunctions between \textbf{Pos} and \textbf{PLTL-Alg}." class="figure-img"></a></p>
<figcaption>The free-forgetful adjunctions between <img src="https://latex.codecogs.com/png.latex?%5Ctextbf%7BPos%7D"> and <img src="https://latex.codecogs.com/png.latex?%5Ctextbf%7BPLTL-Alg%7D">.</figcaption>
</figure>
</div>
<p>From this adjunction, we obtain a monad <img src="https://latex.codecogs.com/png.latex?(M,%20%5Ceta%5EM,%20%5Cmu%5EM)">, where: * <img src="https://latex.codecogs.com/png.latex?M%20%5Ccoloneq%20%5Cmathcal%7BU%7D_%7BPL%7D%5Cmathcal%7BF%7D_%7BPL%7D"> sends a poset <img src="https://latex.codecogs.com/png.latex?P"> to a poset corresponding to the free PLTL algebra of <img src="https://latex.codecogs.com/png.latex?P">; * <img src="https://latex.codecogs.com/png.latex?%5Ceta%5EM"> is the unit that sends <img src="https://latex.codecogs.com/png.latex?p"> to <img src="https://latex.codecogs.com/png.latex?%5Bp%5D">; and, * <img src="https://latex.codecogs.com/png.latex?%5Cmu%5EM"> is the multiplication that maps a formula-of-formulae to a formula.</p>
<p>It is worth explaining <img src="https://latex.codecogs.com/png.latex?%5Cmu%5EM"> further with some examples. First, observe that elements of <img src="https://latex.codecogs.com/png.latex?M%5E2(P)"> are equivalence classes of PLTL formulae, generated by elements of <img src="https://latex.codecogs.com/png.latex?M(P)">, which are themselves equivalence classes <img src="https://latex.codecogs.com/png.latex?%5B%5Cphi%5D"> of PLTL formulae over <img src="https://latex.codecogs.com/png.latex?P">. Examples include:</p>
<ul>
<li><img src="https://latex.codecogs.com/png.latex?%5B(%5BX%5Cphi%5D%20%5Cland%20%5B%5Cpsi%5D)%20U%20%5BX%5Cchi%5D%5D"></li>
<li><img src="https://latex.codecogs.com/png.latex?%5B%5B%5Calpha%5D%20%5Clor%20%5BG%5Cbeta%5D%20%5Clor%20%5B%5Cgamma%5D%5D"></li>
<li><img src="https://latex.codecogs.com/png.latex?%5BG(%5B%5CvarPhi%5D%20U%20%5BG%5CvarPsi%5D)%20%5Crightarrow%20%5Cneg%20X%20%5B%5CvarXi%5D%5D">.</li>
</ul>
<p>Intuitively, <img src="https://latex.codecogs.com/png.latex?%5Cmu%5EM"> collapses a formula-of-formulae into a formula by interpreting each inner equivalence class <img src="https://latex.codecogs.com/png.latex?%5B%5Cvarphi%5D"> as any element of <img src="https://latex.codecogs.com/png.latex?%5B%5Cvarphi%5D">, such as <img src="https://latex.codecogs.com/png.latex?%5Cvarphi">, in <img src="https://latex.codecogs.com/png.latex?M(P)">, then evaluating the formula as an equivalence class. For example, with the first example above:</p>
<ul>
<li>The constants are <img src="https://latex.codecogs.com/png.latex?%5BX%20%5Cphi%5D,%20%5B%5Cpsi%5D,%20%5BX%5Cchi%5D%20%5Cin%20M(P)">.</li>
<li>Applying <img src="https://latex.codecogs.com/png.latex?%5Cmu_P%5EM">, we map each inner equivalence class <img src="https://latex.codecogs.com/png.latex?%5B%5Cvarphi%5D"> to an element of <img src="https://latex.codecogs.com/png.latex?%5B%5Cvarphi%5D">, such as <img src="https://latex.codecogs.com/png.latex?%5Cvarphi">. Thus, <img src="https://latex.codecogs.com/png.latex?%5BX%20%5Cphi%5D%20%5Cmapsto%20X%5Cphi,%20%5B%5Cpsi%5D%20%5Cmapsto%20%5Cpsi,%20%5BX%5Cchi%5D%20%5Cmapsto%20X%5Cchi">.</li>
<li>Then, we evaluate this as an equivalence class, so:</li>
</ul>
<p><img src="https://latex.codecogs.com/png.latex?%0A%5Cmu_P%5EM%5Cbig(%5B(%5BX%5Cphi%5D%20%5Cland%20%5B%5Cpsi%5D)%20U%20%5BX%5Cchi%5D%5D%5Cbig)%20=%20%20%5B(X%5Cphi%20%5Cland%20%5Cpsi)%20U%20(X%5Cchi)%5D%20%5Cin%20M(P).%0A"></p>
<p>Similarly, <img src="https://latex.codecogs.com/png.latex?%0A%5Cmu_P%5EM%5Cbig(%5B%5B%5Calpha%5D%20%5Clor%20%5BG%5Cbeta%5D%20%5Clor%20%5B%5Cgamma%5D%5D%5Cbig)%20=%20%5B%5Calpha%20%5Clor%20G%5Cbeta%20%5Clor%20%5Cgamma%5D%0A"> and <img src="https://latex.codecogs.com/png.latex?%0A%5Cmu_P%5EM%5Cbig(%5BG(%5B%5CvarPhi%5D%20U%20%5BG%5CvarPsi%5D)%20%5Crightarrow%20%5Cneg%20X%20%5B%5CvarXi%5D%5D%5Cbig)%20=%20%5BG(%5CvarPhi%20U%20(G%20%5CvarPsi))%20%5Crightarrow%20%5Cneg%20X%5CvarXi%5D.%0A"></p>
<p>That this works is because the equivalence class of a formula-of-formulae in <img src="https://latex.codecogs.com/png.latex?M%5E2(P)"> does not depend on the choice of representatives of the inner equivalence classes.</p>
<p>As with any free-forgetful adjunction, we may now consider the Eilenberg-Moore category <img src="https://latex.codecogs.com/png.latex?%5Ctextbf%7BPos%7D%5EM"> induced by this monad <img src="https://latex.codecogs.com/png.latex?(M,%20%5Ceta%5EM,%20%5Cmu%5EM)">, whose objects are <img src="https://latex.codecogs.com/png.latex?M">-algebras <img src="https://latex.codecogs.com/png.latex?(P,%20v%5EP:MP%20%5Crightarrow%20P)">.</p>
<p>One may understand an object <img src="https://latex.codecogs.com/png.latex?(P,%20v%5EP)"> of <img src="https://latex.codecogs.com/png.latex?%5Ctextbf%7BPos%7D%5EM"> as a poset equipped with an interpretation map, where the generators of <img src="https://latex.codecogs.com/png.latex?MP"> (so the elements of <img src="https://latex.codecogs.com/png.latex?P">) are interpretated as themselves and a consistent interpretation is chosen for formulae, subject to the requirement that evaluating these formulae respects substitution.</p>
<p>One can then prove an equivalence between <img src="https://latex.codecogs.com/png.latex?%5Ctextbf%7BPLTL-Alg%7D"> and <img src="https://latex.codecogs.com/png.latex?%5Ctextbf%7BPos%7D%5EM">, thus showing a PLTL algebra is practically the same as an <img src="https://latex.codecogs.com/png.latex?M">-algebra.</p>
</section>
<section id="hyperdoctrines-and-temporalisation" class="level3" data-number="2.4">
<h3 data-number="2.4" data-anchor-id="hyperdoctrines-and-temporalisation"><span class="header-section-number">2.4</span> Hyperdoctrines and Temporalisation</h3>
<p>Here is how everything relates to José’s work <span class="citation" data-cites="SiqueiraJosé2025Dror">(see Siqueira 2025)</span>!</p>
<p>Suppose the following set-up:</p>
<ul>
<li><img src="https://latex.codecogs.com/png.latex?I"> is a comonad on <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BC%7D">, so <img src="https://latex.codecogs.com/png.latex?I%5E%7B%5Ctext%7Bop%7D%7D"> is a monad on <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BC%7D%5E%7B%5Ctext%7Bop%7D%7D">,</li>
<li><img src="https://latex.codecogs.com/png.latex?L"> is a monad on <img src="https://latex.codecogs.com/png.latex?%5Ctextbf%7BPos%7D">, which represents a modality acting on <img src="https://latex.codecogs.com/png.latex?%5Ctextbf%7BPos%7D"> such as <img src="https://latex.codecogs.com/png.latex?M">, and</li>
<li><img src="https://latex.codecogs.com/png.latex?P:%5Cmathcal%7BC%7D%5E%5Ctext%7Bop%7D%20%5Crightarrow%20%5Ctextbf%7BPos%7D"> is a hyperdoctrine. That is, a functor to <img src="https://latex.codecogs.com/png.latex?%5Ctextbf%7BPos%7D"> that encodes a flavour of logic, such as classical or intuitionistic propositional logic.</li>
</ul>
<p>In his recent work, José Siqueira proved that (regular) hyperdoctrines are the same as symmetric monoidal double functors <img src="https://latex.codecogs.com/png.latex?%0A%5Cmathbf%7B%5Cmathbb%7BS%7Dpan%7D(%5Cmathcal%7BC%7D)%5E%7B%5Ctext%7Bop%7D%7D%20%5Crightarrow%20%5Cmathbb%7BQ%7D%5Cmathbf%7Bt%7D(%5Ctextbf%7BPos%7D)%0A"> with a companion commuter property. Further, we know that the 2-category <img src="https://latex.codecogs.com/png.latex?%5Ctextbf%7BDbl%7D%5E%7B%5Ctext%7Bps%7D%7D"> admits the construction of algebras; i.e, the inclusion <img src="https://latex.codecogs.com/png.latex?%0A%5Ciota:%20%5Ctextbf%7BDbl%7D%5E%7B%5Ctext%7Bps%7D%7D%20%5Chookrightarrow%20%5Ctext%7BMnd%7D(%5Ctextbf%7BDbl%7D%5E%7B%5Ctext%7Bps%7D%7D)%0A"> has a right adjoint <img src="https://latex.codecogs.com/png.latex?%0A%5Ctextbf%7B$%5Cmathbb%7BA%7D$lg%7D(-)%20:%5Ctext%7BMnd%7D(%5Ctextbf%7BDbl%7D%5E%7B%5Ctext%7Bps%7D%7D)%20%5Crightarrow%20%5Ctextbf%7BDbl%7D%5E%7B%5Ctext%7Bps%7D%7D%0A"> where <img src="https://latex.codecogs.com/png.latex?%5Ctext%7BMnd%7D(%5Ctextbf%7BDbl%7D%5E%7B%5Ctext%7Bps%7D%7D)"> is the 2-category whose:</p>
<ul>
<li>objects are monads in the 2-category <img src="https://latex.codecogs.com/png.latex?%5Ctextbf%7BDbl%7D%5E%7B%5Ctext%7Bps%7D%7D">, i.e monads on double categories with respect to pseudo double functors and tight transformations;</li>
<li>1-cells are lax morphisms of such monads;</li>
<li>2-cells are 2-morphisms of monads.</li>
</ul>
<p>Now, if <img src="https://latex.codecogs.com/png.latex?I"> preserves pullbacks, then <img src="https://latex.codecogs.com/png.latex?I%5E%7B%5Ctext%7Bop%7D%7D"> induces a monad on the double category of spans over <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BC%7D"> via the span construction: <img src="https://latex.codecogs.com/png.latex?%0AI%5E%5Cbullet:%5Cmathbb%7BS%7D%5Ctextbf%7Bpan%7D(%5Cmathcal%7BC%7D)%5E%7B%5Ctext%7Bop%7D%7D%20%5Chookrightarrow%20%5Cmathbb%7BS%7D%5Ctextbf%7Bpan%7D(%5Cmathcal%7BC%7D)%5E%7B%5Ctext%7Bop%7D%7D.%0A"></p>
<p>Similarly, we get an induced monad <img src="https://latex.codecogs.com/png.latex?L%5E%5Cbullet:%5Cmathbf%7B%5Cmathbb%7BQ%7Dt%7D(%5Ctextbf%7BPos%7D)%20%5Crightarrow%20%5Cmathbf%7B%5Cmathbb%7BQ%7Dt%7D(%5Ctextbf%7BPos%7D)"> in <img src="https://latex.codecogs.com/png.latex?%5Ctextbf%7BDbl%7D%5E%7B%5Ctext%7Bps%7D%7D">. Then, we get a pseudo double functor <img src="https://latex.codecogs.com/png.latex?%0A%5Ctextbf%7B$%5Cmathbb%7BA%7D$lg%7D(I%5E%5Cbullet)%20%5Crightarrow%20%5Ctextbf%7B$%5Cmathbb%7BA%7D$lg%7D(L%5E%5Cbullet)%0A"> whenever we have a map of monads from <img src="https://latex.codecogs.com/png.latex?I%5E%7Bop%7D"> to <img src="https://latex.codecogs.com/png.latex?L"> by the 2-functoriality of <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BA%7Dlg(-)">.</p>
<p>It is also known that <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BS%7D%5Ctextbf%7Bpan%7D(%5Ctext%7BCoalg%7D(I))%5E%7B%5Ctext%7Bop%7D%7D%20%5Csimeq%20%5Cmathbb%7BA%7D%5Ctextbf%7Blg%7D(I%5E%5Cbullet)">. Therefore, a map of monads <img src="https://latex.codecogs.com/png.latex?P"> from <img src="https://latex.codecogs.com/png.latex?I%5E%7B%5Ctext%7Bop%7D%7D"> on <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BC%7D%5E%7B%5Ctext%7Bop%7D%7D"> to <img src="https://latex.codecogs.com/png.latex?L"> on <img src="https://latex.codecogs.com/png.latex?%5Ctextbf%7BPos%7D"> induces a symmetric monoidal double functor from <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BS%7D%5Cmathbf%7Bpan%7D(%5Cmathcal%7BC%7D)%5E%7B%5Ctext%7Bop%7D%7D"> to <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BQ%7D%5Cmathbf%7Bt%7D(%5Ctextbf%7BPos%7D)">, which is the same as an existential hyperdoctrine. This therefore allows us to consider coalgebras of <img src="https://latex.codecogs.com/png.latex?I"> as contexts for a hyperdoctrine with semantics in <img src="https://latex.codecogs.com/png.latex?L">-algebras.</p>
<p>With this result in mind, let us apply this to our situation, in which <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BC%7D%20=%20%5Ctextbf%7BSet%7D">, <img src="https://latex.codecogs.com/png.latex?P%20=%20%5Ctext%7BSub%7D"> is the functor that sends an object to its collection of subobjects in <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BC%7D"> and a morphism <img src="https://latex.codecogs.com/png.latex?f:a%20%5Cto%20b"> in <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BC%7D"> to <img src="https://latex.codecogs.com/png.latex?f%5E%7B-1%7D:%5Ctext%7BSub%7D(B)%20%5Cto%20%5Ctext%7BSub%7D(A)">, and <img src="https://latex.codecogs.com/png.latex?L"> is the monad <img src="https://latex.codecogs.com/png.latex?M"> induced by the free-forgetful adjunction between <img src="https://latex.codecogs.com/png.latex?%5Ctextbf%7BPos%7D"> and <img src="https://latex.codecogs.com/png.latex?%5Ctextbf%7BPLTL-Alg%7D">, with unit <img src="https://latex.codecogs.com/png.latex?%5Ceta%5EM"> and multiplication <img src="https://latex.codecogs.com/png.latex?%5Cmu%5EM"> as before.</p>
<p>The key intuition is to view the comonad <img src="https://latex.codecogs.com/png.latex?I"> on <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BC%7D"> as providing an interface, so that <img src="https://latex.codecogs.com/png.latex?P"> provides a notion of a predicate on this interface. With the result described before, we may then upgrade this predicate to a temporal predicate on systems.</p>
<p>Thus, we ask for which <sup>6</sup> comonads <img src="https://latex.codecogs.com/png.latex?I"> (so interfaces) we can upgrade, given our <img src="https://latex.codecogs.com/png.latex?P"> which provides a notion of predicate (in classical propositional logic). That is, for which <img src="https://latex.codecogs.com/png.latex?I"> is such that there exists a natural transformation <img src="https://latex.codecogs.com/png.latex?%5Clambda:%20MP%20%5Crightarrow%20PI%5E%7B%5Ctext%7Bop%7D%7D"> such that the following diagrams commute:</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><a href="image6.png" class="lightbox" data-gallery="quarto-lightbox-gallery-5" title="The unity law on the left, and the multiplication law on the right"><img src="https://topos.institute/blog/2025-09-26-free-pltl-algebras-and-hyperdoctrines/image6.png" height="140" alt="The unity law on the left, and the multiplication law on the right" class="figure-img"></a></p>
<figcaption>The unity law on the left, and the multiplication law on the right</figcaption>
</figure>
</div>
<p>For us, important examples may come from considering the cofree comonad on various polynomial functors, denoted <img src="https://latex.codecogs.com/png.latex?p"> as defined in <span class="citation" data-cites="LibkindSophie2024Prom">Libkind and Spivak (2024)</span>. Let us consider such an example below.</p>
<section id="the-stream-comonad" class="level4" data-number="2.4.1">
<h4 data-number="2.4.1" data-anchor-id="the-stream-comonad"><span class="header-section-number">2.4.1</span> The Stream Comonad</h4>
<p>Consider the polynomial functor <img src="https://latex.codecogs.com/png.latex?p(X)%20=%20X">, which is the identity functor. The cofree comonad of <img src="https://latex.codecogs.com/png.latex?X"> is the stream comonad <img src="https://latex.codecogs.com/png.latex?I">, where <img src="https://latex.codecogs.com/png.latex?I(A)%20=%20A%5E%5Cmathbb%7BN%7D">, <img src="https://latex.codecogs.com/png.latex?%5Cvarepsilon_A(%5Calpha)%20=%20%5Calpha(0)">, and <img src="https://latex.codecogs.com/png.latex?%5Cdelta_A(%5Calpha)%20=%20(%5Calpha%5E%7B(k)%7D)_%7Bk%20%5Cin%20%5Cmathbb%7BN%7D%7D">, where <img src="https://latex.codecogs.com/png.latex?%5Calpha%5E%7B(k)%7D(n)%20=%20%5Calpha(n+k)"> for <img src="https://latex.codecogs.com/png.latex?%5Calpha%20%5Cin%20A%5E%5Cmathbb%7BN%7D">. Then, <img src="https://latex.codecogs.com/png.latex?I%5E%7B%5Ctext%7Bop%7D%7D"> becomes a monad on <img src="https://latex.codecogs.com/png.latex?%5Ctextbf%7BSet%7D%5E%7B%5Ctext%7Bop%7D%7D"> with unit <img src="https://latex.codecogs.com/png.latex?%5Ceta_A%5E%7BI%5E%7B%5Ctext%7Bop%7D%7D%7D%20=%20%5Cvarepsilon_A%5E%5Ctext%7Bop%7D"> and multiplication <img src="https://latex.codecogs.com/png.latex?%5Cmu_A%5E%7BI%5E%7B%5Ctext%7Bop%7D%7D%7D%20=%20%5Cdelta_%7BA%7D%5E%7B%5Ctext%7Bop%7D%7D">.</p>
<p>One can then prove that there exists a natural transformation <img src="https://latex.codecogs.com/png.latex?%5Clambda:%20MP%20%5Crightarrow%20PI%5E%7B%5Ctext%7Bop%7D%7D">, such that <img src="https://latex.codecogs.com/png.latex?(P,%20%5Clambda)"> is a morphism of monads from <img src="https://latex.codecogs.com/png.latex?(%5Ctextbf%7BSet%7D%5E%7B%5Ctext%7Bop%7D%7D,%20I%5E%7B%5Ctext%7Bop%7D%7D)"> to <img src="https://latex.codecogs.com/png.latex?(%5Ctextbf%7BPos%7D,%20M)">.</p>
<p>It is worth remarking on the proof, and the fact that, to observe <img src="https://latex.codecogs.com/png.latex?%5Ctext%7BSub%7D(A%5E%5Cmathbb%7BN%7D)"> and <img src="https://latex.codecogs.com/png.latex?%5Ctext%7BSub%7D((A%5E%5Cmathbb%7BN%7D)%5E%5Cmathbb%7BN%7D)"> as PLTL algebras, one needs to evaluate a given PLTL formula as predicates on <img src="https://latex.codecogs.com/png.latex?A%5E%5Cmathbb%7BN%7D"> as follows:</p>
<ul>
<li><img src="https://latex.codecogs.com/png.latex?%5B%5Ctop%5D_A%20=%20A%5E%5Cmathbb%7BN%7D">,</li>
<li><img src="https://latex.codecogs.com/png.latex?%5B%5Cvarphi%20%5Cland%20%5Cpsi%5D_A%20=%20%5B%5Cvarphi%5D_A%20%5Ccap%20%5B%5Cpsi%5D_A">,</li>
<li><img src="https://latex.codecogs.com/png.latex?%5B%5Cvarphi%20U%20%5Cpsi%5D_A%20=%20%5C%7B%20%5Calpha:%20%5Cexists%20k%20%5Cgeq%200,%20%5Calpha%5E%7B(k)%7D%20%5Cin%20%5B%5Cpsi%5D_A%20%5Ctext%7B%20and%20%7D%20%5Cforall%200%20%5Cleq%20j%20%3C%20k,%20%5Calpha%5E%7B(j)%7D%20%5Cin%20%5B%5Cvarphi%5D_A%20%5C%7D">,</li>
<li><img src="https://latex.codecogs.com/png.latex?%5B%5Cneg%20%5Cvarphi%5D_A%20=%20A%5E%5Cmathbb%7BN%7D%20%5Cbackslash%20%5B%5Cvarphi%5D_A">,</li>
<li><img src="https://latex.codecogs.com/png.latex?%5BX%20%5Cvarphi%5D_A%20=%20%5C%7B%20%5Calpha%20:%20%5Calpha%5E%7B(1)%7D%20%5Cin%20%5B%5Cvarphi%5D_A%20%5C%7D">.</li>
</ul>
<p>Here, we interpret each <img src="https://latex.codecogs.com/png.latex?U%20%5Csubseteq%20A"> as predicates about the current stream <img src="https://latex.codecogs.com/png.latex?%5Calpha%5E%7B(0)%7D%20=%20%5Calpha">: that is, we define a current-time predicate <img src="https://latex.codecogs.com/png.latex?%0A%5Ctext%7Bcur%7D%5EA(U)%20%5Ccoloneqq%20%5C%7B%20%5Calpha%20%5Cin%20A%5E%7B%5Cmathbb%7BN%7D%7D%20:%20%5Calpha(0)%20%5Cin%20U%5C%7D%20%5Cin%20%5Ctext%7BSub%7D(A%5E%5Cmathbb%7BN%7D).%0A"> Similarly, for a stream-of-streams <img src="https://latex.codecogs.com/png.latex?%5CSigma%20:%20%5Cmathbb%7BN%7D%20%5Cto%20A%5E%5Cmathbb%7BN%7D">, we may consider each <img src="https://latex.codecogs.com/png.latex?V%20%5Csubseteq%20A%5E%5Cmathbb%7BN%7D"> as predicates regarding the current inner stream, and so define a meta-current-time predicate <img src="https://latex.codecogs.com/png.latex?%0A%5Ctext%7Bcur%7D%5E%7BA%5E%5Cmathbb%7BN%7D%7D(V)%20%5Ccoloneqq%20%5C%7B%20%5CSigma%20%5Cin%20(A%5E%7B%5Cmathbb%7BN%7D%7D)%5E%5Cmathbb%7BN%7D:%20%5CSigma%7B(0)%7D%20%5Cin%20V%5C%7D%20%5Cin%20%5Ctext%7BSub%7D((A%5E%5Cmathbb%7BN%7D)%5E%5Cmathbb%7BN%7D)%0A"> and define PLTL operations accordingly. Equivalently, each fibre <img src="https://latex.codecogs.com/png.latex?%5Ctext%7BSub%7D(A%5E%5Cmathbb%7BN%7D)"> is an <img src="https://latex.codecogs.com/png.latex?M">-algebra with a corresponding map <img src="https://latex.codecogs.com/png.latex?v%5E%7B%5Ctext%7BSub%7D(A%5E%5Cmathbb%7BN%7D)%7D:%20M(%5Ctext%7BSub%7D(A%5E%5Cmathbb%7BN%7D))%20%5Crightarrow%20%5Ctext%7BSub%7D(A%5E%5Cmathbb%7BN%7D)">, which also defines each <img src="https://latex.codecogs.com/png.latex?%5Ctext%7BSub%7D((A%5E%5Cmathbb%7BN%7D)%5E%5Cmathbb%7BN%7D)"> as an <img src="https://latex.codecogs.com/png.latex?M">-algebra.</p>
<p>We may then define the natural transformation <img src="https://latex.codecogs.com/png.latex?%5Clambda"> via <img src="https://latex.codecogs.com/png.latex?%0A%5Clambda_A%20%5Ccoloneqq%20v%5E%7B%5Ctext%7BSub%7D(A%5E%5Cmathbb%7BN%7D)%7D%20%5Ccirc%20M(%5Ctext%7Bcur%7D%5EA):M(%5Ctext%7BSub(A)%7D)%20%5Crightarrow%20%5Ctext%7BSub%7D(A%5E%5Cmathbb%7BN%7D).%0A"></p>
<p>With <img src="https://latex.codecogs.com/png.latex?(P,%20%5Clambda)"> a map of monads, we then observe the following map, for each set <img src="https://latex.codecogs.com/png.latex?A">: <img src="https://latex.codecogs.com/png.latex?%0A%5Clambda_A:%20MPA%20%20%5Crightarrow%20PI%5E%5Ctext%7Bop%7DA%0A"> Since <img src="https://latex.codecogs.com/png.latex?M"> is the monad that produces the free PLTL-algebra of <img src="https://latex.codecogs.com/png.latex?P(A)">, <img src="https://latex.codecogs.com/png.latex?MPA"> is the set of all PLTL-formulae generated from <img src="https://latex.codecogs.com/png.latex?A">. Likewise, <img src="https://latex.codecogs.com/png.latex?PI%5E%7B%5Ctext%7Bop%7D%7DA"> is a poset of predicates on the set <img src="https://latex.codecogs.com/png.latex?I%5E%7B%5Ctext%7Bop%7D%7DA%20=%20%20A%5E%5Cmathbb%7BN%7D">, and so describes properties of streams, or possible behaviours of a sequence of states.</p>
<p>Then, <img src="https://latex.codecogs.com/png.latex?%5Clambda_A"> sends each formula <img src="https://latex.codecogs.com/png.latex?%5Cvarphi%20%5Cin%20MPA"> to a predicate <img src="https://latex.codecogs.com/png.latex?%5Clambda_A(%5Cvarphi)%20%5Cin%20P(I%5E%5Ctext%7Bop%7DA)">. Thus, given a stream <img src="https://latex.codecogs.com/png.latex?%5Calpha%20%5Cin%20A%5E%5Cmathbb%7BN%7D">, the predicate <img src="https://latex.codecogs.com/png.latex?%5Clambda_A(%5Cvarphi)"> determines whether <img src="https://latex.codecogs.com/png.latex?%5Calpha%20%5CvDash_A%20%5Cvarphi">. Thus, the behaviour of a PLTL formula is its characteristic predicate on streams, aka: <img src="https://latex.codecogs.com/png.latex?%0A%5B%5Cvarphi%5D_A%20%5Ccoloneqq%20%5Clambda_A(%5Cvarphi):A%5E%5Cmathbb%7BN%7D%20%5Crightarrow%20%5COmega%0A"> where <img src="https://latex.codecogs.com/png.latex?%5COmega"> is the truth poset in the hyperdoctrine <img src="https://latex.codecogs.com/png.latex?P">.</p>
<p>One may therefore consider <img src="https://latex.codecogs.com/png.latex?MP"> as providing the syntax, whilst <img src="https://latex.codecogs.com/png.latex?PI%5E%7B%5Ctext%7Bop%7D%7D"> provides the semantics. Viewing <img src="https://latex.codecogs.com/png.latex?I"> as an interface that exposes an entire trajectory of states and <img src="https://latex.codecogs.com/png.latex?P"> as providing predicates on <img src="https://latex.codecogs.com/png.latex?I">, the natural transformation <img src="https://latex.codecogs.com/png.latex?%5Clambda"> allows us to interpret each temporal formula as the set of streams satisfying it, thus upgrading a predicate on <img src="https://latex.codecogs.com/png.latex?X"> into a predicate on <img src="https://latex.codecogs.com/png.latex?IX">, consistent with PLTL semantics.</p>
<p>Importantly, given our choice of monad <img src="https://latex.codecogs.com/png.latex?L%20=%20M">, we require a valid interpretation of the PLTL operators <img src="https://latex.codecogs.com/png.latex?X"> and <img src="https://latex.codecogs.com/png.latex?U"> in terms of the semantics of the cofree comonad of the polynomial functor on <img src="https://latex.codecogs.com/png.latex?%5Ctextbf%7BSet%7D%5E%7B%5Ctext%7Bop%7D%7D">. This is fairly obvious for the stream comonad, but certainly not obvious for polynomial functors whose cofree comonads exhibit branching behaviour (aka, polynomials of degree 2 or higher).</p>
</section>
</section>
<section id="future-directions" class="level3" data-number="2.5">
<h3 data-number="2.5" data-anchor-id="future-directions"><span class="header-section-number">2.5</span> Future Directions</h3>
<p>From here, there are many natural research directions to explore.</p>
<p>We had provided a category of PLTL algebras, <img src="https://latex.codecogs.com/png.latex?%5Ctextbf%7BPLTL-Alg%7D">, based on constructing the Lindenbaum-Tarski algebra of the theory of propositional linear temporal logic. As stated before, PLTL is one of many possible temporal logics, grounded in a specific philosophical interpretation of time as starting from the present and extending to the future in discrete, countable time steps. There are many other temporal logics of interest, and we ask whether they may undergo a similar treatment to PLTL. Of particular note are the following logics:</p>
<ul>
<li>Intuitionistic Linear Temporal Logic, as explored in <span class="citation" data-cites="BalbianiPhilippe2019ILTL">Balbiani et al. (2019)</span> and <span class="citation" data-cites="KR2024-33">Fernández-Duque, McLean, and Zenger (2024)</span>, which may allow us to upgrade classical predicates on states to intuitionistic temporal predicates on streams.</li>
<li>Doxastic Logic, as explored in <span class="citation" data-cites="RönnedalDaniel2018Dlan">Rönnedal (2018)</span> or <span class="citation" data-cites="ZhangJinjin2025FELF">Zhang et al. (2025)</span>, which may allow us to hold epistemic predicates on streams as opposed to temporal predicates.</li>
<li>Computation Tree Logic, as explored in <span class="citation" data-cites="reynolds2001">Reynolds (2001)</span>, which may allow us to consider predicates on branches of streams, as opposed to only a linear timeline of streams as we currently see with the stream comonad.</li>
</ul>
<p>With any monad <img src="https://latex.codecogs.com/png.latex?L"> in our set-up, a natural question is which comonads <img src="https://latex.codecogs.com/png.latex?I"> allow for the hyperdoctrine <img src="https://latex.codecogs.com/png.latex?P"> to be a map of mornads, such that this upgrade of predicates is possible. This is particularly interesting when we allow <img src="https://latex.codecogs.com/png.latex?I"> to be the cofree comonad of polynomial functors <img src="https://latex.codecogs.com/png.latex?p(X)">.</p>
<p>As described before, it could be the case that, for <img src="https://latex.codecogs.com/png.latex?L%20=%20M">, the only polynomial functors <img src="https://latex.codecogs.com/png.latex?p"> for which <img src="https://latex.codecogs.com/png.latex?I"> allows for such a construction is when <img src="https://latex.codecogs.com/png.latex?p%20=%20B%20%5Ctimes%20X"> for <img src="https://latex.codecogs.com/png.latex?B">: that is, for unary polynomials with no constants. Though limiting, it suggests that we ought to consider other logics (such as CTL) which can account for more sophisticated system behaviours (primarily, branching behaviours).</p>
<p>We can also change the hyperdoctrine itself to reflect the underlying logic that we temporalise via PLTL. Primarily, if one develops a hyperdoctrine that accounts for a static form of doxastic logic, then setting <img src="https://latex.codecogs.com/png.latex?L"> to be a monad induced by a free-forgetful adjunction of temporal algebras (such as PLTL) allows one to consider a dynamic or temporal doxastic logic that can apply to systems. In <span class="citation" data-cites="DagninoFrancesco2021Dmac">Dagnino and Rosolini (2021)</span>, they show that modal interior operators may be constructed from adjunctions in the 2-category of doctrines. Likewise, one could instead consider a temporal hyperdoctrine , then upgrade it with a doxastic monad. That there may be two ways to approach this might imply two interpretations of a logic affected with temporal and doxastic modalities, the priority of which depends on the set-up. This suggests a potentially novel way to define dynamic doxastic or temporal doxastic logics.</p>



</section>
</section>


<script defer="" src="https://comments.topos.institute/comentario.js"></script>

<div id="quarto-appendix" class="default"><section class="quarto-appendix-contents" id="quarto-bibliography"><h2 class="anchored quarto-appendix-heading">References</h2><div id="refs" class="references csl-bib-body hanging-indent" data-entry-spacing="0">
<div id="ref-BalbianiPhilippe2019ILTL" class="csl-entry">
Balbiani, Philippe, Joseph Boudou, Martín Diéguez, and David Fernández-Duque. 2019. <span>“Intuitionistic Linear Temporal Logics.”</span> <em>ACM Transactions on Computational Logic</em> 21 (2): 1–32.
</div>
<div id="ref-DagninoFrancesco2021Dmac" class="csl-entry">
Dagnino, Francesco, and Giuseppe Rosolini. 2021. <span>“Doctrines, Modalities and Comonads.”</span> <em>Mathematical Structures in Computer Science</em> 31 (7): 769–98.
</div>
<div id="ref-DellaMonicaDario2011ITLA" class="csl-entry">
Della Monica, Dario, Valentin Goranko, Angelo Montanari, and Guido Sciavicco. 2011. <span>“INTERVAL TEMPORAL LOGICS: A JOURNEY.”</span> <em>Bulletin of the European Association for Theoretical Computer Science</em>, no. 105: 73–99.
</div>
<div id="ref-KR2024-33" class="csl-entry">
Fernández-Duque, David, Brett McLean, and Lukas Zenger. 2024. <span>“<span class="nocase">A Sound and Complete Axiomatisation for Intuitionistic Linear Temporal Logic</span>.”</span> In <em><span class="nocase">Proceedings of the 21st International Conference on Principles of Knowledge Representation and Reasoning</span></em>, 350–60. <a href="https://doi.org/10.24963/kr.2024/33">https://doi.org/10.24963/kr.2024/33</a>.
</div>
<div id="ref-fredstephan2008" class="csl-entry">
Fred Kröger, Stephan Merz. 2008. <span>“Temporal Logic and State Systems.”</span> In. Texts in Theoretical Computer Science. An EATCS Series. Springer Nature.
</div>
<div id="ref-LamportLeslie1994Ttlo" class="csl-entry">
Lamport, Leslie. 1994. <span>“The Temporal Logic of Actions.”</span> <em>ACM Transactions on Programming Languages and Systems</em> 16 (3): 872–923.
</div>
<div id="ref-LibkindSophie2024Prom" class="csl-entry">
Libkind, Sophie, and David I Spivak. 2024. <span>“Pattern Runs on Matter: The Free Monad Monad as a Module over the Cofree Comonad Comonad.”</span>
</div>
<div id="ref-MoszkowskiBen2012ACAS" class="csl-entry">
Moszkowski, Ben. 2012. <span>“A Complete Axiom System for Propositional Interval Temporal Logic with Infinite Time.”</span> <em>Logical Methods in Computer Science</em> 8 (3): 2–2.
</div>
<div id="ref-RabinovichA.1998Otot" class="csl-entry">
Rabinovich, A. 1998. <span>“On Translations of Temporal Logic of Actions into Monadic Second-Order Logic.”</span> <em>Theoretical Computer Science</em> 193 (1): 197–214.
</div>
<div id="ref-reynolds2001" class="csl-entry">
Reynolds, M. 2001. <span>“An Axiomatization of Full Computation Tree Logic.”</span> <em>The Journal of Symbolic Logic</em>.
</div>
<div id="ref-RönnedalDaniel2018Dlan" class="csl-entry">
Rönnedal, Daniel. 2018. <span>“Doxastic Logic: A New Approach.”</span> <em>Journal of Applied Non-Classical Logics</em> 28 (4): 313–47.
</div>
<div id="ref-SiqueiraJosé2025Dror" class="csl-entry">
Siqueira, José. 2025. <span>“Double-Functorial Representation of Regular Structures.”</span> <em>arXiv</em>. <a href="https://doi.org/10.48550/arXiv.2508.06637">https://doi.org/10.48550/arXiv.2508.06637</a>.
</div>
<div id="ref-ZhangJinjin2025FELF" class="csl-entry">
Zhang, Jinjin, Xiaoxia Zhou, Yan Zhang, and Lixing Tan. 2025. <span>“Fuzzy Epistemic Logic: Fuzzy Logic of Doxastic Attitudes.”</span> <em>Mathematics (Basel)</em> 13 (7): 1105–5.
</div>
</div></section><section id="footnotes" class="footnotes footnotes-end-of-document"><h2 class="anchored quarto-appendix-heading">Footnotes</h2>

<ol>
<li id="fn1"><p>Tarski’s method does not apply to every logic, as will be discussed later.↩︎</p></li>
<li id="fn2"><p>The rules are modus ponens and temporal generalisation (or the necessitation rule for <img src="https://latex.codecogs.com/png.latex?G">): <img src="https://latex.codecogs.com/png.latex?%0A%5Cfrac%7B%5Calpha,%20%5Calpha%20%5Crightarrow%20%5Cbeta%7D%7B%5Cbeta%7D%20%5Chspace%7B20pt%7D%20%5Cfrac%20%7B%5Calpha%7D%7BG%20%5Calpha%7D.%0A"> The axioms are substitutional instances of the following: C0, any propositional tautology; C1, <img src="https://latex.codecogs.com/png.latex?F%20%5Cneg%20%5Cneg%20%5Calpha%20%5Cleftrightarrow%20F%5Calpha">; C2, <img src="https://latex.codecogs.com/png.latex?G(%5Calpha%20%5Crightarrow%20%5Cbeta)%20%5Crightarrow%20(G%5Calpha%20%5Crightarrow%20G%5Cbeta)">; C3, <img src="https://latex.codecogs.com/png.latex?G%5Calpha%20%5Crightarrow%20(%5Calpha%20%5Cland%20X%5Calpha%20%5Cland%20X(G%5Calpha))">; C4, <img src="https://latex.codecogs.com/png.latex?X%20%5Cneg%20%5Calpha%20%5Cleftrightarrow%20%5Cneg%20X%20%5Calpha">; C5, <img src="https://latex.codecogs.com/png.latex?X%20(%5Calpha%20%5Crightarrow%20%5Cbeta)%20%5Crightarrow%20(X%5Calpha%20%5Crightarrow%20X%5Cbeta)">; C6, <img src="https://latex.codecogs.com/png.latex?G%20(%5Calpha%20%5Crightarrow%20X%5Calpha)%20%5Crightarrow%20(%5Calpha%20%5Crightarrow%20G%5Calpha)">; C7, <img src="https://latex.codecogs.com/png.latex?(%5Calpha%20U%20%5Cbeta)%20%5Cleftrightarrow%20(%5Cbeta%20%5Clor%20(%5Calpha%20%5Cland%20X(%5Calpha%20U%20%5Cbeta)))">; C8, <img src="https://latex.codecogs.com/png.latex?(%5Calpha%20U%20%5Cbeta)%20%5Crightarrow%20F%20%5Cbeta">.↩︎</p></li>
<li id="fn3"><p>With <img src="https://latex.codecogs.com/png.latex?F"> and <img src="https://latex.codecogs.com/png.latex?G"> as defined before, we impose the following (in)equalities, corresponding to the PLTL axiom schema: C1, <img src="https://latex.codecogs.com/png.latex?F%20%5Cneg%20%5Cneg%20%5Calpha%20=%20F%5Calpha">; C2, <img src="https://latex.codecogs.com/png.latex?G(%5Calpha%20%5Crightarrow%20%5Cbeta)%20%5Cleq%20(G%5Calpha%20%5Crightarrow%20G%5Cbeta)">; C3, <img src="https://latex.codecogs.com/png.latex?G%5Calpha%20%5Cleq%20(%5Calpha%20%5Cland%20X%5Calpha%20%5Cland%20X(G%5Calpha))">, so paired with temporal generalisation, we get <img src="https://latex.codecogs.com/png.latex?G%5Calpha%20=%20%5Calpha">, <img src="https://latex.codecogs.com/png.latex?G%5Calpha%20%5Cleq%20%20X%5Calpha"> and <img src="https://latex.codecogs.com/png.latex?G%5Calpha%20%5Cleq%20XG%5Calpha">; C4, <img src="https://latex.codecogs.com/png.latex?X%20%5Cneg%20%5Calpha%20=%20%5Cneg%20X%20%5Calpha">; C5,<img src="https://latex.codecogs.com/png.latex?X%20(%5Calpha%20%5Crightarrow%20%5Cbeta)%20%5Cleq%20(X%5Calpha%20%5Crightarrow%20X%5Cbeta)">; C6, <img src="https://latex.codecogs.com/png.latex?G%20(%5Calpha%20%5Crightarrow%20X%5Calpha)%20%5Cleq%20(%5Calpha%20%5Crightarrow%20G%5Calpha)">; C7, <img src="https://latex.codecogs.com/png.latex?(%5Calpha%20U%20%5Cbeta)%20=%20(%5Cbeta%20%5Clor%20(%5Calpha%20%5Cland%20X(%5Calpha%20U%20%5Cbeta)))">; C8, <img src="https://latex.codecogs.com/png.latex?(%5Calpha%20U%20%5Cbeta)%20%5Cleq%20F%20%5Cbeta">.↩︎</p></li>
<li id="fn4"><p>We have an equivalence relation and a partial ordering on <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BF%7D_%7BPL%7D(P)"> as a consequence of the example given on page 27 of <span class="citation" data-cites="fredstephan2008">Fred Kröger (2008)</span>.↩︎</p></li>
<li id="fn5"><p>Read the corresponding paper to this article.↩︎</p></li>
<li id="fn6"><p>For arbitrary <img src="https://latex.codecogs.com/png.latex?P">, <img src="https://latex.codecogs.com/png.latex?I">, and <img src="https://latex.codecogs.com/png.latex?L">, this need not be the case. As a counterexample, take <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BC%7D%20=%20%5Ctextbf%7BSet%7D">, <img src="https://latex.codecogs.com/png.latex?P%20=%20%5Cmathcal%7BP%7D"> be the powerset functor, <img src="https://latex.codecogs.com/png.latex?I%20=%20%5Ctext%7Bid%7D_%7B%5Cmathcal%7BC%7D%7D"> be the identity comonad, so <img src="https://latex.codecogs.com/png.latex?I%5E%7B%5Ctext%7Bop%7D%7D"> is the identity monad, and <img src="https://latex.codecogs.com/png.latex?L"> be the monad such that <img src="https://latex.codecogs.com/png.latex?L(X)%20=%20%5Cmathbf%7B1%7D"> (the terminal object of <img src="https://latex.codecogs.com/png.latex?%5Ctextbf%7BPos%7D">) for all <img src="https://latex.codecogs.com/png.latex?X%20%5Cin%20%5Ctextbf%7BPos%7D">.↩︎</p></li>
</ol>
</section></div> ]]></description>
  <category>categorical logic</category>
  <category>logic</category>
  <guid>https://topos.institute/blog/2025-09-26-free-pltl-algebras-and-hyperdoctrines/</guid>
  <pubDate>Fri, 26 Sep 2025 00:00:00 GMT</pubDate>
</item>
<item>
  <title>Blog / Incremental query updating in adhesive categories</title>
  <dc:creator>Kris Brown</dc:creator>
  <link>https://topos.institute/blog/2025-08-15-incremental-adhesive/</link>
  <description><![CDATA[ 





<div class="hidden">
<p>$$ <!-- Number systems --> </p>
<!-- Categories -->
<!-- Graphs -->
<!-- Double categories -->
<!-- Acsets -->
<!-- Wiring diagrams -->
<p>$$</p>
</div>
<p>Category theory often sheds light on old problems by redescribing them in a conceptually cleaner way, but it less frequently gets used to develop concrete algorithms for practical problems. In this post, the problem we address involves a query we care about: we want to maintain the answer set to some query (e.g.&nbsp;“how many paths of length two are there in this graph?”) when the thing being queried is changing frequently. If the changes are frequent enough, we don’t want to have to run the query after each change: we want to incrementally update our answer set given information about the change, letting us find the new answers to the query without repeating any work that was done to find the old answers. This is schematically depicted below:</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><a href="images/overview.png" class="lightbox" data-gallery="quarto-lightbox-gallery-1"><img src="https://topos.institute/blog/2025-08-15-incremental-adhesive/images/overview.png" class="img-fluid quarto-figure quarto-figure-center figure-img" style="width:80.0%"></a></p>
</figure>
</div>
<p>While this problem of incremental computation has been studied in great depth, it is less often studied in context where the changes (<img src="https://latex.codecogs.com/png.latex?%5CDelta">, above) are induced by explicit rules which state the pattern-replacement template that was used to generate the <img src="https://latex.codecogs.com/png.latex?%5CDelta">. We will use this additional information to more efficiently address the problem, which is relevant to computational bottlenecks in e-graphs <span class="citation" data-cites="biondo2025">(2025)</span>, datalog queries, and <a href="../2023-07-07-agent-based-modeling-graph-rewriting">agent based modeling</a>. Before unifying these different domains, let’s consider them each independently.</p>
<div class="callout callout-style-simple callout-warning no-icon callout-titled">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon no-icon"></i>
</div>
<div class="callout-title-container flex-fill">
<span class="screen-reader-only">Warning</span>Presumed background
</div>
</div>
<div class="callout-body-container callout-body">
<p>This post will presume familiarity with categories and (co)limits. Also it is a follow-up to <a href="../2025-08-06-substitution-is-pushout/">Substitution is (also) pushout</a> which formally defines “updating” in the categories <img src="https://latex.codecogs.com/png.latex?%5Cmathsf%7BGrph%7D"> and <img src="https://latex.codecogs.com/png.latex?%5Cmathsf%7BDat%7D"> and shows analogies between graph rewriting and Datalog.</p>
</div>
</div>
<section id="example-incremental-solutions" class="level1" data-number="1">
<h1 data-number="1"><span class="header-section-number">1</span> Example incremental solutions</h1>
<section id="graphs" class="level2" data-number="1.1">
<h2 data-number="1.1" data-anchor-id="graphs"><span class="header-section-number">1.1</span> Graphs</h2>
<p>Our first example of an incrementalized query is in the context of relational databases. We will focus in particular on databases with the schema <img src="https://latex.codecogs.com/png.latex?%5Cboxed%7BE%5Crightrightarrows%20V%7D">, whose instances are (directed, multi-)graphs. The kind of query we can incrementalize is a <em>conjunctive query</em>, such as “give me all pairs of edges such that the target of the first edge is the source of second edge”. Interestingly, we can represent this query with a graph itself, <img src="https://latex.codecogs.com/png.latex?%5Cboxed%7B%5Ctextcircled%7B%5Cfootnotesize%20a%7D%5Crightarrow%5Ctextcircled%7B%5Cfootnotesize%20b%7D%5Crightarrow%5Ctextcircled%7B%5Cfootnotesize%20c%7D%7D">, now regarded as a “pattern” rather than a piece of concrete data. Call this query <img src="https://latex.codecogs.com/png.latex?Q">.</p>
<p>Thinking of the query itself as a special graph also illuminates what answers to our query look like: applying our query to some graph <img src="https://latex.codecogs.com/png.latex?G"> is tantamount to finding all graph homomorphisms <img src="https://latex.codecogs.com/png.latex?Q%5Crightarrow%20G">. The data of each such homomorphism (an assignment of vertices and edges) can be thought of as binding the variables that live in <img src="https://latex.codecogs.com/png.latex?Q"> to the values in <img src="https://latex.codecogs.com/png.latex?G">. For example, if <img src="https://latex.codecogs.com/png.latex?G%20:=%20%5Cboxed%7B%5Ctextcircled%7B%5Cfootnotesize%201%7D%5Crightarrow%5Ctextcircled%7B%5Cfootnotesize%202%7D%5Ccirclearrowleft%7D">, then the answers to the query are:</p>
<ul>
<li><img src="https://latex.codecogs.com/png.latex?%5B1,2,2%5D"> (shorthand for <img src="https://latex.codecogs.com/png.latex?%5C%7Ba%5Cmapsto%201,%5C%20b%5Cmapsto%202,%5C%20c%20%5Cmapsto%202%5C%7D">)<sup>1</sup><br>
</li>
<li><img src="https://latex.codecogs.com/png.latex?%5B2,2,2%5D"></li>
</ul>
<p>One way to describe how a graph can evolve over time is a <em>rewrite rule</em>: for us, a rewrite rule is a graph homomorphism where the domain is the <em>pattern</em> and the codomain is the <em>replacement</em>. In the following example, we consider a rule, <img src="https://latex.codecogs.com/png.latex?f%5Ccolon%20L%5Cto%20R">, which says “given some edge, construct a path of length two which goes from its source to its target”. The pattern of the rule says “given an edge from <img src="https://latex.codecogs.com/png.latex?%5Ctextcircled%7B%5Cfootnotesize%20x%7D"> to <img src="https://latex.codecogs.com/png.latex?%5Ctextcircled%7B%5Cfootnotesize%20y%7D">” and the replacement of the rule says “add in a new path of length two going from <img src="https://latex.codecogs.com/png.latex?%5Ctextcircled%7B%5Cfootnotesize%20x%7D"> to <img src="https://latex.codecogs.com/png.latex?%5Ctextcircled%7B%5Cfootnotesize%20y%7D">”. An example <em>application</em> of this rule to some graph, <img src="https://latex.codecogs.com/png.latex?G">, requires a match <img src="https://latex.codecogs.com/png.latex?L%5Crightarrowtail%20G"> to specify <em>how</em> the rule is to be applied, as shown below.</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><a href="images/fig3.png" class="lightbox" data-gallery="quarto-lightbox-gallery-2"><img src="https://topos.institute/blog/2025-08-15-incremental-adhesive/images/fig3.png" class="img-fluid quarto-figure quarto-figure-center figure-img" style="width:50.0%"></a></p>
</figure>
</div>
<p>So, if our non-incremental query <img src="https://latex.codecogs.com/png.latex?Q"> is “what are all paths of length two?”, the incrementalization problem is “If I assume I have all the paths of length two in some arbitrary <img src="https://latex.codecogs.com/png.latex?G"> and I apply the rule <img src="https://latex.codecogs.com/png.latex?f"> (which yields some <img src="https://latex.codecogs.com/png.latex?H"> as result), what should I do to find the <em>new</em> paths of length two in <img src="https://latex.codecogs.com/png.latex?H">?”</p>
<p>Given that we already had <img src="https://latex.codecogs.com/png.latex?%5B1,2,2%5D"> and <img src="https://latex.codecogs.com/png.latex?%5B2,2,2%5D">, the matches which we need to discover are <img src="https://latex.codecogs.com/png.latex?%5B1,3,2%5D"> and <img src="https://latex.codecogs.com/png.latex?%5B3,2,2%5D">. This can be seen by inspection, but we need an algorithm to do this for an arbitrary <img src="https://latex.codecogs.com/png.latex?G"> and match <img src="https://latex.codecogs.com/png.latex?L%5Crightarrowtail%20G">. Keeping <img src="https://latex.codecogs.com/png.latex?Q"> and <img src="https://latex.codecogs.com/png.latex?f"> fixed, it’s possible to intuitively deduce the optimal thing to do: there are three independent ways to get a new answer for <img src="https://latex.codecogs.com/png.latex?Q"> by applying <img src="https://latex.codecogs.com/png.latex?f"> to an arbitrary graph <img src="https://latex.codecogs.com/png.latex?G">:</p>
<ol type="1">
<li>One which will always be introduced by the rule directly (<img src="https://latex.codecogs.com/png.latex?%5B1,3,2%5D"> in our example)</li>
<li>One per <em>outgoing edge</em> from the target of the edge we apply <img src="https://latex.codecogs.com/png.latex?f"> to (this yields just <img src="https://latex.codecogs.com/png.latex?%5B3,2,2%5D"> in our example)</li>
<li>One per <em>incoming edge</em> into the source of the edge we apply <img src="https://latex.codecogs.com/png.latex?f"> to (this yields no matches in our example)</li>
</ol>
</section>
<section id="datalog" class="level2" data-number="1.2">
<h2 data-number="1.2" data-anchor-id="datalog"><span class="header-section-number">1.2</span> Datalog</h2>
<p>A Datalog program has a collection of facts about some ground terms as well as rules for deriving new facts from old ones. As shown in the <a href="../2025-08-06-substitution-is-pushout/">previous post</a>, we can think of the execution of a Datalog program categorically as a sequence of pushouts in a category <img src="https://latex.codecogs.com/png.latex?%5Cmathsf%7BDat%7D">. This is a natural case for applying incremental query updating, since applying rules then triggers new rules which can be applied.</p>
<p>For example, consider the rule, <img src="https://latex.codecogs.com/png.latex?p">: <code>path(X,Z) :- path(X,Y), edge(Y, Z).</code></p>
<p>Applying <img src="https://latex.codecogs.com/png.latex?p"> makes possible new match possibilities for <img src="https://latex.codecogs.com/png.latex?p">’s preconditions. Can we say how to specifically look for <em>new</em> composable <code>path</code> + <code>edge</code> pairs in light of applying <img src="https://latex.codecogs.com/png.latex?p"> to an arbitrary input? Yes, the solution is to look for outgoing edges from whatever vertex was <code>Z</code> in the previous rule application.</p>
</section>
<section id="other-examples" class="level2" data-number="1.3">
<h2 data-number="1.3" data-anchor-id="other-examples"><span class="header-section-number">1.3</span> Other examples</h2>
<p>This post focuses only on incremental updating with respect to rules which purely ‘add things’ in some sense. A followup post will discuss rules which merge or delete, which will be required to talk about some other interesting applications of this approach, including:</p>
<ul>
<li><a href="https://egraphs-good.github.io/">E-graphs</a> (e-saturation steps as applying rewrite rules, incremental hom search to speed up e-matching)</li>
<li>Regex</li>
<li>Multiset rewriting <span class="citation" data-cites="martens2023modeling">(Martens et al. 2023)</span></li>
</ul>
</section>
</section>
<section id="solution-to-the-basic-incremental-search-problem-purely-additive-rules" class="level1" data-number="2">
<h1 data-number="2"><span class="header-section-number">2</span> Solution to the basic incremental search problem: purely additive rules</h1>
<p>How can we unify and automate the intuition of the above examples, in the form of an algorithm that is a couple of lines long and self-evidently correct? The following dictionary will help map the intuitive concepts from the above examples onto basic concepts in category theory.</p>
<section id="a-dictionary-for-category-theory-concepts" class="level2" data-number="2.1">
<h2 data-number="2.1" data-anchor-id="a-dictionary-for-category-theory-concepts"><span class="header-section-number">2.1</span> A dictionary for category theory concepts</h2>
<table class="caption-top table">
<thead>
<tr class="header">
<th>Informal term</th>
<th>Categorical analogue</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Setting for incremental search problem</td>
<td>An (adhesive<sup>2</sup>) category <img src="https://latex.codecogs.com/png.latex?%5Cmathsf%7BC%7D"></td>
</tr>
<tr class="even">
<td>Pattern / Query</td>
<td>An object, <img src="https://latex.codecogs.com/png.latex?Q%20%5Cin%20%5Coperatorname%7BOb%7D%5Cmathsf%7BC%7D"></td>
</tr>
<tr class="odd">
<td>State of the world / set of facts</td>
<td>An object <img src="https://latex.codecogs.com/png.latex?G%20%5Cin%20%5Coperatorname%7BOb%7D%5Cmathsf%7BC%7D"></td>
</tr>
<tr class="even">
<td>Pattern match of <img src="https://latex.codecogs.com/png.latex?Q"> in <img src="https://latex.codecogs.com/png.latex?G"></td>
<td>A morphism <img src="https://latex.codecogs.com/png.latex?Q%20%5Crightarrow%20G"></td>
</tr>
<tr class="odd">
<td>Answer set to a query <img src="https://latex.codecogs.com/png.latex?Q"> in state <img src="https://latex.codecogs.com/png.latex?G"></td>
<td><img src="https://latex.codecogs.com/png.latex?%5Coperatorname%7BHom%7D_%5Cmathsf%7BC%7D(Q,G)"></td>
</tr>
<tr class="even">
<td>An (additive) rewrite rule, with pattern <img src="https://latex.codecogs.com/png.latex?L"> and replacement <img src="https://latex.codecogs.com/png.latex?R"></td>
<td>A monomorphism <img src="https://latex.codecogs.com/png.latex?f:%20L%20%5Crightarrowtail%20R"></td>
</tr>
<tr class="odd">
<td>Application of a rewrite rule <img src="https://latex.codecogs.com/png.latex?f"> to state <img src="https://latex.codecogs.com/png.latex?G"> with <img src="https://latex.codecogs.com/png.latex?L"> matched via <img src="https://latex.codecogs.com/png.latex?m"></td>
<td>A pushout <img src="https://latex.codecogs.com/png.latex?G%5Cxrightarrow%7B%5CDelta%7D%20H%5Cxleftarrow%7Br%7DR"> of <img src="https://latex.codecogs.com/png.latex?f%5Ccolon%20L%5Crightarrowtail%20R"> and <img src="https://latex.codecogs.com/png.latex?m%5Ccolon%20L%5Cto%20G"></td>
</tr>
</tbody>
</table>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><a href="images/fig3.png" class="lightbox" data-gallery="quarto-lightbox-gallery-3"><img src="https://topos.institute/blog/2025-08-15-incremental-adhesive/images/fig3.png" class="img-fluid quarto-figure quarto-figure-center figure-img" style="width:50.0%"></a></p>
</figure>
</div>
</section>
<section id="algorithm" class="level2" data-number="2.2">
<h2 data-number="2.2" data-anchor-id="algorithm"><span class="header-section-number">2.2</span> Algorithm</h2>
<p>Describing an algorithm categorically is a double-edged sword — we’re abstracting away from implementation details, with the benefits of getting to the essence of the algorithm and making it possible to apply it in a wide variety of settings. On the other hand, the algorithms do need to eventually be implemented, details and all. A balance is struck below by making certain informal computational assumptions about the category <img src="https://latex.codecogs.com/png.latex?%5Cmathsf%7BC%7D"> we work in: namely we can compute certain things, like small (co)limits, with some known computational complexity in whichever <img src="https://latex.codecogs.com/png.latex?%5Cmathsf%7BC%7D"> we instantiate our algorithm.</p>
<p>With reference to variables in the above table, our algorithm’s job is to systematically find new answers to <img src="https://latex.codecogs.com/png.latex?Q"> in <img src="https://latex.codecogs.com/png.latex?H"> while avoiding any work that might recover the answers we already had in <img src="https://latex.codecogs.com/png.latex?G">. More formally, the basic case of the <strong>incremental search problem</strong> is: when we are given <img src="https://latex.codecogs.com/png.latex?%7B(G,%20H,%20%5CDelta,%20r)%7D"> as above at runtime, we need to compute <img src="https://latex.codecogs.com/png.latex?%7B%5Coperatorname%7BHom%7D(Q,H)%5Csetminus%20%5Coperatorname%7BHom%7D(Q,G)%5Ccdot%5CDelta%7D"> (where <img src="https://latex.codecogs.com/png.latex?%5Ccdot"> denotes post-composition).</p>
</section>
<section id="solving-the-basic-case" class="level2" data-number="2.3">
<h2 data-number="2.3" data-anchor-id="solving-the-basic-case"><span class="header-section-number">2.3</span> Solving the basic case</h2>
<section id="computational-assumptions" class="level3" data-number="2.3.1">
<h3 data-number="2.3.1" data-anchor-id="computational-assumptions"><span class="header-section-number">2.3.1</span> Computational assumptions</h3>
<p>The above mention of “runtime” is contrasted with “compile time”: long before we begin our process of maintaining an answer set with respect to frequent changes, we know both what <img src="https://latex.codecogs.com/png.latex?Q"> is and what the possible rules like <img src="https://latex.codecogs.com/png.latex?f"> are. This is our chance to do expensive calculations and store the results in memory so that our runtime computation is as fast as possible.</p>
<div class="callout callout-style-simple callout-tip no-icon callout-titled">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon no-icon"></i>
</div>
<div class="callout-title-container flex-fill">
<span class="screen-reader-only">Tip</span>Compile-time vs runtime indicated via color
</div>
</div>
<div class="callout-body-container callout-body">
<p>This distinction is shown via color in the figures of this post: black will be used to represent information which is known at compile time, while red is used to denote information that we take to be provided to us at runtime. Green will be used to represent things our algorithm then computes at runtime.</p>
</div>
</div>
<p>Another computational assumption is that objects in patterns and rules (<img src="https://latex.codecogs.com/png.latex?L,%20R,%20Q">) are <em>small</em> for practical purposes, whereas the states being updated by rewrite rules (<img src="https://latex.codecogs.com/png.latex?G,%20H">) can be <em>large</em>. We assume it’s computationally difficult to compute the answer set to a query <img src="https://latex.codecogs.com/png.latex?%5Coperatorname%7BHom%7D(A,B)"> when <img src="https://latex.codecogs.com/png.latex?B"> is large even when <img src="https://latex.codecogs.com/png.latex?A"> is small (in <img src="https://latex.codecogs.com/png.latex?%5Cmathbf%7BGrph%7D">, this is the <a href="https://en.wikipedia.org/wiki/Subgraph_isomorphism_problem">subgraph isomorphism problem</a>); however, it’s easy to solve the <em>rooted</em> subgraph isomorphism problem <span class="citation" data-cites="gp2">(2020)</span>, so long as <img src="https://latex.codecogs.com/png.latex?A"> is small.</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><a href="images/fig4.png" class="lightbox" data-gallery="quarto-lightbox-gallery-4"><img src="https://topos.institute/blog/2025-08-15-incremental-adhesive/images/fig4.png" class="img-fluid quarto-figure quarto-figure-center figure-img"></a></p>
</figure>
</div>
<p>Such a partial map specifies a rooted homomorphism search problem when the monic map is <em>componentwise connected</em>, i.e.&nbsp;there exists no connected component of <img src="https://latex.codecogs.com/png.latex?A"> which lies entirely outside the image of <img src="https://latex.codecogs.com/png.latex?O">. The intuition here is that, in a constraint satisfaction problem, if every connected component of <img src="https://latex.codecogs.com/png.latex?A"> has been partially initialized, then we don’t really have to “search” for morphisms from <img src="https://latex.codecogs.com/png.latex?A"> to <img src="https://latex.codecogs.com/png.latex?B">; we just have to use the connectivity of <img src="https://latex.codecogs.com/png.latex?A"> to read off all of the matches of <img src="https://latex.codecogs.com/png.latex?A"> within <img src="https://latex.codecogs.com/png.latex?B">, an operation which scales only with the size of <img src="https://latex.codecogs.com/png.latex?A">.<sup>3</sup></p>
<p>The core reason the algorithm presented below is efficient is that it transforms something analogous to a subgraph isomorphism problem into a collection of <em>rooted</em> subgraph isomorphism problems. This is also a good example of how we can specify something abstractly, such as a partial map from <img src="https://latex.codecogs.com/png.latex?A"> to <img src="https://latex.codecogs.com/png.latex?B">, and leave it as a context-specific implementation detail of how one actually finds all of the maps from <img src="https://latex.codecogs.com/png.latex?A"> to <img src="https://latex.codecogs.com/png.latex?B"> consistent with that partial map.</p>
</section>
<section id="working-backwards-towards-a-solution" class="level3" data-number="2.3.2">
<h3 data-number="2.3.2" data-anchor-id="working-backwards-towards-a-solution"><span class="header-section-number">2.3.2</span> Working backwards towards a solution</h3>
<p>To say a category is <strong>adhesive</strong> is to say something specific about its limits and colimits (see <a href="https://ncatlab.org/nlab/show/adhesive+category">nlab</a> or <span class="citation" data-cites="lack2005adhesive">(Lack and Sobociński 2005)</span>). A consequence of this is that, for any pushout square <img src="https://latex.codecogs.com/png.latex?%7BH%5Ccong%20R+_L%20G%7D"> and morphism <img src="https://latex.codecogs.com/png.latex?h:Q%20%5Crightarrow%20H">, we can take four pullbacks to recover a second pushout square whose apex is <img src="https://latex.codecogs.com/png.latex?Q">, depicted below.</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><a href="images/fig5.png" class="lightbox" data-gallery="quarto-lightbox-gallery-5"><img src="https://topos.institute/blog/2025-08-15-incremental-adhesive/images/fig5.png" class="img-fluid quarto-figure quarto-figure-center figure-img"></a></p>
</figure>
</div>
<p>For any match into the result of a rewrite, we have a canonical decomposition of our pattern into various subobjects: <img src="https://latex.codecogs.com/png.latex?%7BQ%5Ccong%20Q_R%20+_%7BQ_L%7D%20Q_G%7D">, i.e.&nbsp;<img src="https://latex.codecogs.com/png.latex?Q"> just <em>is</em> the part of <img src="https://latex.codecogs.com/png.latex?Q"> which intersects with <img src="https://latex.codecogs.com/png.latex?R"> and the part which intersects with <img src="https://latex.codecogs.com/png.latex?G">, glued together by the part of <img src="https://latex.codecogs.com/png.latex?Q"> which intersects with <img src="https://latex.codecogs.com/png.latex?L">. So every match <img src="https://latex.codecogs.com/png.latex?h"> has an associated cube where the top and bottom are pushouts and the sides are all pullbacks. For ease of reference, we’ll call this the <em>adhesive cube</em> induced by <img src="https://latex.codecogs.com/png.latex?h">.</p>
<p><strong>How much of this cube can be computed at compile time?</strong></p>
<p>We don’t know <img src="https://latex.codecogs.com/png.latex?G"> or <img src="https://latex.codecogs.com/png.latex?H"> at runtime, so we can’t precompute all their incident maps. However, the rest of the cube (in black) can be anticipated.</p>
</section>
<section id="the-simple-algorithm" class="level3" data-number="2.3.3">
<h3 data-number="2.3.3" data-anchor-id="the-simple-algorithm"><span class="header-section-number">2.3.3</span> The simple algorithm</h3>
<p><strong>At compile time</strong></p>
<ol type="1">
<li>Enumerate all possible top faces of an adhesive cube
<ul>
<li>Call these faces <strong>decompositions</strong> <img src="https://latex.codecogs.com/png.latex?Q%20%5Ccong%20Q_G%20+_%7BQ_L%7D%20Q_R"></li>
</ul></li>
<li>Enumerate all possible side faces above the rewrite rule
<ul>
<li>Call these faces <strong>interactions</strong> between a <img src="https://latex.codecogs.com/png.latex?Q_L%5Crightarrowtail%20Q_R"> and a rule <img src="https://latex.codecogs.com/png.latex?f:%20L%5Crightarrowtail%20R">, so that an interaction is a pair of maps <img src="https://latex.codecogs.com/png.latex?h_L:%20Q_L%5Crightarrow%20L"> and <img src="https://latex.codecogs.com/png.latex?h_R:%20Q_R%5Crightarrow%20R"> that form a pullback square.</li>
</ul></li>
</ol>
<p>One of these decompositions is <em>bad</em>: it has <img src="https://latex.codecogs.com/png.latex?Q_G=Q">: this is saying the match lies entirely in <img src="https://latex.codecogs.com/png.latex?G">. The matches which have this as the top face of their adhesive cube are (precisely) the matches we wanted to avoid in order to be solving the <em>incremental</em> search problem, so we ignore this decomposition.</p>
<p><strong>At runtime:</strong></p>
<ul>
<li><p>Once we know what <img src="https://latex.codecogs.com/png.latex?f"> is, we can separately consider <em>each</em> partial adhesive cube which consists in a decomposition (top face) and a compatible interaction with <img src="https://latex.codecogs.com/png.latex?f"> (side face).</p></li>
<li><p>Given <img src="https://latex.codecogs.com/png.latex?m">, we can compute all possible <img src="https://latex.codecogs.com/png.latex?h_G:%20Q_G%5Crightarrow%20G"> only keeping the ones which form a pullback square with <img src="https://latex.codecogs.com/png.latex?m"> and <img src="https://latex.codecogs.com/png.latex?h_L">.</p></li>
<li><p>Then, for each such <img src="https://latex.codecogs.com/png.latex?h_G">, we have a corresponding match <img src="https://latex.codecogs.com/png.latex?%7Bh=%5Bh_G%5Ccdot%20%5CDelta,%20h_R%5Ccdot%20r%5D%7D">.</p></li>
</ul>
<div class="callout callout-style-simple callout-tip no-icon callout-titled">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon no-icon"></i>
</div>
<div class="callout-title-container flex-fill">
<span class="screen-reader-only">Tip</span>Correctness
</div>
</div>
<div class="callout-body-container callout-body">
<p>That this procedure recovers exactly the new matches, <img src="https://latex.codecogs.com/png.latex?%7BHom(Q,H)%5Csetminus%20Hom(Q,G)%5Ccdot%5CDelta%7D">, is clear: each new match corresponds to a unique adhesive cube, and we enumerate all possible cubes (deliberately excluding the ones which factor through <img src="https://latex.codecogs.com/png.latex?%5CDelta">).</p>
<p>That this is efficient requires showing that the search for <img src="https://latex.codecogs.com/png.latex?h_G"> is always a <em>rooted</em> search problem, i.e.&nbsp;<img src="https://latex.codecogs.com/png.latex?Q_L%20%5Crightarrowtail%20Q_G"> is componentwise connected. First, <img src="https://latex.codecogs.com/png.latex?Q_R"> is nonempty because we ruled out the trivial decomposition. Then, let us assume <img src="https://latex.codecogs.com/png.latex?Q"> is connected.<sup>4</sup> Because <img src="https://latex.codecogs.com/png.latex?%7BQ%20%5Ccong%20Q_G%20+_%7BQ_L%7D%20Q_R%7D">, if some disconnected component of <img src="https://latex.codecogs.com/png.latex?Q_G"> were not in the image of <img src="https://latex.codecogs.com/png.latex?Q_L">, it would remain a disconnected component in <img src="https://latex.codecogs.com/png.latex?Q">.</p>
</div>
</div>
</section>
<section id="example-finding-newly-introduced-paths-of-length-2" class="level3" data-number="2.3.4">
<h3 data-number="2.3.4" data-anchor-id="example-finding-newly-introduced-paths-of-length-2"><span class="header-section-number">2.3.4</span> Example: finding newly introduced paths of length 2</h3>
<p>Let’s revisit our earlier example of finding paths of length two that spring into existence via the rewrite application which introduces a triangle, reproduced on the left.</p>
<div class="columns">
<div class="column" style="width:25%;">
<p><br><br><br><br><br> <img src="https://topos.institute/blog/2025-08-15-incremental-adhesive/images/fig3.png" class="img-fluid quarto-figure quarto-figure-center"></p>
</div><div class="column" style="width:75%;">
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><a href="images/fig6.png" class="lightbox" data-gallery="quarto-lightbox-gallery-6"><img src="https://topos.institute/blog/2025-08-15-incremental-adhesive/images/fig6.png" class="img-fluid quarto-figure quarto-figure-center figure-img"></a></p>
</figure>
</div>
</div>
</div>
<p>On top we see a choice of decomposition and interaction that recovers the match <img src="https://latex.codecogs.com/png.latex?%5B1,%203,%202%5D">. The <img src="https://latex.codecogs.com/png.latex?Q_G"> of the decomposition asserts that the beginning and end vertex of the path will live in <img src="https://latex.codecogs.com/png.latex?G">, but the middle vertex and both edges will come from material newly added by the rule. Note in this case, the partial map <img src="https://latex.codecogs.com/png.latex?Q_G=Q_L%20%5Crightarrow%20G"> is a total map, so there is always a unique <img src="https://latex.codecogs.com/png.latex?h_G"> (and <img src="https://latex.codecogs.com/png.latex?h">) associated with this rewrite.</p>
<p>On the bottom, we see a choice of decomposition and interaction that recovers the match <img src="https://latex.codecogs.com/png.latex?%5B3,%202,%202%5D">. The <img src="https://latex.codecogs.com/png.latex?Q_G"> of the decomposition asserts that the second edge of the path will live in <img src="https://latex.codecogs.com/png.latex?G">, but the first vertex and edge will come from material newly added by the rule. The search for <img src="https://latex.codecogs.com/png.latex?h_G"> candidates induced by the partial map from <img src="https://latex.codecogs.com/png.latex?Q_G"> to <img src="https://latex.codecogs.com/png.latex?G"> looks for outgoing edges from <img src="https://latex.codecogs.com/png.latex?%5Ctextcircled%7B%5Cfootnotesize%202%7D"> in <img src="https://latex.codecogs.com/png.latex?G">. There is only one such edge in this case, but in general this decomposition+interaction pair could lead to zero or many new matches found.</p>
</section>
</section>
<section id="an-optimization-when-mathsfc-has-complements" class="level2" data-number="2.4">
<h2 data-number="2.4" data-anchor-id="an-optimization-when-mathsfc-has-complements"><span class="header-section-number">2.4</span> An optimization when <img src="https://latex.codecogs.com/png.latex?%5Cmathsf%7BC%7D"> has complements</h2>
<p>The previous algorithm might be unsatisfactory in two ways:</p>
<ol type="1">
<li>There are a <em>lot</em> of ways to express <img src="https://latex.codecogs.com/png.latex?Q"> as a pushout. We have to iterate over all of them.</li>
<li>It might seem wasteful that we had to <em>filter</em> <img src="https://latex.codecogs.com/png.latex?h_G"> candidates by those which formed a pullback square, just because adhesive cube side faces are always pullbacks.</li>
</ol>
<p>We can address both these issues when <img src="https://latex.codecogs.com/png.latex?%5Cmathsf%7BC%7D"> has complements.</p>
<div class="callout callout-style-simple callout-tip no-icon callout-titled">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon no-icon"></i>
</div>
<div class="callout-title-container flex-fill">
<span class="screen-reader-only">Tip</span>Definitions
</div>
</div>
<div class="callout-body-container callout-body">
<p>The <em>union</em> of two subobjects <img src="https://latex.codecogs.com/png.latex?A"> and <img src="https://latex.codecogs.com/png.latex?B">, denoted <img src="https://latex.codecogs.com/png.latex?A%20%5Cvee%20B">, is computed by gluing them together along their intersection (i.e.&nbsp;pullback, denoted <img src="https://latex.codecogs.com/png.latex?A%20%5Cwedge%20B">).</p>
<p>The <em>complement</em> of <img src="https://latex.codecogs.com/png.latex?%7BA%5Crightarrowtail%20X%7D">, denoted <img src="https://latex.codecogs.com/png.latex?%7B%7B%5Csim%7DA%7D">, is the smallest subobject for which <img src="https://latex.codecogs.com/png.latex?%7BX%20=%20A%20%E2%88%A8%20%7B%5Csim%7DA%7D">.</p>
<p>The <em>boundary</em> of <img src="https://latex.codecogs.com/png.latex?A">, denoted <img src="https://latex.codecogs.com/png.latex?%5Cpartial%20A">, is <img src="https://latex.codecogs.com/png.latex?A%20%5Cwedge%20%7B%5Csim%7D%20A">.</p>
</div>
</div>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><a href="images/fig1.png" class="lightbox" data-gallery="quarto-lightbox-gallery-7"><img src="https://topos.institute/blog/2025-08-15-incremental-adhesive/images/fig1.png" class="img-fluid quarto-figure quarto-figure-center figure-img" style="width:50.0%"></a></p>
</figure>
</div>
<p>Once we have this structure, we can succinctly express the optimized algorithm. We solve the incremental problem by doing the same procedure as before with two changes:</p>
<ol type="1">
<li><em>Only</em> consider decompositions where <img src="https://latex.codecogs.com/png.latex?Q_R%20=%20%7B%5Csim%7DQ_G">.</li>
<li>Allow <em>all</em> of the the extensions of the partial map from <img src="https://latex.codecogs.com/png.latex?Q_G"> to <img src="https://latex.codecogs.com/png.latex?G"> to be maps <img src="https://latex.codecogs.com/png.latex?h_G"> used to induce new matches <img src="https://latex.codecogs.com/png.latex?h">.</li>
</ol>
<section id="too-good-to-be-true-why-is-the-optimization-correct" class="level3" data-number="2.4.1">
<h3 data-number="2.4.1" data-anchor-id="too-good-to-be-true-why-is-the-optimization-correct"><span class="header-section-number">2.4.1</span> Too good to be true? Why is the optimization correct?</h3>
<p>For any match <img src="https://latex.codecogs.com/png.latex?h:%20Q%5Crightarrow%20H">, we have not only a unique adhesive cube, but also a unique <em>minimal</em> adhesive cube. One obtains the latter from composing two cubes together like in the below diagram:</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><a href="images/fig7.png" class="lightbox" data-gallery="quarto-lightbox-gallery-8"><img src="https://topos.institute/blog/2025-08-15-incremental-adhesive/images/fig7.png" class="img-fluid quarto-figure quarto-figure-center figure-img"></a></p>
</figure>
</div>
<p>Note we can see this arbitrary <img src="https://latex.codecogs.com/png.latex?h"> has a unique associated interaction between <img src="https://latex.codecogs.com/png.latex?%7B%5Cpartial%20Q_G%20%5Crightarrowtail%20%7B%5Csim%7DQ_G%7D"> and <img src="https://latex.codecogs.com/png.latex?f">, i.e.&nbsp;a pair of maps <img src="https://latex.codecogs.com/png.latex?%7B(h_%5Cpartial,%20h_%5Csim)%7D"> that forms a pullback with <img src="https://latex.codecogs.com/png.latex?f">. We get this by precomposing <img src="https://latex.codecogs.com/png.latex?h_L"> and <img src="https://latex.codecogs.com/png.latex?h_R"> with <img src="https://latex.codecogs.com/png.latex?%7B%5Cpartial%20Q_G%20%5Crightarrowtail%20Q_L%7D"> and <img src="https://latex.codecogs.com/png.latex?%7B%7B%5Csim%7DQ_G%20%5Crightarrowtail%20Q_R%7D"> respectively.</p>
<p>So the algorithm is structurally the same: each <img src="https://latex.codecogs.com/png.latex?h"> has a unique cube associated with it, so loop over all partial cubes and try to complete them. But it’s nicer to loop over partial <em>minimal</em> adhesive cubes because the possible top faces are generally a small subset of all possible decompositions of <img src="https://latex.codecogs.com/png.latex?Q">. Also, the way to complete these cubes is by simply looking for maps <img src="https://latex.codecogs.com/png.latex?h_G"> which extend the partial map <img src="https://latex.codecogs.com/png.latex?Q_G%20%5Cleftarrowtail%20%5Cpartial%20Q_G%20%5Cxrightarrow%7Bh_%5Cpartial%5Ccdot%20m%7D%20G"> (no filtering based on a pullback condition). By the same argument as above, this partial map induces a <em>rooted</em> search problem because <img src="https://latex.codecogs.com/png.latex?Q"> is connected and we are excluding the trivial decomposition.</p>
</section>
<section id="optimized-algorithm-example" class="level3" data-number="2.4.2">
<h3 data-number="2.4.2" data-anchor-id="optimized-algorithm-example"><span class="header-section-number">2.4.2</span> Optimized algorithm example</h3>
<p><img src="https://latex.codecogs.com/png.latex?%5Cmathsf%7BGrph%7D"> <a href="https://blog.algebraicjulia.org/post/2021/09/cset-graphs-4/">has complements</a>. Let’s consider a new scenario, where <img src="https://latex.codecogs.com/png.latex?R=Q"> and <img src="https://latex.codecogs.com/png.latex?L=G">. The rule <img src="https://latex.codecogs.com/png.latex?L%5Crightarrowtail%20R"> looks for a cospan of edges and adds an edge in order to make a path of length two.</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><a href="images/fig8.png" class="lightbox" data-gallery="quarto-lightbox-gallery-9"><img src="https://topos.institute/blog/2025-08-15-incremental-adhesive/images/fig8.png" class="img-fluid quarto-figure quarto-figure-center figure-img" style="width:100.0%"></a></p>
</figure>
</div>
<p>The decomposition <img src="https://latex.codecogs.com/png.latex?Q_R+_%7BQ_L%7DQ_G"> above one gets by taking pullbacks with <img src="https://latex.codecogs.com/png.latex?h"> is not minimal. Although <img src="https://latex.codecogs.com/png.latex?Q_L"> and <img src="https://latex.codecogs.com/png.latex?Q_R"> involve all three vertices of the pattern, the only part of the pattern <img src="https://latex.codecogs.com/png.latex?L"> that’s actually relevant to the rewrite (i.e.&nbsp;the only part that’s necessary to get us from <img src="https://latex.codecogs.com/png.latex?Q_G"> to <img src="https://latex.codecogs.com/png.latex?Q">) is the <img src="https://latex.codecogs.com/png.latex?%5Ctextcircled%7B%5Cfootnotesize%20y%7D%5Crightarrow%5Ctextcircled%7B%5Cfootnotesize%20z%7D"> part of it. The complement operation is what allows us to formally ignore the parts of the pattern that do not play an essential role in the rewrite.</p>
<p>If we were running the old algorithm using the minimal interaction, the pullback condition would say that, moreover, <img src="https://latex.codecogs.com/png.latex?%5Ctextcircled%7B%5Cfootnotesize%201%7D"> <em>doesn’t</em> appear in the pattern. Because of this, the previous algorithm would not find the match associated with <img src="https://latex.codecogs.com/png.latex?h_G%20=%20%5B1,%202,%203%5D"> depicted in this figure from the minimal interaction. Instead, that map <img src="https://latex.codecogs.com/png.latex?h_G"> would have been detected by a non-minimal interaction with <img src="https://latex.codecogs.com/png.latex?Q_L"> and <img src="https://latex.codecogs.com/png.latex?Q_R">, also shown in the figure.</p>
<p>The core idea of this optimization, specialized to this example, is that one shouldn’t need to distinguish special cases for whether <img src="https://latex.codecogs.com/png.latex?%5Ctextcircled%7B%5Cfootnotesize%201%7D"> appears in the pattern or not.</p>
</section>
</section>
<section id="batch-update-from-multiple-rule-firings" class="level2" data-number="2.5">
<h2 data-number="2.5" data-anchor-id="batch-update-from-multiple-rule-firings"><span class="header-section-number">2.5</span> Batch update from multiple rule firings</h2>
<p>We can apply many additive rewrites at once with a single colimit, rather than as an artificially-ordered sequence of pushouts.</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><a href="images/fig9.png" class="lightbox" data-gallery="quarto-lightbox-gallery-10"><img src="https://topos.institute/blog/2025-08-15-incremental-adhesive/images/fig9.png" class="img-fluid quarto-figure quarto-figure-center figure-img"></a></p>
</figure>
</div>
<p>A match into the result of multiple simultaneous rewrites has a corresponding decomposition of the pattern into a colimit of subobjects of the same shape. The <img src="https://latex.codecogs.com/png.latex?n=2"> case induced adhesive ‘multicube’ is shown below:</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><a href="images/fig10.png" class="lightbox" data-gallery="quarto-lightbox-gallery-11"><img src="https://topos.institute/blog/2025-08-15-incremental-adhesive/images/fig10.png" class="img-fluid quarto-figure quarto-figure-center figure-img" style="width:50.0%"></a></p>
</figure>
</div>
<p>Our algorithm generalizes: at compile-time enumerate possible nontrivial decompositions of <img src="https://latex.codecogs.com/png.latex?Q"> with the above shape and all interactions of subobject morphisms with rewrite rules. At runtime, some finite family of rewrite rules (e.g.&nbsp;<img src="https://latex.codecogs.com/png.latex?(f_1,f_3,f_3,f_2)">) will have been executed with corresponding matches <img src="https://latex.codecogs.com/png.latex?m_i">. We loop over possible partial multicubes and look for morphisms <img src="https://latex.codecogs.com/png.latex?h_G:%20Q_G%5Crightarrow%20G"> that lead to pullback faces above all of the matches, each of which uniquely results in a new match <img src="https://latex.codecogs.com/png.latex?h=%5Bh_G%5Ccdot%20%5CDelta,%20h_%7BR,1%7D%5Ccdot%20r_1,%20h_%7BR,2%7D%5Ccdot%20r_2,...%5D">.</p>
<div class="callout callout-style-simple callout-warning no-icon callout-titled">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon no-icon"></i>
</div>
<div class="callout-title-container flex-fill">
<span class="screen-reader-only">Warning</span>Optimized version when <img src="https://latex.codecogs.com/png.latex?%5Cmathsf%7BC%7D"> has complements
</div>
</div>
<div class="callout-body-container callout-body">
<p>There is also an optimized batch algorithm that requires just looking for maps <img src="https://latex.codecogs.com/png.latex?Q_G%20%5Crightarrow%20G"> that commute with all <img src="https://latex.codecogs.com/png.latex?h_%7BL,i%7D"> and <img src="https://latex.codecogs.com/png.latex?m_i"> rather than filtering for ones which furthermore satisfy a pullback property. In brief, we require <img src="https://latex.codecogs.com/png.latex?Q_%7BR,i%7D%20=%20%7B%5Csim%7D(Q_G%20%5Cvee%20%5Cbigvee_%7Bj%5Cne%20i%7D%20Q_%7BR,j%7D)">: this codifies that we want each interaction to be as small as possible.</p>
</div>
</div>
<section id="batch-example" class="level3" data-number="2.5.1">
<h3 data-number="2.5.1" data-anchor-id="batch-example"><span class="header-section-number">2.5.1</span> Batch example</h3>
<p>Let’s consider a pattern that looks for paths of length three, rather than two. This example has a batch two applications of the triangle-introducing rule. This leads to a match which incorporates material from the old graph as well as newly introduced material from both rewrites:</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><a href="images/fig11.png" class="lightbox" data-gallery="quarto-lightbox-gallery-12"><img src="https://topos.institute/blog/2025-08-15-incremental-adhesive/images/fig11.png" class="img-fluid quarto-figure quarto-figure-center figure-img" style="width:70.0%"></a></p>
</figure>
</div>
<p>The resulting match, <img src="https://latex.codecogs.com/png.latex?%5B4,%202,%202,%205%5D">, is ultimately found starting from the decomposition of <img src="https://latex.codecogs.com/png.latex?Q"> on top, which asserts parts of <img src="https://latex.codecogs.com/png.latex?Q"> must overlap with <img src="https://latex.codecogs.com/png.latex?G">, <img src="https://latex.codecogs.com/png.latex?L_i">, and <img src="https://latex.codecogs.com/png.latex?R_i">. The middle edge in the pattern <img src="https://latex.codecogs.com/png.latex?Q"> comes from the loop of the old graph, whereas the first and last vertices and edges are respectively created via the two rule applications.</p>
</section>
</section>
<section id="nonmonic-matches" class="level2" data-number="2.6">
<h2 data-number="2.6" data-anchor-id="nonmonic-matches"><span class="header-section-number">2.6</span> Nonmonic matches</h2>
<p>Nonmonic matches can implicitly quotient parts of the pattern, leading to new possible ways a match for a pattern <img src="https://latex.codecogs.com/png.latex?Q"> could be created. For every possible <img src="https://latex.codecogs.com/png.latex?L%5Ctwoheadrightarrow%20L'">, we can compute the corresponding quotiented rule at compile time. At runtime, we epi-mono factorize any nonmonic match and use the previous algorithm with the quotiented rule. This is shown schematically below:</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><a href="images/fig12.png" class="lightbox" data-gallery="quarto-lightbox-gallery-13"><img src="https://topos.institute/blog/2025-08-15-incremental-adhesive/images/fig12.png" class="img-fluid quarto-figure quarto-figure-center figure-img"></a></p>
</figure>
</div>
<p>By factoring the pushout square into a pushout of epis and a pushout of monos, we can ignore the top pushout square and pretend our rewrite rule was <img src="https://latex.codecogs.com/png.latex?r'"> all along, now with a monic match <img src="https://latex.codecogs.com/png.latex?m'">. A particular example is shown below.</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><a href="images/quot.png" class="lightbox" data-gallery="quarto-lightbox-gallery-14"><img src="https://topos.institute/blog/2025-08-15-incremental-adhesive/images/quot.png" class="img-fluid quarto-figure quarto-figure-center figure-img"></a></p>
</figure>
</div>
<p>Applying our triangle rule to a loop rather than an edge between distinct vertices leads to a new kind of path of length two that can appear (the two newly-introduced edges, but now in the opposite order), which wouldn’t be detected by our algorithm using the unquotiented rule.</p>
<!-- 
# Rules which merge

So far we have presumed that our rule $f$ is a monomorphism. When this is relaxed, many aspects of the above story do not change despite the introduction of some complications. The "inefficient" algorithm, which searches for all partial adhesive cubes and then extends these by searching for morphisms which form pullback squares, is still valid. The challenge here for future work is to come up with an analogue of the more efficient algorithm using complements and minimal adhesive cubes. 

Note that additive rules simply extend the number of answers to a query, whereas a rule which performs a merge can both add and merge existing matches. In the following example, the function from answers in $G$ to answers in $H$ is neither injective nor surjective:

![](images/nonmonic_homaction.png){fig-align="center" width=50%}

Here's a scenario we can try to concretely reason about: finding paths of length two after two vertices have been merged. New matches will have the form of $\boxed{\textcircled{1}\rightarrow\textcircled{2}\ \  \textcircled{3}\rightarrow\textcircled{4}}$ in the original graph $G$, where $\textcircled{2}$ and $\textcircled{3}$ get merged and  $\textcircled{1}$ and $\textcircled{4}$ are freely matched, possibly overlapping with any of the other vertices. This corresponds to a decomposition of the pattern into a gluing together of subobjects.

A more complicated case to consider is that of a rule which sends the walking edge to the loop on one vertex. Let our query be the path of length 3. When applied to the middle edge of a zig zag graph of length three, i.e. $\boxed{\textcircled{1}\rightarrow\textcircled{2}\leftarrow\textcircled{3}\rightarrow\textcircled{4}}$ (which has no paths of length 3), one has a new path of length three $[1,23,23,4]$. 
-->
</section>
</section>
<section id="conclusion" class="level1" data-number="3">
<h1 data-number="3"><span class="header-section-number">3</span> Conclusion</h1>
<p>Adhesive categories are a general setting for reasoning about pattern matching. We assume some computational primitives can be implemented in any domain of interest, thought of as an adhesive category:</p>
<ol type="1">
<li>computing decompositions of an object into subobjects</li>
<li>computing small (co)limits</li>
<li>extending a partial map into a set of total ones.</li>
</ol>
<p>The efficiency of this approach derives from its systematic transformation of a subgraph isomorphism problems into a collection of <em>rooted</em> subgraph isomorphism problems. Another aspect that makes this algorithm special is that it leverages information beyond the <em>extensional</em> difference of an update in order to speed up incremental answer set update.</p>
<p>Solving the base problem can be straightforwardly generalized to non-monic matches, non-connected patterns, and batch updates. In cases where one can compute complements to subobjects, we can be even more efficient.</p>
<p>There is an implementation in <a href="https://github.com/AlgebraicJulia/AlgebraicRewriting.jl">AlgebraicRewriting.jl</a> in arbitrary <img src="https://latex.codecogs.com/png.latex?%5Cmathsf%7BC%7D">-Set categories <span class="citation" data-cites="Patterson_2022">(2022)</span>. <img src="https://latex.codecogs.com/png.latex?%5Cmathbf%7BGrph%7D"> is a special case of this. There is more to be said about deletion and merging in future work!</p>



</section>


<script defer="" src="https://comments.topos.institute/comentario.js"></script>

<div id="quarto-appendix" class="default"><section class="quarto-appendix-contents" id="quarto-bibliography"><h2 class="anchored quarto-appendix-heading">References</h2><div id="refs" class="references csl-bib-body hanging-indent" data-entry-spacing="0">
<div id="ref-biondo2025" class="csl-entry">
Biondo, Roberto, Davide Castelnovo, and Fabio Gadducci. 2025. <span>“EGGs Are Adhesive!”</span> <a href="https://arxiv.org/abs/2503.13678">https://arxiv.org/abs/2503.13678</a>.
</div>
<div id="ref-gp2" class="csl-entry">
Campbell, Graham, Jack Romo, and Detlef Plump. 2020. <span>“Improving the <span>GP</span> 2 Compiler.”</span> <em>CoRR</em> abs/2002.02914. <a href="https://arxiv.org/abs/2002.02914">https://arxiv.org/abs/2002.02914</a>.
</div>
<div id="ref-lack2005adhesive" class="csl-entry">
Lack, Stephen, and Paweł Sobociński. 2005. <span>“Adhesive and Quasiadhesive Categories.”</span> <em>RAIRO-Theoretical Informatics and Applications</em> 39 (3): 511–45.
</div>
<div id="ref-martens2023modeling" class="csl-entry">
Martens, Chris, Alexander Card, Henry Crain, and Asha Khatri. 2023. <span>“Modeling Game Mechanics with Ceptre.”</span> <em>IEEE Transactions on Games</em> 16 (2): 431–44.
</div>
<div id="ref-Patterson_2022" class="csl-entry">
Patterson, Evan, Owen Lynch, and James Fairbanks. 2022. <span>“Categorical Data Structures for Technical Computing.”</span> <em>Compositionality</em> 4 (December): 5. <a href="https://doi.org/10.32408/compositionality-4-5">https://doi.org/10.32408/compositionality-4-5</a>.
</div>
</div></section><section id="footnotes" class="footnotes footnotes-end-of-document"><h2 class="anchored quarto-appendix-heading">Footnotes</h2>

<ol>
<li id="fn1"><p>We can succinctly describe graph homomorphisms by a vector which says where the domain vertices go. This is unambiguous when the domain vertices have an obvious order and codomain graph has at most one edge between any two vertices.↩︎</p></li>
<li id="fn2"><p>What adhesivity means for us in practice will be described below.↩︎</p></li>
<li id="fn3"><p>This also assumes some bound to the node degree of <img src="https://latex.codecogs.com/png.latex?B">: even though <img src="https://latex.codecogs.com/png.latex?G"> might be big (say ~<img src="https://latex.codecogs.com/png.latex?10%5E6"> vertices and edges), there <em>won’t</em> be <img src="https://latex.codecogs.com/png.latex?10%5E6"> edges between any two particular vertices.↩︎</p></li>
<li id="fn4"><p>We can assume our original pattern <img src="https://latex.codecogs.com/png.latex?Q"> was connected without loss of generality. If <img src="https://latex.codecogs.com/png.latex?Q%20=%20Q_1+Q_2">, we can separately update <img src="https://latex.codecogs.com/png.latex?%5Coperatorname%7BHom%7D(Q_1,G)"> and <img src="https://latex.codecogs.com/png.latex?%5Coperatorname%7BHom%7D(Q_2,G)">. This is because <img src="https://latex.codecogs.com/png.latex?%5Coperatorname%7BHom%7D(Q_1+Q_2,G)%20%5Ccong%20%5Coperatorname%7BHom%7D(Q_1,G)%20%5Ctimes%20%5Coperatorname%7BHom%7D(Q_2,G)">.↩︎</p></li>
</ol>
</section></div> ]]></description>
  <category>acsets</category>
  <category>applied category theory</category>
  <category>databases</category>
  <category>rewriting</category>
  <category>AlgebraicJulia</category>
  <guid>https://topos.institute/blog/2025-08-15-incremental-adhesive/</guid>
  <pubDate>Fri, 15 Aug 2025 00:00:00 GMT</pubDate>
  <media:content url="https://topos.institute/blog/2025-08-15-incremental-adhesive/images/overview.png" medium="image" type="image/png" height="81" width="144"/>
</item>
<item>
  <title>Blog / Substitution is also pushout</title>
  <dc:creator>Kris Brown</dc:creator>
  <link>https://topos.institute/blog/2025-08-06-substitution-is-pushout/</link>
  <description><![CDATA[ 





<p>“Substitution is pullback” is a common slogan in categorical logic. The intuition behind it is found in Andrej Bauer’s brief blog post, <a href="https://math.andrej.com/2012/09/28/substitution-is-pullback">substitution is pullback</a>.</p>
<section id="unrelatedly-substitution-is-sometimes-pushout" class="level2" data-number="1">
<h2 data-number="1" data-anchor-id="unrelatedly-substitution-is-sometimes-pushout"><span class="header-section-number">1</span> Unrelatedly, substitution is sometimes pushout</h2>
<p>We’ll demonstrate this phenomenon by focusing on two categories, <img src="https://latex.codecogs.com/png.latex?%5Cmathsf%7BGrph%7D"> and <img src="https://latex.codecogs.com/png.latex?%5Cmathsf%7BDat%7D">, as examples.</p>
<section id="first-example-category-graphs" class="level3" data-number="1.1">
<h3 data-number="1.1" data-anchor-id="first-example-category-graphs"><span class="header-section-number">1.1</span> First example category: graphs</h3>
<p>The objects of <img src="https://latex.codecogs.com/png.latex?%5Cmathsf%7BGrph%7D"> are directed multigraphs (hereafter: graphs). A graph <img src="https://latex.codecogs.com/png.latex?G"> consists in a set of vertices <img src="https://latex.codecogs.com/png.latex?V_G"> and a set of edges <img src="https://latex.codecogs.com/png.latex?E_G">, where each edge has designated source and target vertex given by functions <img src="https://latex.codecogs.com/png.latex?%7B%5Crm%20src%7D_G"> and <img src="https://latex.codecogs.com/png.latex?%7B%5Crm%20tgt%7D_G">.<sup>1</sup> Morphisms in <img src="https://latex.codecogs.com/png.latex?%5Cmathsf%7BGrph%7D"> are graph homomorphisms.<sup>2</sup></p>
<ul>
<li>The path graph of length two, <img src="https://latex.codecogs.com/png.latex?%5Cboxed%7B%5Cbullet%5Crightarrow%5Cbullet%5Crightarrow%5Cbullet%7D">, can be thought of as a piece of <em>data</em>.
<ul>
<li>We can informally put labels on the vertices to help us refer to parts of the graph.<sup>3</sup></li>
<li>E.g. this (very same) graph could also have been drawn as <img src="https://latex.codecogs.com/png.latex?%5Cboxed%7B%5Ctextcircled%7B%5Cfootnotesize%201%7D%5Crightarrow%5Ctextcircled%7B%5Cfootnotesize%202%7D%5Crightarrow%5Ctextcircled%7B%5Cfootnotesize%203%7D%7D">.</li>
</ul></li>
<li>However, we can also think of this same graph, <img src="https://latex.codecogs.com/png.latex?%5Cboxed%7B%5Ctextcircled%7B%5Cfootnotesize%20x%7D%5Cxrightarrow%7Ba%7D%5Ctextcircled%7B%5Cfootnotesize%20y%7D%5Cxrightarrow%7Bb%7D%5Ctextcircled%7B%5Cfootnotesize%20z%7D%7D">, as representing a conjunctive <em>query</em>, one which could be applied to other graphs: “Find me an edge (<img src="https://latex.codecogs.com/png.latex?a">) and an edge (<img src="https://latex.codecogs.com/png.latex?b">) such that <img src="https://latex.codecogs.com/png.latex?a">’s target equals <img src="https://latex.codecogs.com/png.latex?b">’s source.”
<ul>
<li>In this case, the labels are like variable names.</li>
<li>In this post, we mark this attitudinal distinction by labeling graphs we are thinking as queries with letters. Graphs thought of as data will be labeled with numbers.</li>
</ul></li>
</ul>
<p>Above are two attitudes one can take towards a graph. An attitude one can take towards a morphism from a query <img src="https://latex.codecogs.com/png.latex?X"> to data <img src="https://latex.codecogs.com/png.latex?Y"> is that of a <em>pattern match</em>, i.e.&nbsp;an answer to the query <img src="https://latex.codecogs.com/png.latex?X">. If we take a different attitude to this morphism <img src="https://latex.codecogs.com/png.latex?X%5Crightarrow%20Y">, thinking of it as between two different queries, we would call the morphism a <em>rewrite rule</em>. An example rewrite rule is <img src="https://latex.codecogs.com/png.latex?%7B%5Cboxed%7B%5Ctextcircled%7B%5Cfootnotesize%20x%7D%7D%5Crightarrow%5Cboxed%7B%5Ctextcircled%7B%5Cfootnotesize%20x%7D%5Ccirclearrowleft%7D%7D">. This rule is saying “if you give me a vertex, <img src="https://latex.codecogs.com/png.latex?x">, I can turn it into a vertex with a loop.”<sup>4</sup></p>
<p>Applying this rewrite rule morphism to some graph <img src="https://latex.codecogs.com/png.latex?G:=%5Cboxed%7B%5Ctextcircled%7B%5Cfootnotesize%201%7D%5Crightarrow%5Ctextcircled%7B%5Cfootnotesize%202%7D%5Crightarrow%5Ctextcircled%7B%5Cfootnotesize%203%7D%7D">, requires choosing whether <img src="https://latex.codecogs.com/png.latex?x%5Cmapsto%201"> or <img src="https://latex.codecogs.com/png.latex?x%5Cmapsto%202"> or <img src="https://latex.codecogs.com/png.latex?x%5Cmapsto%203">. This is precisely the data of a match morphism from <img src="https://latex.codecogs.com/png.latex?%7B%5Cboxed%7B%5Ctextcircled%7B%5Cfootnotesize%20x%7D%7D%7D"> into <img src="https://latex.codecogs.com/png.latex?G">. Suppose we take the map which represents <img src="https://latex.codecogs.com/png.latex?x%5Cmapsto%202">: taking the pushout has the effect of substituting <img src="https://latex.codecogs.com/png.latex?2"> for <img src="https://latex.codecogs.com/png.latex?x">, yielding <img src="https://latex.codecogs.com/png.latex?%7B%5Cboxed%7B%5Ctextcircled%7B%5Cfootnotesize%202%7D%7D%5Crightarrow%5Cboxed%7B%5Ctextcircled%7B%5Cfootnotesize%202%7D%5Ccirclearrowleft%7D%7D">. There is no such loop in <img src="https://latex.codecogs.com/png.latex?G">, but applying the rewrite rule makes the minimal change to <img src="https://latex.codecogs.com/png.latex?G"> required to make the answer true.</p>
<!-- https://q.uiver.app/#q=WzAsNCxbMCwwLCJcXHRleHRjaXJjbGVke3h9Il0sWzEsMCwiXFx0ZXh0Y2lyY2xlZHt4fSJdLFswLDEsIlxcdGV4dGNpcmNsZWR7MX1cXHJpZ2h0YXJyb3dcXHRleHRjaXJjbGVkezJ9XFxyaWdodGFycm93XFx0ZXh0Y2lyY2xlZHszfSJdLFsxLDEsIlxcdGV4dGNpcmNsZWR7MX1cXHJpZ2h0YXJyb3dcXHRleHRjaXJjbGVkezJ9XFxyaWdodGFycm93XFx0ZXh0Y2lyY2xlZHszfSJdLFsxLDEsIiIsMCx7InJhZGl1cyI6MX1dLFszLDMsIiIsMCx7InJhZGl1cyI6MSwiYW5nbGUiOi0xODB9XSxbMCwyLCJ4XFxtYXBzdG8gMiIsMCx7InN0eWxlIjp7ImJvZHkiOnsibmFtZSI6ImRvdHRlZCJ9fX1dLFswLDEsIiIsMix7InN0eWxlIjp7ImJvZHkiOnsibmFtZSI6ImRvdHRlZCJ9fX1dLFsyLDMsIiIsMSx7InN0eWxlIjp7ImJvZHkiOnsibmFtZSI6ImRvdHRlZCJ9fX1dLFsxLDMsInhcXG1hcHN0bzIiLDAseyJzdHlsZSI6eyJib2R5Ijp7Im5hbWUiOiJkb3R0ZWQifX19XSxbMyw3LCIiLDAseyJsZXZlbCI6MSwic3R5bGUiOnsibmFtZSI6ImNvcm5lciJ9fV1d -->
<iframe class="quiver-embed" src="https://q.uiver.app/#q=WzAsNCxbMCwwLCJcXHRleHRjaXJjbGVke3h9Il0sWzEsMCwiXFx0ZXh0Y2lyY2xlZHt4fSJdLFswLDEsIlxcdGV4dGNpcmNsZWR7MX1cXHJpZ2h0YXJyb3dcXHRleHRjaXJjbGVkezJ9XFxyaWdodGFycm93XFx0ZXh0Y2lyY2xlZHszfSJdLFsxLDEsIlxcdGV4dGNpcmNsZWR7MX1cXHJpZ2h0YXJyb3dcXHRleHRjaXJjbGVkezJ9XFxyaWdodGFycm93XFx0ZXh0Y2lyY2xlZHszfSJdLFsxLDEsIiIsMCx7InJhZGl1cyI6MX1dLFszLDMsIiIsMCx7InJhZGl1cyI6MSwiYW5nbGUiOi0xODB9XSxbMCwyLCJ4XFxtYXBzdG8gMiIsMCx7InN0eWxlIjp7ImJvZHkiOnsibmFtZSI6ImRvdHRlZCJ9fX1dLFswLDEsIiIsMix7InN0eWxlIjp7ImJvZHkiOnsibmFtZSI6ImRvdHRlZCJ9fX1dLFsyLDMsIiIsMSx7InN0eWxlIjp7ImJvZHkiOnsibmFtZSI6ImRvdHRlZCJ9fX1dLFsxLDMsInhcXG1hcHN0bzIiLDAseyJzdHlsZSI6eyJib2R5Ijp7Im5hbWUiOiJkb3R0ZWQifX19XSxbMyw3LCIiLDAseyJsZXZlbCI6MSwic3R5bGUiOnsibmFtZSI6ImNvcm5lciJ9fV1d&amp;embed" width="560" height="304" style="border-radius: 8px; border: none;">
</iframe>
<p>Let’s look at one more example: the rule “if you gave me an edge, I could give you path of length two which has the same source and target”. Applying this rule requires a match morphism assigning two variable vertices and one variable edge:</p>
<!-- https://q.uiver.app/#q=WzAsNixbMCwxLCJcXHRleHRjaXJjbGVke3h9XFxyaWdodGFycm93XFx0ZXh0Y2lyY2xlZHt5fSJdLFsxLDEsIlxcdGV4dGNpcmNsZWR7eH1cXHJpZ2h0YXJyb3dcXHRleHRjaXJjbGVke3l9Il0sWzAsMiwiXFx0ZXh0Y2lyY2xlZHsxfVxccmlnaHRhcnJvd1xcdGV4dGNpcmNsZWR7Mn1cXHJpZ2h0YXJyb3dcXHRleHRjaXJjbGVkezN9Il0sWzEsMiwiXFx0ZXh0Y2lyY2xlZHsxfVxccmlnaHRhcnJvd1xcdGV4dGNpcmNsZWR7Mn1cXHJpZ2h0YXJyb3dcXHRleHRjaXJjbGVkezN9Il0sWzEsMCwiXFx0ZXh0Y2lyY2xlZHt6fSJdLFsxLDMsIlxcdGV4dGNpcmNsZWR7entcXGZvb3Rub3Rlc2l6ZSd9fSJdLFswLDEsIiIsMix7InN0eWxlIjp7ImJvZHkiOnsibmFtZSI6ImRvdHRlZCJ9fX1dLFsyLDMsIiIsMSx7InN0eWxlIjp7ImJvZHkiOnsibmFtZSI6ImRvdHRlZCJ9fX1dLFsxLDMsInhcXG1hcHN0byAyXFxcXHlcXG1hcHN0bzMiLDAseyJzdHlsZSI6eyJib2R5Ijp7Im5hbWUiOiJkb3R0ZWQifX19XSxbMCwyLCJ4XFxtYXBzdG8gMlxcXFx5XFxtYXBzdG8zIiwwLHsic3R5bGUiOnsiYm9keSI6eyJuYW1lIjoiZG90dGVkIn19fV0sWzEsNCwiIiwyLHsib2Zmc2V0IjoxLCJjdXJ2ZSI6LTIsInNob3J0ZW4iOnsic291cmNlIjoyMH19XSxbNCwxLCIiLDIseyJvZmZzZXQiOjEsImN1cnZlIjotMiwic2hvcnRlbiI6eyJ0YXJnZXQiOjIwfX1dLFszLDUsIiIsMCx7InNob3J0ZW4iOnsic291cmNlIjoyMCwidGFyZ2V0IjoxMH19XSxbNSwzLCIiLDAseyJvZmZzZXQiOjMsImN1cnZlIjoyLCJzaG9ydGVuIjp7InRhcmdldCI6MzB9fV0sWzMsNiwiIiwwLHsibGV2ZWwiOjEsInN0eWxlIjp7Im5hbWUiOiJjb3JuZXIifX1dXQ== -->
<iframe class="quiver-embed" src="https://q.uiver.app/#q=WzAsNixbMCwxLCJcXHRleHRjaXJjbGVke3h9XFxyaWdodGFycm93XFx0ZXh0Y2lyY2xlZHt5fSJdLFsxLDEsIlxcdGV4dGNpcmNsZWR7eH1cXHJpZ2h0YXJyb3dcXHRleHRjaXJjbGVke3l9Il0sWzAsMiwiXFx0ZXh0Y2lyY2xlZHsxfVxccmlnaHRhcnJvd1xcdGV4dGNpcmNsZWR7Mn1cXHJpZ2h0YXJyb3dcXHRleHRjaXJjbGVkezN9Il0sWzEsMiwiXFx0ZXh0Y2lyY2xlZHsxfVxccmlnaHRhcnJvd1xcdGV4dGNpcmNsZWR7Mn1cXHJpZ2h0YXJyb3dcXHRleHRjaXJjbGVkezN9Il0sWzEsMCwiXFx0ZXh0Y2lyY2xlZHt6fSJdLFsxLDMsIlxcdGV4dGNpcmNsZWR7entcXGZvb3Rub3Rlc2l6ZSd9fSJdLFswLDEsIiIsMix7InN0eWxlIjp7ImJvZHkiOnsibmFtZSI6ImRvdHRlZCJ9fX1dLFsyLDMsIiIsMSx7InN0eWxlIjp7ImJvZHkiOnsibmFtZSI6ImRvdHRlZCJ9fX1dLFsxLDMsInhcXG1hcHN0byAyXFxcXHlcXG1hcHN0bzMiLDAseyJzdHlsZSI6eyJib2R5Ijp7Im5hbWUiOiJkb3R0ZWQifX19XSxbMCwyLCJ4XFxtYXBzdG8gMlxcXFx5XFxtYXBzdG8zIiwwLHsic3R5bGUiOnsiYm9keSI6eyJuYW1lIjoiZG90dGVkIn19fV0sWzEsNCwiIiwyLHsib2Zmc2V0IjoxLCJjdXJ2ZSI6LTIsInNob3J0ZW4iOnsic291cmNlIjoyMH19XSxbNCwxLCIiLDIseyJvZmZzZXQiOjEsImN1cnZlIjotMiwic2hvcnRlbiI6eyJ0YXJnZXQiOjIwfX1dLFszLDUsIiIsMCx7InNob3J0ZW4iOnsic291cmNlIjoyMCwidGFyZ2V0IjoxMH19XSxbNSwzLCIiLDAseyJvZmZzZXQiOjMsImN1cnZlIjoyLCJzaG9ydGVuIjp7InRhcmdldCI6MzB9fV0sWzMsNiwiIiwwLHsibGV2ZWwiOjEsInN0eWxlIjp7Im5hbWUiOiJjb3JuZXIifX1dXQ==&amp;embed" width="560" height="560" style="border-radius: 8px; border: none;">
</iframe>
<p>Note because this rule didn’t bind anything to <img src="https://latex.codecogs.com/png.latex?z">, it’s not obvious what label we should informally give the newly introduced vertex. If we applied the rule multiple times, we would continue to generate a new vertex (and two new edges) each time.</p>
</section>
<section id="second-example-category-datalog" class="level3" data-number="1.2">
<h3 data-number="1.2" data-anchor-id="second-example-category-datalog"><span class="header-section-number">1.2</span> Second example category: Datalog</h3>
<p>Let’s attempt to understand the logic programming language <a href="https://en.wikipedia.org/wiki/Datalog">Datalog</a> categorically. The key concepts here are <em>relation</em>, <em>fact</em>, <em>constant</em>, <em>variable</em>, <em>rule</em>, and <em>query</em>. For example one can write some facts about a binary <code>edge</code> relation and constants <code>v1</code>, <code>v2</code>, and <code>v3</code>.</p>
<pre><code>edge(v1,v1). edge(v3,v3). edge(v1,v2). edge(v3,v2).</code></pre>
<p>When someone writes a Datalog program, there is a starting set of ground facts (which are facts about constants). There are also rules, which have two parts, known as the <em>head</em> and the <em>body</em> (written <code>HEAD :- BODY.</code><sup>5</sup>). We can think of the body as the preconditions of the rule and the head as the postcondition(s).<sup>6</sup> An example of a rule (which involves both variables and constants) is:</p>
<pre><code>edge(v1,X) :- edge(X,X), edge(X,v2).</code></pre>
<p>This says that: “if you give me any vertex <img src="https://latex.codecogs.com/png.latex?X"> with a self loop and edge into <code>v2</code>, I’ll give you an edge from <code>v1</code> into <img src="https://latex.codecogs.com/png.latex?X">”. If we ran the Datalog program with this rule and the ground facts above, we would derive the fact that <code>edge(v1,v3)</code> because, if one <em>queries</em> the preconditions, one can get an answer <code>X=v3</code> which then gets plugged into the postcondition. One can imagine making these moves until there are no further changes in the set of facts: this is called the Herbrand model of the Datalog program. The sets of facts which we encounter along the way to the Herbrand model are called <a href="http://kylebayes.com/blog/article5.html">Herbrand interpretations</a> (hereafter: interpretations).</p>
<p>We want to think of the initial collection of ground facts as an interpretation, an update that brings us closer to the Herbrand model as a morphism of interpretations, the rule as a morphism <code>preconditions -&gt; postconditions</code> of interpretations, and the finding of a set of terms that satisfies the preconditions as a morphism of interpretations <code>preconditions -&gt; current_interpretation</code>. Furthermore, we want this update morphism to shake out as the result of taking the pushout in this category. Let’s craft a definition to make this happen!</p>
<div class="callout callout-style-simple callout-tip no-icon callout-titled">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon no-icon"></i>
</div>
<div class="callout-title-container flex-fill">
<span class="screen-reader-only">Tip</span><img src="https://latex.codecogs.com/png.latex?%5Cmathsf%7BDat%7D"> definition (concrete)
</div>
</div>
<div class="callout-body-container callout-body">
<p>Fix some signature <img src="https://latex.codecogs.com/png.latex?%5CSigma:%20R%20%5Crightarrow%20%5Cmathbb%7BN%7D"> assigning arities to a set of relation symbols. Let <img src="https://latex.codecogs.com/png.latex?K"> be some set of constants. We define <img src="https://latex.codecogs.com/png.latex?%5Cmathsf%7BDat%7D_%7B%5CSigma,%20K%7D"> (hereafter just <img src="https://latex.codecogs.com/png.latex?%5CSigma"> and <img src="https://latex.codecogs.com/png.latex?K"> will be implicit) to be the category of interpretations and interpretation morphisms, where:</p>
<ul>
<li>An <em>interpretation</em> <img src="https://latex.codecogs.com/png.latex?I"> consists of a set <img src="https://latex.codecogs.com/png.latex?I_V"> of ‘variables’, as well as relations on <img src="https://latex.codecogs.com/png.latex?K+I_V"> for every relation symbol <img src="https://latex.codecogs.com/png.latex?r%20%5Cin%20R"> of arity <img src="https://latex.codecogs.com/png.latex?%5CSigma(r)">.</li>
<li>A morphism of interpretations <img src="https://latex.codecogs.com/png.latex?I%5Crightarrow%20J"> is a function <img src="https://latex.codecogs.com/png.latex?I_V%20%5Crightarrow%20K%20+%20J_V">, assigning variables to either constants or variables,<sup>7</sup> that preserves whatever relations are in <img src="https://latex.codecogs.com/png.latex?I">.</li>
</ul>
</div>
</div>
<p>So to interpret the example rule above as a morphism <img src="https://latex.codecogs.com/png.latex?I%5Crightarrow%20J">, we must take <img src="https://latex.codecogs.com/png.latex?I"> to be <code>edge(X,X), edge(X,v2)</code> and <img src="https://latex.codecogs.com/png.latex?J"> to be <code>edge(v1,X), edge(X,X), edge(X,v2)</code>. Note that, because these rules tell us how to <em>add</em> facts (never removing them), we should always think of the preconditions as implicitly included in the postconditions. We have <img src="https://latex.codecogs.com/png.latex?%7BK=%5C%7Bv_1,v_2,v_3%5C%7D%7D"> and <img src="https://latex.codecogs.com/png.latex?%7BI_V=J_V=%5C%7BX%5C%7D%7D"> with the morphism data the function sending <img src="https://latex.codecogs.com/png.latex?X%5Cmapsto%20X">, which preserves the relations in <img src="https://latex.codecogs.com/png.latex?I"> because <img src="https://latex.codecogs.com/png.latex?J"> extends the set of facts of <img src="https://latex.codecogs.com/png.latex?I">.</p>
<p>It will be easier to show that this category has pushouts when defined in a more abstract way.</p>
<div class="callout callout-style-simple callout-tip no-icon callout-titled">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon no-icon"></i>
</div>
<div class="callout-title-container flex-fill">
<span class="screen-reader-only">Tip</span><img src="https://latex.codecogs.com/png.latex?%5Cmathsf%7BDat%7D"> definition (abstract)
</div>
</div>
<div class="callout-body-container callout-body">
<p>Given a signature <img src="https://latex.codecogs.com/png.latex?%5CSigma"> we define the category <img src="https://latex.codecogs.com/png.latex?%5Cmathsf%7BC%7D_%5CSigma"> to contain an object <img src="https://latex.codecogs.com/png.latex?X"> as well as morphisms <img src="https://latex.codecogs.com/png.latex?r_1,...,r_%7B%5CSigma(r)%7D:%20A_r%5Crightarrow%20X"> for each <img src="https://latex.codecogs.com/png.latex?r%20%5Cin%20R">. There is an associated finite limit sketch <img src="https://latex.codecogs.com/png.latex?T_%5CSigma"> which adds limit cones asserting that its models <img src="https://latex.codecogs.com/png.latex?M:%20C_%5CSigma%20%5Crightarrow%20%5Cmathsf%7BSet%7D"> have, for each <img src="https://latex.codecogs.com/png.latex?r%20%5Cin%20R">, that <img src="https://latex.codecogs.com/png.latex?M(r_1),...,M(r_%7B%5CSigma(r)%7D)"> are jointly monic.<sup>8</sup></p>
<p>We define <img src="https://latex.codecogs.com/png.latex?%5Cmathsf%7BDat%7D_%5CSigma"> to be the the category of models of <img src="https://latex.codecogs.com/png.latex?T_%5CSigma">, which is subcategory of <img src="https://latex.codecogs.com/png.latex?%5Cmathsf%7BSet%5E%7BC_%5CSigma%7D%7D">. As a category of limit sketch models, <img src="https://latex.codecogs.com/png.latex?%5Cmathsf%7BDat%7D_%5CSigma"> is a <a href="https://ncatlab.org/nlab/show/reflective+subcategory">reflective subcategory</a> whose reflector quotients each <img src="https://latex.codecogs.com/png.latex?M(A_r)">, merging together elements that agree on all values of <img src="https://latex.codecogs.com/png.latex?M(r_1),%20...,%20M(r_%7B%5CSigma(r)%7D)">. Reflective subcategories of cocomplete categories are cocomplete, with colimits computed by first including into the larger category, performing the colimit there, and then applying the reflector to coerce the result back into the subcategory.</p>
<p>Constants are handled via coslicing: let <img src="https://latex.codecogs.com/png.latex?%5Cmathsf%7BDat%7D_%7B%5CSigma,K%7D"> be <img src="https://latex.codecogs.com/png.latex?%7B%5Crm%20Const%7D/%5Cmathsf%7BDat%7D_%5CSigma">, where <img src="https://latex.codecogs.com/png.latex?%7B%5Crm%20Const%7D"> is the functor with <img src="https://latex.codecogs.com/png.latex?%7B%5Crm%20Const%7D(X):=K"> and <img src="https://latex.codecogs.com/png.latex?%7B%5Crm%20Const%7D(A_r)=%5Cvarnothing"> for all <img src="https://latex.codecogs.com/png.latex?r%20%5Cin%20R">. Note that coslices of categories with pushouts have pushouts, computed in the base category.</p>
</div>
</div>
<p>Consider interpretations that have just a binary <code>edge</code> relation. These are pretty similar to graphs as defined in the previous section; however, there is no notion of <em>multiple</em> edges. Also the vertices can have fixed, stable identities: although the graph <img src="https://latex.codecogs.com/png.latex?%5Cboxed%7B%5Ctextcircled%7B%5Cfootnotesize%20a%7D%5Crightarrow%5Ctextcircled%7B%5Cfootnotesize%20b%7D%7D"> is isomorphic / not meaningfully different from <img src="https://latex.codecogs.com/png.latex?%5Cboxed%7B%5Ctextcircled%7B%5Cfootnotesize%20b%7D%5Crightarrow%5Ctextcircled%7B%5Cfootnotesize%20a%7D%7D"> because the labels are not meaningful, an interpretation whose only fact is <code>edge(v1,v2)</code> will not be isomorphic in <img src="https://latex.codecogs.com/png.latex?%5Cmathsf%7BDat%7D"> to one whose only fact is <code>edge(v2,v1)</code>, if <code>v1</code> and <code>v2</code> are constants.</p>
<!-- ::: {.callout-caution}
## Relationship between the two categories

The two categories $\mathsf{Grph}$ and $\mathsf{Dat}$ (with just a binary edge relation) above exemplify two different ways one could model relational structures with databases. Consider the database schema: $\boxed{{\rm Edge}\overset{s}{\underset{t}{\rightrightarrows}} {\rm Vertex}}$. In the first approach, we act as if there are implicitly primary key columns on each of the tables, whereas the second approach takes the primary key of $\mathrm{Edge}$ to be a composite primary key, consisting in both of its foreign keys. Furthermore, the categorical database approach regards the primary key values of ${\rm Vertex}$ as meaningless identifiers, in contrast to the Datalog approach taking these values to be constants that are non-interchangeable.
::: -->
<p>To see these pushouts in action, consider applying the rule above, using the depicted match morphism (i.e.&nbsp;answer <code>X=v3</code> to the query of the rule’s preconditions). Note we distinguish variables from constants by using red for variables:</p>
<!-- https://q.uiver.app/#q=WzAsMTEsWzQsMCwiXFx0ZXh0Y2lyY2xlZHtcXGZvb3Rub3Rlc2l6ZSB2XzF9Il0sWzUsMCwiXFx0ZXh0Y2lyY2xlZHtcXHRleHRjb2xvcntyZWR9e3h9fSJdLFs2LDAsIlxcdGV4dGNpcmNsZWR7XFxmb290bm90ZXNpemUgdl8yfSJdLFsxLDAsIlxcdGV4dGNpcmNsZWR7XFx0ZXh0Y29sb3J7cmVkfXt4fX0iXSxbMiwwLCJcXHRleHRjaXJjbGVke1xcZm9vdG5vdGVzaXplIHZfMn0iXSxbMCwyLCJcXHRleHRjaXJjbGVke1xcZm9vdG5vdGVzaXplIHZfMX0iXSxbMSwyLCJcXHRleHRjaXJjbGVke1xcZm9vdG5vdGVzaXplIHZfMn0iXSxbMiwyLCJcXHRleHRjaXJjbGVke1xcZm9vdG5vdGVzaXplIHZfM30iXSxbNCwyLCJcXHRleHRjaXJjbGVke1xcZm9vdG5vdGVzaXplIHZfMX0iXSxbNSwyLCJcXHRleHRjaXJjbGVke1xcZm9vdG5vdGVzaXplIHZfMn0iXSxbNiwyLCJcXHRleHRjaXJjbGVke1xcZm9vdG5vdGVzaXplIHZfM30iXSxbNSw2XSxbMCwxXSxbMSwyXSxbMSwxXSxbMywzXSxbNSw1LCIiLDIseyJhbmdsZSI6LTE4MH1dLFs0LDAsIiIsMCx7InNob3J0ZW4iOnsic291cmNlIjoxMCwidGFyZ2V0IjoxMH0sInN0eWxlIjp7ImJvZHkiOnsibmFtZSI6ImRhc2hlZCJ9fX1dLFs3LDcsIiIsMCx7ImFuZ2xlIjotMTgwfV0sWzMsNF0sWzgsOV0sWzgsOCwiIiwyLHsiYW5nbGUiOi0xODB9XSxbMTAsMTAsIiIsMCx7ImFuZ2xlIjotMTgwfV0sWzEsOSwiXFx0ZXh0Y29sb3J7cmVkfXt4fVxcbWFwc3RvIHZfMyIsMCx7InNob3J0ZW4iOnsic291cmNlIjozMCwidGFyZ2V0IjozMH0sInN0eWxlIjp7ImJvZHkiOnsibmFtZSI6ImRhc2hlZCJ9fX1dLFs3LDgsIiIsMCx7InNob3J0ZW4iOnsic291cmNlIjozMCwidGFyZ2V0IjozMH0sInN0eWxlIjp7ImJvZHkiOnsibmFtZSI6ImRhc2hlZCJ9fX1dLFszLDYsIlxcdGV4dGNvbG9ye3JlZH17eH1cXG1hcHN0byB2XzMiLDAseyJzaG9ydGVuIjp7InNvdXJjZSI6MzAsInRhcmdldCI6MzB9LCJzdHlsZSI6eyJib2R5Ijp7Im5hbWUiOiJkYXNoZWQifX19XSxbOCwxMCwiIiwwLHsiY3VydmUiOi0yfV0sWzcsNl0sWzEwLDldXQ== -->
<iframe class="quiver-embed" src="https://q.uiver.app/#q=WzAsMTEsWzQsMCwiXFx0ZXh0Y2lyY2xlZHtcXGZvb3Rub3Rlc2l6ZSB2XzF9Il0sWzUsMCwiXFx0ZXh0Y2lyY2xlZHtcXHRleHRjb2xvcntyZWR9e3h9fSJdLFs2LDAsIlxcdGV4dGNpcmNsZWR7XFxmb290bm90ZXNpemUgdl8yfSJdLFsxLDAsIlxcdGV4dGNpcmNsZWR7XFx0ZXh0Y29sb3J7cmVkfXt4fX0iXSxbMiwwLCJcXHRleHRjaXJjbGVke1xcZm9vdG5vdGVzaXplIHZfMn0iXSxbMCwyLCJcXHRleHRjaXJjbGVke1xcZm9vdG5vdGVzaXplIHZfMX0iXSxbMSwyLCJcXHRleHRjaXJjbGVke1xcZm9vdG5vdGVzaXplIHZfMn0iXSxbMiwyLCJcXHRleHRjaXJjbGVke1xcZm9vdG5vdGVzaXplIHZfM30iXSxbNCwyLCJcXHRleHRjaXJjbGVke1xcZm9vdG5vdGVzaXplIHZfMX0iXSxbNSwyLCJcXHRleHRjaXJjbGVke1xcZm9vdG5vdGVzaXplIHZfMn0iXSxbNiwyLCJcXHRleHRjaXJjbGVke1xcZm9vdG5vdGVzaXplIHZfM30iXSxbNSw2XSxbMCwxXSxbMSwyXSxbMSwxXSxbMywzXSxbNSw1LCIiLDIseyJhbmdsZSI6LTE4MH1dLFs0LDAsIiIsMCx7InNob3J0ZW4iOnsic291cmNlIjoxMCwidGFyZ2V0IjoxMH0sInN0eWxlIjp7ImJvZHkiOnsibmFtZSI6ImRhc2hlZCJ9fX1dLFs3LDcsIiIsMCx7ImFuZ2xlIjotMTgwfV0sWzMsNF0sWzgsOV0sWzgsOCwiIiwyLHsiYW5nbGUiOi0xODB9XSxbMTAsMTAsIiIsMCx7ImFuZ2xlIjotMTgwfV0sWzEsOSwiXFx0ZXh0Y29sb3J7cmVkfXt4fVxcbWFwc3RvIHZfMyIsMCx7InNob3J0ZW4iOnsic291cmNlIjozMCwidGFyZ2V0IjozMH0sInN0eWxlIjp7ImJvZHkiOnsibmFtZSI6ImRhc2hlZCJ9fX1dLFs3LDgsIiIsMCx7InNob3J0ZW4iOnsic291cmNlIjozMCwidGFyZ2V0IjozMH0sInN0eWxlIjp7ImJvZHkiOnsibmFtZSI6ImRhc2hlZCJ9fX1dLFszLDYsIlxcdGV4dGNvbG9ye3JlZH17eH1cXG1hcHN0byB2XzMiLDAseyJzaG9ydGVuIjp7InNvdXJjZSI6MzAsInRhcmdldCI6MzB9LCJzdHlsZSI6eyJib2R5Ijp7Im5hbWUiOiJkYXNoZWQifX19XSxbOCwxMCwiIiwwLHsiY3VydmUiOi0yfV0sWzcsNl0sWzEwLDldXQ==&amp;embed" width="744" height="432" style="border-radius: 8px; border: none;">
</iframe>
<p>Note that <code>X=v1</code> was also a valid answer to the query. However, in <img src="https://latex.codecogs.com/png.latex?%5Cmathsf%7BDat%7D">, the pushout does nothing, rather than adding another loop to <code>v1</code>:</p>
<!-- https://q.uiver.app/#q=WzAsMTEsWzQsMCwiXFx0ZXh0Y2lyY2xlZHtcXGZvb3Rub3Rlc2l6ZSB2XzF9Il0sWzUsMCwiXFx0ZXh0Y2lyY2xlZHtcXHRleHRjb2xvcntyZWR9e3h9fSJdLFs2LDAsIlxcdGV4dGNpcmNsZWR7XFxmb290bm90ZXNpemUgdl8yfSJdLFswLDAsIlxcdGV4dGNpcmNsZWR7XFx0ZXh0Y29sb3J7cmVkfXt4fX0iXSxbMSwwLCJcXHRleHRjaXJjbGVke1xcZm9vdG5vdGVzaXplIHZfMn0iXSxbMCwyLCJcXHRleHRjaXJjbGVke1xcZm9vdG5vdGVzaXplIHZfMX0iXSxbMSwyLCJcXHRleHRjaXJjbGVke1xcZm9vdG5vdGVzaXplIHZfMn0iXSxbMiwyLCJcXHRleHRjaXJjbGVke1xcZm9vdG5vdGVzaXplIHZfM30iXSxbNCwyLCJcXHRleHRjaXJjbGVke1xcZm9vdG5vdGVzaXplIHZfMX0iXSxbNSwyLCJcXHRleHRjaXJjbGVke1xcZm9vdG5vdGVzaXplIHZfMn0iXSxbNiwyLCJcXHRleHRjaXJjbGVke1xcZm9vdG5vdGVzaXplIHZfM30iXSxbNSw2XSxbMCwxXSxbMSwyXSxbMSwxXSxbMywzXSxbNSw1LCIiLDIseyJhbmdsZSI6LTE4MH1dLFszLDUsIlxcdGV4dGNvbG9ye3JlZH17eH1cXG1hcHN0byB2XzEiLDAseyJzaG9ydGVuIjp7InNvdXJjZSI6MzAsInRhcmdldCI6MzB9LCJzdHlsZSI6eyJib2R5Ijp7Im5hbWUiOiJkYXNoZWQifX19XSxbNCwwLCIiLDAseyJzaG9ydGVuIjp7InNvdXJjZSI6MTAsInRhcmdldCI6MTB9LCJzdHlsZSI6eyJib2R5Ijp7Im5hbWUiOiJkYXNoZWQifX19XSxbNyw3LCIiLDAseyJhbmdsZSI6LTE4MH1dLFszLDRdLFs4LDldLFs4LDgsIiIsMix7ImFuZ2xlIjotMTgwfV0sWzEwLDEwLCIiLDAseyJhbmdsZSI6LTE4MH1dLFsxLDksIlxcdGV4dGNvbG9ye3JlZH17eH1cXG1hcHN0byB2XzEiLDAseyJzaG9ydGVuIjp7InNvdXJjZSI6MzAsInRhcmdldCI6MzB9LCJzdHlsZSI6eyJib2R5Ijp7Im5hbWUiOiJkYXNoZWQifX19XSxbNyw4LCIiLDAseyJzaG9ydGVuIjp7InNvdXJjZSI6MzAsInRhcmdldCI6MzB9LCJzdHlsZSI6eyJib2R5Ijp7Im5hbWUiOiJkYXNoZWQifX19XSxbNyw2XSxbMTAsOV1d= -->
<iframe class="quiver-embed" src="https://q.uiver.app/#q=WzAsMTEsWzQsMCwiXFx0ZXh0Y2lyY2xlZHtcXGZvb3Rub3Rlc2l6ZSB2XzF9Il0sWzUsMCwiXFx0ZXh0Y2lyY2xlZHtcXHRleHRjb2xvcntyZWR9e3h9fSJdLFs2LDAsIlxcdGV4dGNpcmNsZWR7XFxmb290bm90ZXNpemUgdl8yfSJdLFswLDAsIlxcdGV4dGNpcmNsZWR7XFx0ZXh0Y29sb3J7cmVkfXt4fX0iXSxbMSwwLCJcXHRleHRjaXJjbGVke1xcZm9vdG5vdGVzaXplIHZfMn0iXSxbMCwyLCJcXHRleHRjaXJjbGVke1xcZm9vdG5vdGVzaXplIHZfMX0iXSxbMSwyLCJcXHRleHRjaXJjbGVke1xcZm9vdG5vdGVzaXplIHZfMn0iXSxbMiwyLCJcXHRleHRjaXJjbGVke1xcZm9vdG5vdGVzaXplIHZfM30iXSxbNCwyLCJcXHRleHRjaXJjbGVke1xcZm9vdG5vdGVzaXplIHZfMX0iXSxbNSwyLCJcXHRleHRjaXJjbGVke1xcZm9vdG5vdGVzaXplIHZfMn0iXSxbNiwyLCJcXHRleHRjaXJjbGVke1xcZm9vdG5vdGVzaXplIHZfM30iXSxbNSw2XSxbMCwxXSxbMSwyXSxbMSwxXSxbMywzXSxbNSw1LCIiLDIseyJhbmdsZSI6LTE4MH1dLFszLDUsIlxcdGV4dGNvbG9ye3JlZH17eH1cXG1hcHN0byB2XzEiLDAseyJzaG9ydGVuIjp7InNvdXJjZSI6MzAsInRhcmdldCI6MzB9LCJzdHlsZSI6eyJib2R5Ijp7Im5hbWUiOiJkYXNoZWQifX19XSxbNCwwLCIiLDAseyJzaG9ydGVuIjp7InNvdXJjZSI6MTAsInRhcmdldCI6MTB9LCJzdHlsZSI6eyJib2R5Ijp7Im5hbWUiOiJkYXNoZWQifX19XSxbNyw3LCIiLDAseyJhbmdsZSI6LTE4MH1dLFszLDRdLFs4LDldLFs4LDgsIiIsMix7ImFuZ2xlIjotMTgwfV0sWzEwLDEwLCIiLDAseyJhbmdsZSI6LTE4MH1dLFsxLDksIlxcdGV4dGNvbG9ye3JlZH17eH1cXG1hcHN0byB2XzEiLDAseyJzaG9ydGVuIjp7InNvdXJjZSI6MzAsInRhcmdldCI6MzB9LCJzdHlsZSI6eyJib2R5Ijp7Im5hbWUiOiJkYXNoZWQifX19XSxbNyw4LCIiLDAseyJzaG9ydGVuIjp7InNvdXJjZSI6MzAsInRhcmdldCI6MzB9LCJzdHlsZSI6eyJib2R5Ijp7Im5hbWUiOiJkYXNoZWQifX19XSxbNyw2XSxbMTAsOV1d=&amp;embed" width="744" height="432" style="border-radius: 8px; border: none;">
</iframe>
<p>Each answer to the query of a Datalog rule’s preconditions is a potential way to <em>ground</em> the rule, which can potentially add a new fact and bring one’s interpretation closer to the Datalog program’s Herbrand model.</p>
<p>A common extension, Datalog<img src="https://latex.codecogs.com/png.latex?%5E%5Cexists">, allows for the heads of rules to introduce new terms. For example, the rule “if you gave me an edge, I could give you path of length two which has the same source and target” is expressed as:</p>
<pre><code>edge(X,Z), edge(Z,Y) :- edge(X,Y). # note "Z" not in body of rule!</code></pre>
<p>This is actually the natural interpretation of <img src="https://latex.codecogs.com/png.latex?%5Cmathsf%7BDat%7D">, though we could restrict to a subcategory which has no ability to introduce terms: to do this we would require all rule morphisms to have their underlying function <img src="https://latex.codecogs.com/png.latex?I_V%5Crightarrow%20J_V+K"> be of the form <img src="https://latex.codecogs.com/png.latex?%7BI_V%20%5Coverset%7B%5Ciota%7D%5Crightarrowtail%20I_V+K%7D">.</p>
</section>
</section>
<section id="takeaway" class="level2" data-number="2">
<h2 data-number="2" data-anchor-id="takeaway"><span class="header-section-number">2</span> Takeaway</h2>
<p>We considered categories where objects play dual roles of being <em>queries</em> as well as <em>data</em>. In such categories, it is natural to think of elements of <img src="https://latex.codecogs.com/png.latex?%7B%5Crm%20Hom%7D(X,Y)"> as answers to the query of shape <img src="https://latex.codecogs.com/png.latex?X"> in data of shape <img src="https://latex.codecogs.com/png.latex?Y">. We can also think of an element of <img src="https://latex.codecogs.com/png.latex?%7B%5Crm%20Hom%7D(X,Y)"> as a query of shape <img src="https://latex.codecogs.com/png.latex?Y"> that depends on results to a query of shape <img src="https://latex.codecogs.com/png.latex?X">. Taking an answer to <img src="https://latex.codecogs.com/png.latex?X"> and using it to construct a canonical answer to <img src="https://latex.codecogs.com/png.latex?Y"> is a kind of substitution (or <em>grounding</em>), which can be characterized as a pushout.</p>
</section>
<section id="special-thanks-to-minnowbrook-logic-programming-seminar" class="level2" data-number="3">
<h2 data-number="3" data-anchor-id="special-thanks-to-minnowbrook-logic-programming-seminar"><span class="header-section-number">3</span> Special thanks to <a href="https://kmicinski.com/minnowbrook-seminar">Minnowbrook logic programming seminar</a></h2>
<p>Making explicit this connection between graph rewrite rules and datalog rules was one of many thoughts which came about talking to <a href="https://www.rntz.net/">Michael Arntzenius</a> and others while hiking in Adirondacks with a great group of logic programmers. This workshop was organized by <a href="https://kmicinski.com/">Kristopher Micinski</a> in May 2025.</p>
<div class="quarto-layout-panel" data-layout-ncol="3">
<div class="quarto-layout-row">
<div class="quarto-layout-cell" style="flex-basis: 33.3%;justify-content: center;">
<p><a href="lakes.jpg" class="lightbox" data-gallery="quarto-lightbox-gallery-1"><img src="https://topos.institute/blog/2025-08-06-substitution-is-pushout/lakes.jpg" class="img-fluid"></a></p>
</div>
<div class="quarto-layout-cell" style="flex-basis: 33.3%;justify-content: center;">
<p><a href="canoe.jpg" class="lightbox" data-gallery="quarto-lightbox-gallery-2"><img src="https://topos.institute/blog/2025-08-06-substitution-is-pushout/canoe.jpg" class="img-fluid"></a></p>
</div>
<div class="quarto-layout-cell" style="flex-basis: 33.3%;justify-content: center;">
<p><a href="group.jpg" class="lightbox" data-gallery="quarto-lightbox-gallery-3"><img src="https://topos.institute/blog/2025-08-06-substitution-is-pushout/group.jpg" class="img-fluid"></a></p>
</div>
</div>
</div>


</section>


<script defer="" src="https://comments.topos.institute/comentario.js"></script>

<div id="quarto-appendix" class="default"><section id="footnotes" class="footnotes footnotes-end-of-document"><h2 class="anchored quarto-appendix-heading">Footnotes</h2>

<ol>
<li id="fn1"><p>This is precisely the data of a functor <img src="https://latex.codecogs.com/png.latex?%7B%7B%5Crm%20SchGraph%7D%5Crightarrow%5Cmathsf%7BSet%7D%7D">, where <img src="https://latex.codecogs.com/png.latex?%7B%7B%5Crm%20SchGraph%7D:=%5Cboxed%7B%7B%5Crm%20Edge%7D%5Crightrightarrows%20%7B%5Crm%20Vertex%7D%7D%7D">. Morphisms are natural transformations of these functors. Everything in this section applies to <img src="https://latex.codecogs.com/png.latex?%5Cmathsf%7BC%7D">-sets generally.↩︎</p></li>
<li id="fn2"><p>A graph homomorphism <img src="https://latex.codecogs.com/png.latex?h:G%5Crightarrow%20H"> is a pair of functions, <img src="https://latex.codecogs.com/png.latex?h_V:%20V_G%5Crightarrow%20V_H"> and <img src="https://latex.codecogs.com/png.latex?h_E:%20E_G%5Crightarrow%20E_H"> such that <img src="https://latex.codecogs.com/png.latex?h_V%5Ccirc%20s_G=s_H%5Ccirc%20h_E"> and <img src="https://latex.codecogs.com/png.latex?h_E%5Ccirc%20t_G=t_H%5Ccirc%20h_E">.↩︎</p></li>
<li id="fn3"><p>It’s possible to have multiple edges between the same pair of vertices, but the graphs appearing in this post will happen to not have such parallel edges. Hence we will usually avoid labeling edges.↩︎</p></li>
<li id="fn4"><p>I.e. if you give me an answer to the domain query of the morphism, I can give you an answer to the codomain query of the morphism.↩︎</p></li>
<li id="fn5"><p>The <code>:-</code> is meant to be an arrow of sorts pointing to the left.↩︎</p></li>
<li id="fn6"><p>Standard Datalog syntax has a single fact as the postcondition of a rule, but some Datalog interfaces allow providing multiple facts as the postconditions for some set of preconditions. This could be desugared to multiple rules (one for each postcondition) which all have the same preconditions.↩︎</p></li>
<li id="fn7"><p>Implicitly it also assigns all constants to themselves, which is what allows us to compose such functions and get a category of such morphisms.↩︎</p></li>
<li id="fn8"><p>Consider the arity 2 case: <img src="https://latex.codecogs.com/png.latex?r_1,r_2:%20A_r%5Crightarrow%20X"> are jointly monic if and only if <img src="https://latex.codecogs.com/png.latex?A_r"> is the limit of the diagram: <!-- https://q.uiver.app/#q=WzAsNCxbMCwwLCJBX3IiXSxbMiwwLCJBX3IiXSxbMCwxLCJYIl0sWzIsMSwiWCJdLFswLDIsInJfMSIsMl0sWzAsMywicl8yIiwwLHsibGFiZWxfcG9zaXRpb24iOjIwfV0sWzEsMiwicl8xIiwyLHsibGFiZWxfcG9zaXRpb24iOjIwfV0sWzEsMywicl8yIl1d --> <iframe class="quiver-embed" src="https://q.uiver.app/#q=WzAsNCxbMCwwLCJBX3IiXSxbMiwwLCJBX3IiXSxbMCwxLCJYIl0sWzIsMSwiWCJdLFswLDIsInJfMSIsMl0sWzAsMywicl8yIiwwLHsibGFiZWxfcG9zaXRpb24iOjIwfV0sWzEsMiwicl8xIiwyLHsibGFiZWxfcG9zaXRpb24iOjIwfV0sWzEsMywicl8yIl1d&amp;embed" width="432" height="304" style="border-radius: 8px; border: none;"></iframe>.<br> Let’s make sense of this diagram as a constraint on models of the sketch by thinking of it as a limit diagram in <img src="https://latex.codecogs.com/png.latex?%5Cmathsf%7BSet%7D">. The limit is set of pairs of elements of <img src="https://latex.codecogs.com/png.latex?(x,y)%20%5Cin%20M(A_r)">, such that <img src="https://latex.codecogs.com/png.latex?M(r_1)(x)%20=%20M(r_1)(y)"> <em>and</em> <img src="https://latex.codecogs.com/png.latex?M(r_2)(x)=M(r_2)(y)"> are simply the pairs <img src="https://latex.codecogs.com/png.latex?(a,%20a)"> for all <img src="https://latex.codecogs.com/png.latex?a%20%5Cin%20M(A_r)">. Of course, these pairs will always be a solution to the equation described by the limit, but <img src="https://latex.codecogs.com/png.latex?M(r_1)"> and <img src="https://latex.codecogs.com/png.latex?M(r_2)"> being jointly monic means there will be <em>no other</em> solutions.↩︎</p></li>
</ol>
</section></div> ]]></description>
  <category>rewriting</category>
  <guid>https://topos.institute/blog/2025-08-06-substitution-is-pushout/</guid>
  <pubDate>Wed, 06 Aug 2025 00:00:00 GMT</pubDate>
</item>
<item>
  <title>Blog / CatColab for Model Building</title>
  <dc:creator>Nathaniel Osgood</dc:creator>
  <link>https://topos.institute/blog/2025-07-18-catcolab-for-model-building/</link>
  <description><![CDATA[ 





<div class="callout callout-style-simple callout-none no-icon">
<div class="callout-body d-flex">
<div class="callout-icon-container">
<i class="callout-icon no-icon"></i>
</div>
<div class="callout-body-container">
<p><em>This is a crosspost from John Baez’s blog <a href="https://johncarlosbaez.wordpress.com/2025/07/08/catcolab-for-model-building/">Azimuth</a>, written by <a href="https://www.cs.usask.ca/~osgood/">Nathaniel D. Osgood</a>.</em></p>
</div>
</div>
</div>
<p>Together with 4 students from our Computational Epidemiology and Public Health Informatics Lab (<a href="https://cephil.ca/">CEPHIL</a>), I spent my Friday at one of our community group model building event, this one focused on drivers for homelessness in our city (Saskatoon, Canada).</p>
<p>Although our behavioural ethics review board stipulated that the group should not include people who are currently homeless, the participants were people with lived experience of homelessness, with most having personally experienced homelessness within recent years.</p>
<p>Building on facilitated discussion, the focus of the day consisted of a group model building session. To allow for some diversity of thought and exploration, the participants divided into two teams. The <a href="https://en.wikipedia.org/wiki/Causal_loop_diagram">causal loop diagrams</a> resulting from about 1.5-2 hours of work on the part of each team were very thoughtful, and the diagrams captured many important insights and perspectives, and lived experiences. It bears emphasis that while some of those from our lab helped facilitate the discussions, the identification of variables and the existence, directionality and polarity of the links between such variables came firmly from the participants with lived experience themselves. Although they are not yet suitable for public distribution, I thought that I would provide a glimpse of the work products.</p>
<p><a href="catcolab_osgood_1.jpg" class="lightbox" data-gallery="quarto-lightbox-gallery-1"><img src="https://topos.institute/blog/2025-07-18-catcolab-for-model-building/catcolab_osgood_1.jpg" class="img-fluid"></a></p>
<p><a href="catcolab_osgood_2.jpg" class="lightbox" data-gallery="quarto-lightbox-gallery-2"><img src="https://topos.institute/blog/2025-07-18-catcolab-for-model-building/catcolab_osgood_2.jpg" class="img-fluid"></a></p>
<p>For the next stages of this work, <a href="https://github.com/ToposInstitute/CatColab">CatColab</a> will be a key tool—and arguably the single most important tool in our toolbox to secure substantive insights and value from these diagrams. Building on the strong applied category theory experience of 3 of the 4 students involved, we will be using CatColab to find feedback loops in these diagrams individually, and then when combined. This ability to find feedbacks in this fashion will be a tremendous asset for learning from these diagrams. It will also be used to visualize and explore the diagrams, although it will not be the only tool to serve in this capacity. When the ability to compose causal loop diagrams is added to CatColab, we plan to make central use of that feature as well.</p>
<p>Friday’s event is the first in a series focusing on this pressing problem in our community through tapping the deep and grounded knowledge of those with lived experience. It is a great testimonial to the power of CatColab that it will play such a central role in the value delivery from such events. We hope to contribute to the development of CatColab to further its ability to deliver insights and benefits not only to our research team, but also to community members themselves. I wish to express my—indeed, our—gratitude to the core CatColab team for their delivery of such a valuable tool for insight into complex social issues such as homelessness (together with cognate issues such as mental health, domestic violence and substance use, lack of affordable housing), and CEPHIL’s committment to contributing to the development of that tool to further develop its potential in this sphere.</p>



<script defer="" src="https://comments.topos.institute/comentario.js"></script>

 ]]></description>
  <category>CatColab</category>
  <category>modeling</category>
  <category>crosspost</category>
  <guid>https://topos.institute/blog/2025-07-18-catcolab-for-model-building/</guid>
  <pubDate>Fri, 18 Jul 2025 00:00:00 GMT</pubDate>
</item>
<item>
  <title>Blog / Liberating synthetic quasi-coherence from forcing</title>
  <dc:creator>David Jaz Myers</dc:creator>
  <link>https://topos.institute/blog/2025-07-13-liberating-synthetic-quasi-coherence-from-forcing/</link>
  <description><![CDATA[ 





<section id="the-joy-of-synthetic-mathematics" class="level1" data-number="1">
<h1 data-number="1"><span class="header-section-number">1</span> The joy of synthetic mathematics</h1>
<p>Since <a href="https://en.wikipedia.org/wiki/Nicolas_Bourbaki">Bourbaki’s first lectures at the Café Grill-Room A. Capoulade in 1934</a>, one could be forgiven for holding the belief that all mathematical activity consists of ever more elaborate arrangements of sets within sets within sets. We begin with the natural numbers, the ability to form pairs, and the ability to comprehend subsets carved out by properties, and before you know it we are describing <a href="https://en.wikipedia.org/wiki/Rigid_analytic_space">rigid analytic spaces</a> and <a href="https://ncatlab.org/nlab/show/ultracategory">ultracategories</a> and <a href="https://topos.institute/blog/2024-06-20-compact-double-categories-1/">twisted lax double functors</a> — all just increasingly complex arrangements of sets. No matter what we can imagine, Bourbaki assures us, we can express in <a href="https://en.wikipedia.org/wiki/Cantor%27s_paradise">Cantor’s paradise</a>.<sup>1</sup></p>
<p>A complex arrangement of sets satisfying certain properties and assumptions is known in logic as a <em>theory</em>. There is a theory of groups, a theory of rings, a theory of ultracategories and twisted lax double functors. A <em>model</em> of a theory is an actual arrangement of sets actually satisfying those properties and assumptions. The integers <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BZ%7D"> with their addition <img src="https://latex.codecogs.com/png.latex?+%20:%20%5Cmathbb%7BZ%7D%20%5Ctimes%20%5Cmathbb%7BZ%7D%20%5Cto%20%5Cmathbb%7BZ%7D"><sup>2</sup> are a model of the theory of groups; with their multiplication as well they become a model of the theory of rings. The traditional view is that any mathematical concept, no matter how invovled, can modelled by some arrangement of sets expressed by a theory (in some or other logic).</p>
<p>But in 1963, Lawvere ate from the apple of knowledge in Cantor’s paradise and produced his <a href="http://www.tac.mta.ca/tac/reprints/articles/5/tr5.pdf">thesis</a> on the <em>functorial semantics of algebraic theories</em>. Lawvere identified an algebraic theory <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BT%7D"> with a category <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BL%7D(%5Cmathbb%7BT%7D)"> built from the terms of the theory, and identified models <img src="https://latex.codecogs.com/png.latex?M%20%5Cmodels%20%5Cmathbb%7BT%7D"> of <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BT%7D"> with a product-preserving functors <img src="https://latex.codecogs.com/png.latex?M%20:%20%5Cmathcal%7BL%7D(%5Cmathbb%7BT%7D)%20%5Cto%20%5Cmathsf%7BSet%7D"> into the category of sets. So far, not so different. But Lawvere’s reformulation opens up a whole new world for logic: now we can define a model of <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BT%7D"> in <em>any</em> category <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BC%7D"> with finite products as a product-preserving functor <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BL%7D(%5Cmathbb%7BT%7D)%20%5Cto%20%5Cmathcal%7BC%7D">. For example, if <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BT%7D"> is the theory of groups, then its models in in the category of sets are the groups as usual, but its models in the category of smooth manifolds are the <a href="https://en.wikipedia.org/wiki/Lie_group">Lie groups</a> and in the category of algebraic varieties are the <a href="https://en.wikipedia.org/wiki/Algebraic_group">algebraic groups</a>, and so on. With this extra freedom, we can work in any category we like, so long as it has finite products.<sup>3</sup> Even more, there is always a <em>universal</em> choice of model: the identity functor <img src="https://latex.codecogs.com/png.latex?%5Cmathsf%7Bid%7D%20:%20%5Cmathcal%7BL%7D(%5Cmathbb%7BT%7D)%20%5Cto%20%5Cmathcal%7BL%7D(%5Cmathbb%7BT%7D)"> is a model of <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BT%7D"> with absolutely no accidental assumptions creeping in. This is the <em>universal model</em> of the theory <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BT%7D">.</p>
<p>Soon, Lawvere <a href="https://lawverearchives.com/wp-content/uploads/2024/12/1970-quantifiers-and-sheaves.pdf">observed</a> that just as universal algebra could be interpreted in any category with finite products, <a href="https://arxiv.org/abs/1212.6543">all of set theory</a> could be interpreted in any of Grothendieck’s categories of set-valued sheaves: <em><a href="https://en.wikipedia.org/wiki/Topos">toposes</a></em>. Toposes of sheaves support not only a notion of natural number and finite products, but also <a href="https://ncatlab.org/nlab/show/subobject+classifier">power-sets and a comprehension axiom</a>. In fact, toposes interpret all of Martin-Löf’s (roughly contemporaneously developed) <a href="https://raw.githubusercontent.com/michaelt/martin-lof/master/pdfs/An-Intuitionistic-Theory-of-Types-1972.pdf&amp;ved=2ahUKEwjajp69saaOAxX7WEEAHTmGAzQQFnoECAkQAQ&amp;usg=AOvVaw335WGi7CpzByPOaPOuazsi">dependent type theory</a> with a <a href="https://ncatlab.org/nlab/show/propositional+extensionality">univalent universe of propositions</a>.</p>
<p>This means that any sort of theory we could interpret in the category of sets, we could just as well interpret in a category of sheaves — in <em>toposes</em>. We gain a powerful freedom in this ability to work “internally” to any topos, because toposes can have wonderful properties which are not true of the category of sets. For example, there are toposes where <a href="https://ncatlab.org/nlab/show/Brouwer%27s+continuity+principle">every real valued function is continuous</a><sup>4</sup>, or <a href="https://ncatlab.org/nlab/show/realizability+topos">computable</a>, or even <a href="https://ncatlab.org/nlab/show/smooth+set">smooth</a><sup>5</sup>. Because of this, you can use ordinary set theoretic arguments to construct whatever complicated functions you want, and they will be continuous/computable/measurable/regular/…, without you even having to check. That is, so as long as you judiciously avoid the <a href="https://en.wikipedia.org/wiki/Law_of_excluded_middle">law of excluded middle</a> and the <a href="https://en.wikipedia.org/wiki/Axiom_of_choice">axiom of choice</a>, which do not hold in all toposes. The logic of toposes is <em><a href="https://ncatlab.org/nlab/show/constructive+mathematics">constructive</a></em>.</p>
<p>The fact that you can just interpret set theoretical arguments into any topos has all sorts of nice and powerful consequences; for example, the category of abelian groups in any topos is an <a href="https://ncatlab.org/nlab/show/abelian+category">abelian category</a> (because the proof of this for sets doesn’t use the law of excluded middle or the axiom of choice), a fact which has been <a href="https://www.math.uni-bonn.de/people/scholze/Condensed.pdf">highlighted by Clausen and Scholze in their re-foundations of analysis</a> as a reason to work in a topos rather than with topological spaces. Even better, structures and properties on sheaves which may be difficult to describe from an ordinary <em>external</em> point of view can become familiar notions when seen from the <em>internal</em> point of view:</p>
<ul>
<li>A sheaf of rings is just a ring, internally.</li>
<li>A sheaf of modules over a sheaf of rings is just a module over that ring, internally.</li>
<li>A sheaf of modules is of <a href="https://stacks.math.columbia.edu/tag/01B4">finite type</a> just when it is a finitely generated module, internally, and so on…<sup>6</sup></li>
</ul>
<p>We can then prove things about sheaves of finite type over some scheme by translating statements about finitely generated modules internal to the topos of sheaves on that scheme. We can also <em>define</em> sheaves internally in very conceptual ways. For example, projective <img src="https://latex.codecogs.com/png.latex?n">-space may be defined internally as the set of lines through the origin in affine space of dimension <img src="https://latex.codecogs.com/png.latex?n+1">; this is the usual definition which works over, say, the complex numbers, but taken internally it works over any base scheme.</p>
<p>By axiomatizing the special features of a topos we would like to work in, we can then work in what feels like ordinary set theory and carry out arguments which are more conceptually transparent than the corresponding external arguments would be. This is called <em><a href="https://ncatlab.org/nlab/show/synthetic+mathematics">synthetic mathematics</a></em>, and there is now a flourishing garden of synthetic approaches to various mathematical topics:<sup>7</sup></p>
<ul>
<li>First, there was Lawvere’s <em><a href="https://ncatlab.org/nlab/show/synthetic+differential+geometry">synthetic differential geometry</a></em>, which takes a <em>smooth real line</em> <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BR%7D_s"> as axiomatic and supposes the <a href="https://ncatlab.org/nlab/show/Kock-Lawvere+axiom">Kock-Lawvere axioms</a>, including that: “every function <img src="https://latex.codecogs.com/png.latex?f%20:%20%5C%7B%5Cvarepsilon%20:%20%5Cmathbb%7BR%7D_s%20%5Cmid%20%5Cvarepsilon%5E2%20=%200%20%5C%7D%20%5Cto%20%5Cmathbb%7BR%7D_s"> of a first order infinitesimal real number is linear: <img src="https://latex.codecogs.com/png.latex?f(%5Cvarepsilon)%20=%20a%20+%20b%5Cvarepsilon"> for unique <img src="https://latex.codecogs.com/png.latex?a"> and <img src="https://latex.codecogs.com/png.latex?b">”. Synthetic differential geometry is a wonderful little field; I did my PhD in it.<sup>8</sup></li>
<li>In his <a href="https://rawgit.com/iblech/internal-methods/master/notes.pdf">thesis</a>, Ingo Blechschmidt laid out the beginnings of <em><a href="https://ncatlab.org/nlab/show/synthetic+algebraic+geometry">synthetic algebraic geometry</a></em>, and it has <a href="https://arxiv.org/abs/2307.00073">since been taken up by a group at Gothenburg/Chalmers</a>.</li>
<li><a href="https://www.dpmms.cam.ac.uk/~jmeh1/Research/Oldpapers/synthetic91.pdf">Martin Hyland</a> began a study into <em><a href="https://ncatlab.org/nlab/show/synthetic+domain+theory">synthetic domain theory</a></em>, which has continued to flourish at Cambridge (as in, for example, <a href="https://arxiv.org/abs/2505.13096">this recent paper by Sterling and Ye</a>).</li>
<li>In his work on <a href="https://en.wikipedia.org/wiki/Homotopy_type_theory">homotopy type theory</a>, Voevodsky (as well Warren and Awodey) identified the correct internal logic of <a href="https://ncatlab.org/nlab/show/(infinity,1)-topos"><em>higher</em> toposes (of sheaves of homotopy types)</a> which opened up the possibility for <em><a href="https://ncatlab.org/nlab/show/synthetic+homotopy+theory">synthetic homotopy theory</a></em>.</li>
<li>In his <em><a href="http://www.tac.mta.ca/tac/volumes/19/3/19-03abs.html">Axiomatic Cohesion</a></em>, Lawvere identified some <em><a href="https://ncatlab.org/nlab/show/modality">modalities</a></em> on a topos which characterize it as a topos of <em>spaces</em>; <a href="https://ncatlab.org/schreiber/show/differential+cohomology+in+a+cohesive+topos">Schreiber interpreted these in higher toposes</a>; and <a href="https://arxiv.org/abs/1509.07584">Shulman described a type theory for them</a>, opening the way for <em>synthetic algebraic topology</em>.<sup>9</sup></li>
<li><em><a href="https://ncatlab.org/nlab/show/synthetic+topology">Synthetic topology</a></em> emerged out of synthetic domain theory through <a href="https://paultaylor.eu/ASD/">Taylor’s work on <em>abstract stone duality</em></a> and <a href="https://martinescardo.github.io/TypeTopology/">Escardó’s work on the topology of types</a>; it has also been taken up by the <a href="https://arxiv.org/abs/2412.03203">Chalmers group</a>.</li>
<li>Riehl and Shulman put forward a <a href="https://higher-structures.math.cas.cz/api/files/issues/Vol1Iss1/RiehlShulman">simplicial type theory</a> for working in (higher) toposes of simplicial sheaves. <a href="https://ncatlab.org/nlab/show/Jonathan+Weinberger">Weinberger et. al.</a> have used this type theory to study <em><a href="https://ncatlab.org/nlab/show/formal+%28infinity%2C1%29-category+theory">synthetic higher category theory</a></em>.</li>
<li><a href="http://tobiasfritz.science/2019/cps_workshop/slides/simpson.pdf">Alex Simpson has begun working on a <em>synthetic probability theory</em></a>, which has strong relations to <a href="https://arxiv.org/abs/1701.02547">convenient categories for higher order probability theory</a>.</li>
</ul>
<p>It is a bit difficult to describe how pleasant it is to work synthetically without running through a single example in full; but this introduction has really gone on long enough. If you’re interested, I recommend checking out <a href="https://www.cambridge.org/core/books/primer-of-infinitesimal-analysis/B0EF33F73CAF97C180897D2FD0AD1B6E">John Bell’s <em>A primer of infinitesimal analysis</em></a> for an elementary introduction to synthetic differential geometry and <a href="https://rawgit.com/iblech/internal-methods/master/notes.pdf">Ingo Blechschmidt’s wonderful PhD thesis</a> for a comprehensive introduction on the uses of synthetic reasoning in algebraic geometry.</p>
</section>
<section id="which-axioms-should-we-take" class="level1" data-number="2">
<h1 data-number="2"><span class="header-section-number">2</span> Which axioms should we take?</h1>
<p>A work in synthetic mathematics begins by laying out some axioms which hold in the topos we intend to work in. However, it hasn’t always been clear exactly which axioms we need in order to prove the things we want to prove. For example, while the first axiom of synthetic differential geometry presented above is sufficient for some basic facts about derivatives, in order to argue well about higher order derivatives it needs to be extended to higher order infinitesimals. Even with a pretty comprehensive list of axioms (such as those at the beginning of <a href="https://www.cambridge.org/core/books/synthetic-differential-topology/446AD9AE704BD756D03769528DF668A0">Bunge et. al.’s <em>Synthetic differential topology</em></a>), we often run into cases that require more axioms.<sup>10</sup> It’s not tenable to constantly fiddle with foundations in the course of a proof.<sup>11</sup></p>
<p>The main axioms generally fall in the following three sorts:</p>
<ul>
<li>(Duality): There is a duality between “affine schemes” and “finitely presented algebras”. In the algebraic setting, this is what Ingo Blechschmidt called <em>synthetic quasi-coherence</em> in his thesis. But it also includes the Kock-Lawvere axiom, which asks for a duality between <a href="https://ncatlab.org/nlab/show/infinitesimally+thickened+point">Weil algebras</a> and “infinitesimal varieties”<sup>12</sup>, and <a href="https://ncatlab.org/nlab/show/Phoa%27s+principle">Phoa’s principle</a> as emphasized in <a href="https://arxiv.org/abs/2505.13096">Sterling and Ye’s recent paper (see Section 7)</a>. It also appears as Axiom 10 in <a href="https://arxiv.org/pdf/2407.09146">this paper on synthetic higher category theory</a>.</li>
<li>(Local choice): Any surjection into an “affine scheme” admits sections on an “open cover”. This was isolated by <a href="https://arxiv.org/abs/2307.00073">Cherubini-Coquand-Hutzler</a> in the algebraic setting as Zariski local choice, but it also includes the <a href="https://www.taylorfrancis.com/chapters/edit/10.1201/9781003073055-6/local-concepts-synthetic-differential-geometry-germ-representability-marta-bunge-eduardo-dubuc">Bunge-Dubuc Covering Property</a> from synthetic differential geometry, as well as the projectivity of the simplices which Mitchell Riley and I assume of our <a href="https://arxiv.org/abs/2301.13780">simplicial cohesion</a> in order to give a synthetic proof of the nerve theorem.</li>
<li>(Tinyness): Some objects are <em>tiny</em>: the functor <img src="https://latex.codecogs.com/png.latex?(T%20%5Cto%20(-))"> has<sup>13</sup> a right adjoint. This appears in synthetic differential geometry with the assumption that the infinitesimal varieties are tiny, which allows for the definition of <em>differential form classifiers</em>. <a href="https://arxiv.org/abs/2501.19187">Mark Williams has used</a> presentability of (tiny) representables to show that dualities present for presheaves descend to sheaves.</li>
</ul>
<p>But this scheme is more of a suggestion than a formula. What we need is a systematic approach to choosing axioms for synthetic mathematics.</p>
</section>
<section id="blechschmidts-generalized-nullstellensatz" class="level1" data-number="3">
<h1 data-number="3"><span class="header-section-number">3</span> Blechschmidt’s <em>generalized nullstellensatz</em></h1>
<p>In an <a href="https://github.com/iblech/internal-methods/blob/master/paper-qcoh.pdf">unpublished but widely circulating note, “<em>qcoh</em>”</a>, Ingo Blechschmidt has put forward a general axiom scheme which should work for any topos. I’ll work towards describing his idea here (using my own notation, for those following along in <em>qcoh</em>). From this point on, this blog post will assume that you know a fair bit of topos theory.</p>
<p>Lawvere’s functorial semantics for algebraic theories in cartesian categories and finite-product-preserving functors may be extended to a functorial semantics for positive, infinitary first-order theories (<a href="https://ncatlab.org/nlab/show/geometric+theory">“geometric” theories</a>) in toposes and <a href="https://ncatlab.org/nlab/show/geometric+morphism">“geometric morphisms”</a> between them. A “geometric” theory is a theory in first-order logic which allows for equality, finite conjunctions, and infinite disjunctions (i.e.&nbsp;disjunctions indexed by an arbitrary set). For any such theory <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BT%7D">, there is a <em>classifying topos</em> <img src="https://latex.codecogs.com/png.latex?%5Cmathsf%7BSet%7D%5B%5Cmathbb%7BT%7D%5D"> so that models of <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BT%7D"> in any topos <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BE%7D"> correspond to geometric morphisms <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BE%7D%20%5Cto%20%5Cmathsf%7BSet%7D%5B%5Cmathbb%7BT%7D%5D">. The identity morphism therefore corresponds to a model <img src="https://latex.codecogs.com/png.latex?U_%7B%5Cmathbb%7BT%7D%7D"> of <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BT%7D"> in <img src="https://latex.codecogs.com/png.latex?%5Cmathsf%7BSet%7D%5B%5Cmathbb%7BT%7D%5D">, and this is the <em>universal model</em> of <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BT%7D">.</p>
<p>Furthermore, <em>every</em> topos of sheaves is the classifying topos for some theory; namely, if <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BE%7D%20=%20%5Cmathsf%7BSh%7D(C,%20j)"> is the topos of sheaves on some <a href="https://ncatlab.org/nlab/show/site">site</a>, then <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BE%7D"> classifies “flat, <img src="https://latex.codecogs.com/png.latex?j">-continuous functors” out of <img src="https://latex.codecogs.com/png.latex?C"> by <a href="https://ncatlab.org/nlab/show/Diaconescu%27s+theorem">Diaconescue’s theorem</a>. Therefore, no matter what topos we intend to work internal to, we should at least start by assuming that we have a model <img src="https://latex.codecogs.com/png.latex?U_%7B%5Cmathbb%7BT%7D%7D"> of a theory <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BT%7D"> it classifies. For example:</p>
<ul>
<li>If we want to do synthetic algebraic geometry in the big Zariski topos, we may first appeal to the fact that the big Zariski topos classifies the theory of local rings<sup>14</sup> with the affine line <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BA%7D"> being the universal local ring itself. We may then begin our axiomatization by asking for a local ring <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BA%7D">.</li>
<li>If we want to work with simplicial sets, we may appeal to the fact that the topos of simplicial sets <a href="https://ncatlab.org/nlab/show/generic+interval">classifies total orders with distinct top and bottom elements</a>, with the 1-simplex <img src="https://latex.codecogs.com/png.latex?%5CDelta%5B1%5D"> being the universal model (and with <img src="https://latex.codecogs.com/png.latex?%5CDelta%5B2%5D%20%5Chookrightarrow%20%5CDelta%5B1%5D%5Ctimes%20%5CDelta%5B1%5D"> the order relation). We may then begin our axiomatization by asking for a total order with distinct top and bottom elements.</li>
</ul>
<p>However, satisfying this assumption only guarantees that we are working in some topos equipped with a geometric morphism to the topos we intended to work in; we need something else to guarantee that this geometric morphism is the identity. Now, inverse images of geometric morphisms preserve the interpretations of all positive formulas (because they preserve finite limits and infinite colimits, and these suffice to interpret any positive formula), so that any <em>positive</em> formula which is true of the universal model is true of all models in all toposes; conversely, every positive formula which is true of the universal model is <em>positively provable</em> (see, e.g.&nbsp;<a href="https://arxiv.org/abs/0906.3061">Theorem 2.4 of this paper</a>. Therefore, whatever extra axioms we need to take, they can’t be positive. The special features of the universal model are <em>negative</em>.<sup>15</sup></p>
<p>Some of these negative properties have been known for a long time. For example, <a href="">Kock remarked in 197?</a> that the affine line in the big Zariski topos (the universal local ring) is in fact a <em>field</em>: every non-zero element has an inverse. This is a negative property because it is an implication with an implication in the antecedent:</p>
<p><img src="https://latex.codecogs.com/png.latex?%0A(0%20=%20x)%20%5CRightarrow%20%5Cbot%20%5C,%5Cvdash%5C,%20%5Cexists%20y.%20xy%20=%201.%0A"></p>
<p>In his thesis, Bechschmidt extended the Kock-Lawvere axiom to his <em>synthetic quasi-coherence</em> axiom and observes that it suffices to prove all known negative properties about the affine line, including that it is a field. But Blechschmidt doesn’t stop there. In <em><a href="https://github.com/iblech/internal-methods/blob/master/paper-qcoh.pdf">qcoh</a></em>, he isolates a general axiom scheme which suffices to prove <em>every</em> special property of the universal model <img src="https://latex.codecogs.com/png.latex?U_%7B%5Cmathbb%7BT%7D%7D"> of a geometric theory <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BT%7D">. He calls this his <em>general nullstellensatz</em>, though I believe it should be called <em>quasi-coherent definability</em>.</p>
<p>The idea is simple and obviously wrong: what if every proposition concerning the universal model were positively definable, and every true proposition provable? Any true proposition about the universal model — even the weird negative ones — would follow from this axiom scheme and the assumption that <img src="https://latex.codecogs.com/png.latex?U_%7B%5Cmathbb%7BT%7D%7D"> was a model of <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BT%7D">.</p>
<p>Of course, this axiom scheme can’t hold. Blechschmidt’s genius in <em><a href="https://github.com/iblech/internal-methods/blob/master/paper-qcoh.pdf">qcoh</a></em> is to find a restricted version of it which does. Suppose <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BT%7D"> is a positive theory (in <img src="https://latex.codecogs.com/png.latex?%5Cmathsf%7BSet%7D">); we can then pull it back to get a positive theory <img src="https://latex.codecogs.com/png.latex?%5Cgamma%5E%7B%5Cast%7D%5Cmathbb%7BT%7D"> in the classifying topos <img src="https://latex.codecogs.com/png.latex?%5Cmathsf%7BSet%7D%5B%5Cmathbb%7BT%7D%5D">. We can then form a new theory, the <em>slice theory</em> <img src="https://latex.codecogs.com/png.latex?U_%7B%5Cmathbb%7BT%7D%7D%20%5Cdownarrow%20%5Cgamma%5E%7B%5Cast%7D%5Cmathbb%7BT%7D"> in <img src="https://latex.codecogs.com/png.latex?%5Cmathsf%7BSet%7D%5B%5Cmathbb%7BT%7D%5D"> by adding in constant terms <img src="https://latex.codecogs.com/png.latex?c(e)"> for every <img src="https://latex.codecogs.com/png.latex?e%20:%20U_%5Cmathbb%7BT%7D"> (of the correct sorts, when <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BT%7D"> is multi-sorted). This is the theory of <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BT%7D">-homorphisms out of <img src="https://latex.codecogs.com/png.latex?U_%7B%5Cmathbb%7BT%7D%7D">; its classifying topos <img src="https://latex.codecogs.com/png.latex?%5Cmathsf%7BSet%7D%5B%5Cmathbb%7BT%7D%5D%5BU_%7B%5Cmathbb%7BT%7D%7D%20%5Cdownarrow%20%5Cgamma%5E%7B%5Cast%7D%20%5Cmathbb%7BT%7D%5D"> is, externally, the morphism <img src="https://latex.codecogs.com/png.latex?d%20:%20%5Cmathsf%7BSet%7D%5B%5Cmathsf%7BHom%7D_%7B%5Cmathbb%7BT%7D%7D%5D%20%5Cto%20%5Cmathsf%7BSet%7D%5B%5Cmathbb%7BT%7D%5D"> from the classifying topos for <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BT%7D">-homomorphisms to the classifying topos of <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BT%7D"> which classifies the domain of the universal homomorphism.</p>
<p>This is a special sort of <img src="https://latex.codecogs.com/png.latex?%5Cmathsf%7BSet%7D%5B%5Cmathbb%7BT%7D%5D">-theory, since it only ever uses <img src="https://latex.codecogs.com/png.latex?%5Cmathsf%7BSet%7D">-indexed disjunctions.<sup>16</sup> Blechschmidt calls these “geometric* theories”, but I will call them <em>quasi-coherent</em> theories on account of the following analogy: a theory is <em>coherent</em> when it only uses <em>finitary</em> disjunctions, and a sheaf of modules is <em>coherent</em> when it is locally of finite presentation<sup>17</sup>; a sheaf is <em>quasi-coherent</em> when it is locally of <img src="https://latex.codecogs.com/png.latex?%5Cmathsf%7BSet%7D">-indexed presentation; so, a theory is <em>quasi-coherent</em> when it only uses <img src="https://latex.codecogs.com/png.latex?%5Cmathsf%7BSet%7D">-indexed disjunctions.<sup>18</sup></p>
<p>Blechschmidt’s updated axiom scheme (see Theorem 5.2 of <a href="https://github.com/iblech/internal-methods/blob/master/paper-qcoh.pdf"><em>qcoh</em></a>) is then that (in the internal logic of <img src="https://latex.codecogs.com/png.latex?%5Cmathsf%7BSet%7D%5B%5Cmathbb%7BT%7D%5D">):</p>
<ol type="1">
<li><p>For every context <img src="https://latex.codecogs.com/png.latex?%5CGamma"> of <img src="https://latex.codecogs.com/png.latex?U_%7B%5Cmathbb%7BT%7D%7D%20%5Cdownarrow%20%5Cmathbb%7BT%7D">, and any suboject <img src="https://latex.codecogs.com/png.latex?P%20%5Csubseteq%20%5Cmathsf%7Bid%7D_%7BU_%7B%5Cmathbb%7BT%7D%7D%7D(%5CGamma)"> of the interpretation of that context at the identity morphism <img src="https://latex.codecogs.com/png.latex?%5Cmathsf%7Bid%7D%20:%20U_%7B%5Cmathbb%7BT%7D%7D%20%5Cto%20U_%7B%5Cmathbb%7BT%7D%7D"> (which is a model of the slice theory <img src="https://latex.codecogs.com/png.latex?U_%7B%5Cmathbb%7BT%7D%7D%20%5Cdownarrow%20%5Cgamma%5E%7B%5Cast%7D%5Cmathbb%7BT%7D">), there is a <em>quasi-coherent</em> formula <img src="https://latex.codecogs.com/png.latex?%5CGamma%20%5Cvdash%20%5Cvarphi"> in the slice theory whose interpretation at the identity is <img src="https://latex.codecogs.com/png.latex?P">: every subset of the universal model is quasi-coherently definable in the slice theory.</p></li>
<li><p>Let <img src="https://latex.codecogs.com/png.latex?%5CGamma%20%5Cvdash%20%5Cvarphi"> be a quasi-coherent formula in the slice theory. Then its interpretation <img src="https://latex.codecogs.com/png.latex?%5Cmathsf%7Bid%7D_%7BU_%7B%5Cmathbb%7BT%7D%7D%7D(%5Cvarphi)%20%5Csubseteq%20%5Cmathsf%7Bid%7D_%7BU_%7B%5Cmathbb%7BT%7D%7D%7D(%5CGamma)"> at the identity of <img src="https://latex.codecogs.com/png.latex?U_%7B%5Cmathbb%7BT%7D%7D"> holds (that is, <img src="https://latex.codecogs.com/png.latex?%5Cmathsf%7Bid%7D_%7BU_%7B%5Cmathbb%7BT%7D%7D%7D(%5Cvarphi)%20=%20%5Cmathsf%7Bid%7D_%7BU_%7B%5Cmathbb%7BT%7D%7D%7D(%5CGamma)">) if and only if <img src="https://latex.codecogs.com/png.latex?%5Cvarphi"> is provable in the slice theory.</p></li>
</ol>
<p>These two axioms suffice to show that the sheaf of quasi-coherent formulas in context <img src="https://latex.codecogs.com/png.latex?%5CGamma"> in the slice theory, modulo provable equivalence, is isomorphic to the sheaf of subsheaves of the interpretation of <img src="https://latex.codecogs.com/png.latex?%5CGamma"> at the identity of <img src="https://latex.codecogs.com/png.latex?U_%7B%5Cmathbb%7BT%7D%7D">. This really is a universal axiom scheme (Theorem 1.2 of <em>ibid.</em>) for first-order statements about the universal model: if <img src="https://latex.codecogs.com/png.latex?%5Cvarphi"> is a first-order formula, then we can interpret it as a subobject of the universal model; it is therefore quasi-coherently definable by the axiom scheme, and is true if and only if it is provable.</p>
<p>Blechschmidt uses a delicate forcing argument to prove that this axiom scheme holds for any theory <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BT%7D">. The aim of this blog post is to liberate <em>quasi-coherent definability</em> from these sorts of forcing arguments.</p>
</section>
<section id="dreaming-of-homotopy-types" class="level1" data-number="4">
<h1 data-number="4"><span class="header-section-number">4</span> Dreaming of homotopy types</h1>
<p>The difficulty with forcing argument is that they are highly reliant on syntax. This is not so awful when we’re trying to prove theorems about 1-toposes where syntax means first order logic (though, it’s <em>a little</em> awful). But it becomes haltingly difficult when we want to reason about higher toposes, where syntax means “homotopy type theory” and general coherence issues must be taken into account.</p>
<p>Let’s start by sketching a generalization of Blechschmidt’s scheme from logic to types. The main idea of <a href="https://ncatlab.org/nlab/show/propositions+as+types">propositions as types</a> is that propositions are the <img src="https://latex.codecogs.com/png.latex?(-1)">-truncated types of mathematical objects. Accordingly, we have the following analogy:</p>
<table class="caption-top table">
<thead>
<tr class="header">
<th>Level</th>
<th>Syntax</th>
<th>Semantics</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td><img src="https://latex.codecogs.com/png.latex?-1"></td>
<td>Formula</td>
<td>Proposition</td>
</tr>
<tr class="even">
<td><img src="https://latex.codecogs.com/png.latex?-1"></td>
<td>Proof</td>
<td>Truth</td>
</tr>
<tr class="odd">
<td><img src="https://latex.codecogs.com/png.latex?%5Cinfty"></td>
<td>Definition</td>
<td>Type</td>
</tr>
<tr class="even">
<td><img src="https://latex.codecogs.com/png.latex?%5Cinfty"></td>
<td>Term</td>
<td>Element</td>
</tr>
</tbody>
</table>
<p>I am using “definition” and “term”<sup>19</sup> here for the syntactic analogue of “type” and “element”, taking the role of “formula” and “proof” in relation to “proposition” and “truth”. We might say then that the <em>quasi-coherent definability</em> axiom scheme, in a highly conjectural setting, is that for any positive homotopy type theory <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BT%7D"> internal to the <img src="https://latex.codecogs.com/png.latex?%5Cinfty">-topos of homotopy types <img src="https://latex.codecogs.com/png.latex?%5Cmathsf%7BHo%7D"> (“positive” in the sense of involving only <img src="https://latex.codecogs.com/png.latex?%5Cmathsf%7BHo%7D">-indexed higher inductive types (which include the unit, <img src="https://latex.codecogs.com/png.latex?%5CSigma">, <img src="https://latex.codecogs.com/png.latex?=">, and all <img src="https://latex.codecogs.com/png.latex?%5Cmathsf%7BHo%7D">-indexed colimits), and no negative types like functions or universes),</p>
<ol type="1">
<li><p>For any context <img src="https://latex.codecogs.com/png.latex?%5CGamma"> of <img src="https://latex.codecogs.com/png.latex?U_%7B%5Cmathbb%7BT%7D%7D%20%5Cdownarrow%20%5Cgamma%5E%7B%5Cast%7D%5Cmathbb%7BT%7D"> and any type family <img src="https://latex.codecogs.com/png.latex?X%20:%20%5Cmathsf%7Bid%7D_%7BU_%7B%5Cmathbb%7BT%7D%7D%7D(%5CGamma)%20%5Cto%20%5Cmathsf%7BType%7D">, there is a quasi-coherent definition <img src="https://latex.codecogs.com/png.latex?%5CGamma%20%5Cvdash%20C"> in the slice theory which interprets to <img src="https://latex.codecogs.com/png.latex?X">.</p></li>
<li><p>For any element <img src="https://latex.codecogs.com/png.latex?x%20:%20%5Cmathsf%7Bid%7D_%7BU_%7B%5Cmathbb%7BT%7D%7D%7D(%5CGamma)%20%5Cvdash%20f(x)%20:%20%5Cmathsf%7Bid%7D_%7BU_%7B%5Cmathbb%7BT%7D%7D%7D(C)">, there is a quasi-coherent term <img src="https://latex.codecogs.com/png.latex?%5CGamma%20%5Cvdash%20t%20:%20C"> which interprets to <img src="https://latex.codecogs.com/png.latex?f">.</p></li>
</ol>
<p>Now, a definition should be quasi-coherent if it only uses <img src="https://latex.codecogs.com/png.latex?%5Cmathsf%7BHo%7D">-indexed higher inductive types, and not <img src="https://latex.codecogs.com/png.latex?%5Cmathsf%7BHo%7D%5B%5Cmathbb%7BT%7D%5D">-indexed higher inductive types.</p>
<p>Mitchell Riley and I have been chatting for years about <em>quasi-coherent definability</em>. Mitchell observed that it really looks like some sort of path induction principle (itself a form of the Yoneda lemma): To do something for a general map (model of the slice theory), it suffices to do it at the identity. Mitchell and I call this conjectural induction principle <em>quasi-coherent induction</em>, and we’ve been dreaming about a type theory which would interpret into <em>all</em> toposes and for which the axiom scheme would become a <em>rule</em>. More about this later in the blog post.</p>
<p>For now, the scaffolding to work syntactically with internal homotopy type theories doesn’t quite exist (though <a href="https://arxiv.org/abs/2205.00798">Uemura-Nguyen <img src="https://latex.codecogs.com/png.latex?%5Cinfty">-type theories might help</a>). For that reason, let me turn to semantics.</p>
</section>
<section id="liberating-synthetic-quasi-coherence-from-syntax" class="level1" data-number="5">
<h1 data-number="5"><span class="header-section-number">5</span> Liberating <em>synthetic quasi-coherence</em> from syntax</h1>
<p>In this section, I want to liberate quasi-coherent definability from syntax. In fact, I will show that it follows from a delightfully simple lifting property first observed by Ivan Di Liberti in his <a href="https://arxiv.org/abs/2211.03104">enlightening exegesis of coherent toposes and ultrastructures</a>. This lifting property will also make it clear that we really are dealing with a form of <em>directed path induction for toposes</em>.</p>
<p>The lifting property we will need appears as Theorem 1.3.1 of Di Liberti’s <a href="https://arxiv.org/abs/2211.03104">paper on coherent toposes</a>. It is so clean that I will prove it here in its entirety; this will also make it clear that it should hold just as well for <img src="https://latex.codecogs.com/png.latex?%5Cinfty">-toposes.<sup>20</sup></p>
<p>We work over an arbitary base topos <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BB%7D">, which I will just call the topos of “base types”. In the world of higher toposes, <a href="https://arxiv.org/abs/2303.06437">Martini and Wolf have been working out a theory of internal higher toposes</a>. I do not want to fuss with any details (including <em>actually subtle</em> size issues, and careful internalization) in this blog post, so please regard all the rest as conjectural.</p>
<p>Let <img src="https://latex.codecogs.com/png.latex?%5Ckappa"> be a <img src="https://latex.codecogs.com/png.latex?%5CSigma">-closed sub-universe of a <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BB%7D"> — a “regular cardinal”.</p>
<div id="def-kappa-presentable" class="theorem definition">
<p><span class="theorem-title"><strong>Definition 1</strong></span> A <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BB%7D">-topos <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BX%7D"> is <img src="https://latex.codecogs.com/png.latex?%5Ckappa">-presentable if it admits a free, <img src="https://latex.codecogs.com/png.latex?%5Ckappa">-ary presentation: a geometric embedding <img src="https://latex.codecogs.com/png.latex?j%20:%20%5Cmathcal%7BX%7D%20%5Chookrightarrow%20%5Cmathcal%7BB%7D%5BC%5D"> into a topos of presheaves on a(<img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BB%7D">-)category <img src="https://latex.codecogs.com/png.latex?C"> with finite limits with <img src="https://latex.codecogs.com/png.latex?j_%7B%5Cast%7D"> <img src="https://latex.codecogs.com/png.latex?%5Ckappa">-accessible: <img src="https://latex.codecogs.com/png.latex?j_%7B%5Cast%7D"> preserves <img src="https://latex.codecogs.com/png.latex?%5Ckappa">-filtered colimits. That is, <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BX%7D"> is <img src="https://latex.codecogs.com/png.latex?%5Ckappa">-presentable if it admits a presentation as sheaves on a category with finite limits, and <img src="https://latex.codecogs.com/png.latex?%5Ckappa">-filtered colimits of sheaves, computed in presheaves, are still sheaves.</p>
</div>
<div id="def-flat" class="theorem definition">
<p><span class="theorem-title"><strong>Definition 2</strong></span> A map <img src="https://latex.codecogs.com/png.latex?i%20:%20%5Cmathcal%7BE%7D%20%5Cto%20%5Cmathcal%7BF%7D"> of <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BB%7D">-toposes is <em><img src="https://latex.codecogs.com/png.latex?%5Ckappa">-flat</em> when <img src="https://latex.codecogs.com/png.latex?i_%7B%5Cast%7D"> preserves <img src="https://latex.codecogs.com/png.latex?%5Ckappa">-indexed colimits.</p>
</div>
<p>We now prove Di Liberti’s theorem:</p>
<div id="thm-di-liberti" class="theorem">
<p><span class="theorem-title"><strong>Theorem 1</strong></span> <em>(Di Liberti).</em> Let <img src="https://latex.codecogs.com/png.latex?i%20:%20%5Cmathcal%7BE%7D%20%5Cto%20%5Cmathcal%7BF%7D"> be <img src="https://latex.codecogs.com/png.latex?%5Ckappa">-flat. Then every <img src="https://latex.codecogs.com/png.latex?%5Ckappa">-presentable topos <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BX%7D"> is <em>weakly right Kan injective</em> against <img src="https://latex.codecogs.com/png.latex?i">; if <img src="https://latex.codecogs.com/png.latex?i"> is an embedding, then <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BX%7D"> is <em>right Kan injective</em> against <img src="https://latex.codecogs.com/png.latex?i">:</p>
<ul>
<li><p>For any <img src="https://latex.codecogs.com/png.latex?x%20:%20%5Cmathcal%7BE%7D%20%5Cto%20%5Cmathcal%7BX%7D">, there exists a geometric morphism <img src="https://latex.codecogs.com/png.latex?r_x%20:%20%5Cmathcal%7BF%7D%20%5Cto%20%5Cmathcal%7BX%7D"> and an 2-cell <img src="https://latex.codecogs.com/png.latex?%5Cvarphi%20:%20r_x%20i%0A%5CRightarrow%20x"> exhibiting <img src="https://latex.codecogs.com/png.latex?r_x"> as the right Kan extension of <img src="https://latex.codecogs.com/png.latex?x"> along <img src="https://latex.codecogs.com/png.latex?i">.</p></li>
<li><p>If <img src="https://latex.codecogs.com/png.latex?i"> is an embedding, then <img src="https://latex.codecogs.com/png.latex?%5Cvarphi"> is an isomorphism.</p></li>
</ul>
</div>
<div class="proof">
<p><span class="proof-title"><em>Proof</em>. </span>Consider a <img src="https://latex.codecogs.com/png.latex?%5Ckappa">-ary presentation <img src="https://latex.codecogs.com/png.latex?j%20:%20%5Cmathcal%7BX%7D%20%5Chookrightarrow%20%5Cmathcal%7BB%7D%5BC%5D">. Consider <img src="https://latex.codecogs.com/png.latex?%5Chat%7Bx%7D%20:%20%5Cmathcal%7BF%7D%20%5Cto%20%5Cmathcal%7BB%7D%5BC%5D"> determined by the lex functor <img src="https://latex.codecogs.com/png.latex?C%20%5Cxrightarrow%7By%7D%20%5Cmathcal%7BB%7D%5BC%5D%20%5Cxrightarrow%7Bj%5E%7B%5Cast%7D%7D%20%5Cmathcal%7BX%7D%20%5Cxrightarrow%7Bx%5E%7B%5Cast%7D%7D%20%5Cmathcal%7BE%7D%20%5Cxrightarrow%7Bi_%7B%5Cast%7D%7D%20%5Cmathcal%7BF%7D">. That is, <img src="https://latex.codecogs.com/png.latex?%5Chat%7Bx%7D%5E%7B%5Cast%7D%20=%20%5Cmathsf%7Blan%7D_%7By%7D(i_%7B%5Cast%7Dx%5E%7B%5Cast%7Dj%5E%7B%5Cast%7Dy)">, and <img src="https://latex.codecogs.com/png.latex?%5Chat%7Bx%7D_%7B%5Cast%7D%20=%20%5Cmathsf%7Blan%7D_%7B%5Chat%7Bx%7D%5E%7B%5Cast%7D%7D(1)"> is its right adjoint. It remains to show that <img src="https://latex.codecogs.com/png.latex?%5Chat%7Bx%7D"> descends to sheaves, or that <img src="https://latex.codecogs.com/png.latex?%5Chat%7Bx%7D_%7B%5Cast%7D%20=%20j_%7B%5Cast%7Dj%5E%7B%5Cast%7D%5Chat%7Bx%7D_%7B%5Cast%7D">. For this, we need to compute <img src="https://latex.codecogs.com/png.latex?%5Chat%7Bx%7D_%7B%5Cast%7D"> with some Kan-fu:</p>
<p><img src="https://latex.codecogs.com/png.latex?%0A%5Cbegin%7Baligned%7D%0A%5Chat%7Bx%7D_%7B%5Cast%7D%20&amp;=%20%5Cmathsf%7Blan%7D_%7B%5Chat%7Bx%7D%5E%7B%5Cast%7D%7D(1)%20%5C%5C%0A&amp;=%20%5Cmathsf%7Blan%7D_%7B%5Chat%7Bx%7D%5E%7B%5Cast%7D%7D(%5Cmathsf%7Blan%7D_y%20y)%20%5C%5C%0A&amp;=%20%5Cmathsf%7Blan%7D_%7B%5Chat%7Bx%7D%5E%7B%5Cast%7Dy%7D(y)%20%5C%5C%0A&amp;=%20%5Cmathsf%7Blan%7D_%7B%5Cmathsf%7Blan%7D_%7By%7D(i_%7B%5Cast%7Dx%5E%7B%5Cast%7Dj%5E%7B%5Cast%7Dy)y%7D(y)%20%5C%5C%0A&amp;=%20%5Cmathsf%7Blan%7D_%7Bi_%7B%5Cast%7Dx%5E%7B%5Cast%7Dj%5E%7B%5Cast%7Dy%7D(y)%5C%5C%0A&amp;=%20%5Cmathsf%7Blan%7D_%7Bi_%7B%5Cast%7Dx%5E%7B%5Cast%7Dj%5E%7B%5Cast%7D%7D(%5Cmathsf%7Blan%7D_y%20y)%20%5C%5C%0A&amp;=%20%5Cmathsf%7Blan%7D_%7Bi_%7B%5Cast%7D%7D(j_%7B%5Cast%7Dx_%7B%5Cast%7D)%0A%5Cend%7Baligned%7D%0A"></p>
<p>Therefore, <img src="https://latex.codecogs.com/png.latex?%0A%5Cbegin%7Baligned%7D%0Aj_%7B%5Cast%7Dj%5E%7B%5Cast%7D%5Chat%7Bx%7D_%7B%5Cast%7D%20&amp;=%20j_%7B%5Cast%7Dj%5E%7B%5Cast%7D%20%5Cmathsf%7Blan%7D_%7Bi_%7B%5Cast%7D%7D(j_%7B%5Cast%7Dx_%7B%5Cast%7D)%20%5C%5C%0A&amp;=%20j_%7B%5Cast%7D%5Cmathsf%7Blan%7D_%7Bi_%7B%5Cast%7D%7D(j%5E%7B%5Cast%7D%20j_%7B%5Cast%7Dx_%7B%5Cast%7D)%20%5C%5C%0A&amp;=%20j_%7B%5Cast%7D%5Cmathsf%7Blan%7D_%7Bi_%7B%5Cast%7D%7D(x_%7B%5Cast%7D)%20%5C%5C%0A(!)%20&amp;=%20%5Cmathsf%7Blan%7D_%7Bi_%7B%5Cast%7D%7D(j_%7B%5Cast%7Dx_%7B%5Cast%7D)%20%5C%5C%0A&amp;=%20%5Chat%7Bx%7D_%7B%5Cast%7D%0A%5Cend%7Baligned%7D%0A"> This only one of these steps which isn’t abstract nonsense is the one marked by (!). This follows because <img src="https://latex.codecogs.com/png.latex?j_%7B%5Cast%7D"> preserves <img src="https://latex.codecogs.com/png.latex?%5Ckappa">-filtered colimits, and the Kan extension on the right can be expressed as the colimit <img src="https://latex.codecogs.com/png.latex?%0A%5Cmathsf%7Blan%7D_%7Bi_%7B%5Cast%7D%7D(x_%7B%5Cast%7D)%20=%20%5Cmathsf%7Bcolim%7D(i_%7B%5Cast%7D%20%5Cdownarrow%20%5Cmathcal%7BF%7D%20%5Cto%20%5Cmathcal%7BE%7D%20%5Cxrightarrow%7Bj_%7B%5Cast%7Dx_%7B%5Cast%7D%7D%20%5Cmathcal%7BB%7D%5BC%5D)%0A"> Since <img src="https://latex.codecogs.com/png.latex?i_%7B%5Cast%7D"> preserves <img src="https://latex.codecogs.com/png.latex?%5Ckappa">-ary colimits, the slice category <img src="https://latex.codecogs.com/png.latex?i_%7B%5Cast%7D%20%5Cdownarrow%20%5Cmathcal%7BF%7D"> is <img src="https://latex.codecogs.com/png.latex?%5Ckappa">-filtered, and so this colimit is preserved by <img src="https://latex.codecogs.com/png.latex?j_%7B%5Cast%7D">. This shows that <img src="https://latex.codecogs.com/png.latex?%5Chat%7Bx%7D%20:%20%5Cmathcal%7BF%7D%20%5Cto%20%5Cmathcal%7BB%7D%5BC%5D"> actually lands in sheaves, giving us <img src="https://latex.codecogs.com/png.latex?r_x%20:%20%5Cmathcal%7BF%7D%20%5Cto%20%5Cmathcal%7BX%7D">; it is straightforward then to check that this is indeed a right Kan extension of geometric morphisms with comparison 2-cell coming from the computation of the direct image as a left Kan extension. Finally, if <img src="https://latex.codecogs.com/png.latex?i"> is an embedding, then <img src="https://latex.codecogs.com/png.latex?i_%7B%5Cast%7D"> is fully faithful and therefore the comparison 2-cell of <img src="https://latex.codecogs.com/png.latex?(r_x)_%7B%5Cast%7D%20=%20%5Cmathsf%7Blan%7D_%7Bi_%7B%5Cast%7D%7D(j_%7B%5Cast%7Dx_%7B%5Cast%7D)"> is an isomorphism.</p>
</div>
<p>Now, let’s free our minds from various internalization anxieties such as the fact that regular cardinals aren’t stable under inverse image and define a <em>quasi-coherent topos</em>.</p>
<div id="def-quasi-coherent-topos" class="theorem definition">
<p><span class="theorem-title"><strong>Definition 3</strong></span> Let <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BE%7D"> be a <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BB%7D">-topos. An <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BE%7D">-topos <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BX%7D"> is <em>quasi-coherent</em> when it is <img src="https://latex.codecogs.com/png.latex?%5Ckappa">-presentable over <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BE%7D"> for a <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BB%7D">-cardinal <img src="https://latex.codecogs.com/png.latex?%5Ckappa">. For emphasis, this means that <img src="https://latex.codecogs.com/png.latex?j%20:%20%5Cmathcal%7BX%7D%20%5Chookrightarrow%20%5Cmathcal%7BE%7D%5BC%5D"> for <img src="https://latex.codecogs.com/png.latex?C"> an <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BE%7D">-category with finite limits where <img src="https://latex.codecogs.com/png.latex?j_%7B%5Cast%7D"> preserves <img src="https://latex.codecogs.com/png.latex?%5Ckappa">-filtered colimits for some <img src="https://latex.codecogs.com/png.latex?%5Ckappa%20%5Cin%20%5Cmathcal%7BB%7D">.<sup>21</sup></p>
</div>
<div id="def-quasi-coherent-topos-map" class="theorem definition">
<p><span class="theorem-title"><strong>Definition 4</strong></span> A map <img src="https://latex.codecogs.com/png.latex?f%20:%20%5Cmathcal%7BX%7D%20%5Cto%20%5Cmathcal%7BY%7D"> between quasi-coherent <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BE%7D">-toposes is <em>quasi-coherent</em> when <img src="https://latex.codecogs.com/png.latex?f_%7B%5Cast%7D"> is <img src="https://latex.codecogs.com/png.latex?%5Ckappa">-accessible (commutes with <img src="https://latex.codecogs.com/png.latex?%5Ckappa">-filtered colimits) for <img src="https://latex.codecogs.com/png.latex?%5Ckappa"> a <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BB%7D">-cardinal.</p>
</div>
<p>We might say that a quasi-coherent <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BE%7D">-topos is <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BE%7D">-locally of constant presentation. Note that if <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BB%7D%20=%20%5Cmathcal%7BE%7D">, then the definition trivializes: every <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BB%7D">-topos is <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BB%7D">-quasi-coherent, because any <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BB%7D">-filtered <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BB%7D">-category has a terminal object and so <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BB%7D">-filtered colimits are just given by evaluation at that terminal object.</p>
<p>Now for any <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BB%7D">-topos <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BE%7D">, we can form the <em>arrow topos</em> <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BE%7D%5E%7B%5Cpitchfork%7D"> (the arrow object in the 2-category of <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BB%7D">-toposes). When <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BE%7D%20=%20%5Cmathcal%7BB%7D%5B%5Cmathbb%7BT%7D%5D"> classifies models of <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BT%7D">, then <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BE%7D%5E%7B%5Cpitchfork%7D%20=%20%5Cmathcal%7BB%7D%5B%5Cmathsf%7BHom%7D_%7B%5Cmathbb%7BT%7D%7D%5D"> is the classifier for <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BT%7D">-homomorphisms. Over <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BB%7D">, we have an adjoint triple <img src="https://latex.codecogs.com/png.latex?d%20%5Cdashv%20i%20%5Cdashv%20c%20:%20%5Cmathcal%7BE%7D%5E%7B%5Cpitchfork%7D%20%5Cto%20%5Cmathcal%7BE%7D"> where <img src="https://latex.codecogs.com/png.latex?d"> classifies the domain of the universal <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BT%7D">-homomorphism, <img src="https://latex.codecogs.com/png.latex?c"> the codomain, and <img src="https://latex.codecogs.com/png.latex?i%20:%20%5Cmathcal%7BE%7D%20%5Cto%20%5Cmathcal%7BE%7D%5E%7B%5Cpitchfork%7D"> the identity of the universal model of <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BT%7D">. This in particular means that <img src="https://latex.codecogs.com/png.latex?d_%7B%5Cast%7D%20=%20i%5E%7B%5Cast%7D"> and <img src="https://latex.codecogs.com/png.latex?i_%7B%5Cast%7D%20=%20c%5E%7B%5Cast%7D"> over <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BB%7D">.<sup>22</sup></p>
<p>However, we want to conclude a statement in <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BE%7D">’s internal logic, so we will need to consider <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BE%7D%5E%7B%5Cpitchfork%7D"> as a <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BE%7D">-topos. I will always consider <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BE%7D%5E%7B%5Cpitchfork%7D"> as a <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BE%7D">-topos via <img src="https://latex.codecogs.com/png.latex?d">, and <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BE%7D"> as a <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BE%7D%5E%7B%5Cpitchfork%7D">-topos via <img src="https://latex.codecogs.com/png.latex?i">. Note that <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BE%7D"> can view itself as an <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BE%7D%5E%7B%5Cpitchfork%7D"> topos, since <img src="https://latex.codecogs.com/png.latex?di%20=%20%5Cmathsf%7Bid%7D_%7B%5Cmathcal%7BE%7D%7D">: <img src="https://latex.codecogs.com/png.latex?i"> is an <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BE%7D">-point of <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BE%7D%5E%7B%5Cpitchfork%7D">.</p>
<p>On the other hand, <img src="https://latex.codecogs.com/png.latex?c%20:%20%5Cmathcal%7BE%7D%5E%7B%5Cpitchfork%7D%20%5Cto%20%5Cmathcal%7BE%7D"> doesn’t exist over <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BE%7D"> or <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BE%7D%5E%7B%5Cpitchfork%7D">. But it still leaves a trace. All that remains of <img src="https://latex.codecogs.com/png.latex?c">, from <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BE%7D%5E%7B%5Cpitchfork%7D">’s point of view, are the following two facts:</p>
<ol type="1">
<li><p><img src="https://latex.codecogs.com/png.latex?i_%7B%5Cast%7D"> preserves <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BB%7D">-indexed colimits (because it has a right adjoint <img src="https://latex.codecogs.com/png.latex?c_%7B%5Cast%7D"> over <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BB%7D">).</p></li>
<li><p><img src="https://latex.codecogs.com/png.latex?i_%7B%5Cast%7D"> takes values in <img src="https://latex.codecogs.com/png.latex?%5Cbeta">-presentable objects of <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BE%7D%5E%7B%5Cpitchfork%7D"> for some <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BB%7D">-cardinal <img src="https://latex.codecogs.com/png.latex?%5Cbeta"> (because <img src="https://latex.codecogs.com/png.latex?i_%7B%5Cast%7D%20%5Cdashv%20c_%7B%5Cast%7D"> over <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BB%7D">, and <img src="https://latex.codecogs.com/png.latex?c_%7B%5Cast%7D"> is a right adjoint between <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BB%7D">-presentable categories and so is <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BB%7D">-accessible).<sup>23</sup></p></li>
</ol>
<p>We are now ready to prove <em>quasi-coherent induction</em>.</p>
<div id="thm-quasi-coherent-induction" class="theorem">
<p><span class="theorem-title"><strong>Theorem 2</strong></span> <em>(Quasi-coherent induction).</em> Let <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BE%7D"> be any <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BB%7D">-topos. For any quasi-coherent <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BE%7D%5E%7B%5Cpitchfork%7D">-topos <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BX%7D">, there is an <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BE%7D%5E%7B%5Cpitchfork%7D">-equivalence between (the <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BE%7D%5E%7B%5Cpitchfork%7D">-category of) maps <img src="https://latex.codecogs.com/png.latex?x%20:%20%5Cmathcal%7BE%7D%20%5Cto%20%5Cmathcal%7BX%7D"> and quasi-coherent maps <img src="https://latex.codecogs.com/png.latex?r%20:%20%5Cmathcal%7BE%7D%5E%7B%5Cpitchfork%7D%20%5Cto%20%5Cmathcal%7BX%7D"> given by <img src="https://latex.codecogs.com/png.latex?r%20%5Cmapsto%20ri"> and <img src="https://latex.codecogs.com/png.latex?x%20%5Cmapsto%20%5Cmathsf%7Bran%7D_i%20x">.</p>
<!-- https://q.uiver.app/#q=WzAsNCxbMCwwLCJcXG1hdGhjYWx7RX0iXSxbMSwwLCJcXG1hdGhjYWx7WH0iXSxbMCwxLCJcXG1hdGhjYWx7RX1ee1xccGl0Y2hmb3JrfSJdLFsxLDEsIlxcbWF0aGNhbHtFfV57XFxwaXRjaGZvcmt9Il0sWzIsMywiIiwwLHsibGV2ZWwiOjIsInN0eWxlIjp7ImhlYWQiOnsibmFtZSI6Im5vbmUifX19XSxbMSwzXSxbMCwyLCJpIiwyXSxbMCwxLCJ4Il0sWzIsMSwiciIsMix7InN0eWxlIjp7ImJvZHkiOnsibmFtZSI6ImRhc2hlZCJ9fX1dXQ== -->
<iframe class="quiver-embed" src="https://q.uiver.app/#q=WzAsNCxbMCwwLCJcXG1hdGhjYWx7RX0iXSxbMSwwLCJcXG1hdGhjYWx7WH0iXSxbMCwxLCJcXG1hdGhjYWx7RX1ee1xccGl0Y2hmb3JrfSJdLFsxLDEsIlxcbWF0aGNhbHtFfV57XFxwaXRjaGZvcmt9Il0sWzIsMywiIiwwLHsibGV2ZWwiOjIsInN0eWxlIjp7ImhlYWQiOnsibmFtZSI6Im5vbmUifX19XSxbMSwzXSxbMCwyLCJpIiwyXSxbMCwxLCJ4Il0sWzIsMSwiciIsMix7InN0eWxlIjp7ImJvZHkiOnsibmFtZSI6ImRhc2hlZCJ9fX1dXQ==&amp;embed" width="304" height="304" style="border-radius: 8px; border: none;">
</iframe>
</div>
<div class="proof">
<p><span class="proof-title"><em>Proof</em>. </span>Since <img src="https://latex.codecogs.com/png.latex?i_%7B%5Cast%7D"> has a right adjoint <img src="https://latex.codecogs.com/png.latex?c_%7B%5Cast%7D"> over <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BB%7D">, it preserves all <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BB%7D">-colimits, and since <img src="https://latex.codecogs.com/png.latex?di%20=%20%5Cmathsf%7Bid%7D_%7B%5Cmathcal%7BE%7D%7D">, it is an embedding. Therefore, Di Liberti’s theorem (over the base <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BE%7D%5E%7B%5Cpitchfork%7D">) shows that maps <img src="https://latex.codecogs.com/png.latex?x%20:%20%5Cmathcal%7BE%7D%20%5Cto%20%5Cmathcal%7BX%7D"> form a coreflective subcategory of maps <img src="https://latex.codecogs.com/png.latex?r%20:%20%5Cmathcal%7BE%7D%5E%7B%5Cpitchfork%7D%20%5Cto%20%5Cmathcal%7BX%7D"> via right Kan extension.</p>
<p>It therefore suffices to show that <img src="https://latex.codecogs.com/png.latex?%5Cmathsf%7Bran%7D_i%20x"> is quasi-coherent for all <img src="https://latex.codecogs.com/png.latex?x">. We know that <img src="https://latex.codecogs.com/png.latex?(%5Cmathsf%7Bran%7D_i%20x)_%7B%5Cast%7D%20=%20%5Cmathsf%7Blan%7D_%7Bi_%5Cast%7D(j_%7B%5Cast%7Dx_%7B%5Cast%7D)">. Now, <a href="https://mathoverflow.net/a/112206/491543"><img src="https://latex.codecogs.com/png.latex?%5Cmathsf%7Blan%7D_%7Bi_%5Cast%7D(j_%7B%5Cast%7Dx_%7B%5Cast%7D)"> preserves all colimits preserved by <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BE%7D%5E%7B%5Cpitchfork%7D(i_%7B%5Cast%7D%20X,%20-)"> for all <img src="https://latex.codecogs.com/png.latex?X%20%5Cin%20%5Cmathcal%7BE%7D"></a>, and this includes all <img src="https://latex.codecogs.com/png.latex?%5Cbeta">-filtered colimits for some <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BB%7D">-cardinal <img src="https://latex.codecogs.com/png.latex?%5Cbeta"> because <img src="https://latex.codecogs.com/png.latex?i_%7B%5Cast%7D"> takes value in the <img src="https://latex.codecogs.com/png.latex?%5Ckappa">-presentable objects of <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BE%7D%5E%7B%5Cpitchfork%7D">.</p>
</div>
<p>Let’s now deduce <em>quasi-coherent definability</em> from <em>quasi-coherent induction</em>.</p>
<p><strong>Corollary</strong> <em>(Quasi-coherent definability).</em> For any <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BB%7D">-theory <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BT%7D">, let <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BE%7D%20:=%20%5Cmathcal%7BB%7D%5B%5Cmathbb%7BT%7D%5D">. Then it is true internally to <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BE%7D"> that</p>
<ol type="1">
<li><p>Every object of <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BE%7D"> is quasi-coherently presentable (i.e.&nbsp;definable) in the slice theory <img src="https://latex.codecogs.com/png.latex?U_%7B%5Cmathbb%7BT%7D%7D%20%5Cdownarrow%20%5Cgamma%5E%7B%5Cast%7D%5Cmathbb%7BT%7D">.</p></li>
<li><p>Every element of every object is quasi-coherently definable in the slice theory <img src="https://latex.codecogs.com/png.latex?U_%7B%5Cmathbb%7BT%7D%7D%20%5Cdownarrow%20%5Cgamma%5E%7B%5Cast%7D%5Cmathbb%7BT%7D">.</p></li>
</ol>
<div class="proof">
<p><span class="proof-title"><em>Proof</em>. </span><em>(Sketch).</em> We will take for granted that quasi-coherence is stable under base change.<sup>24</sup> Therefore, <img src="https://latex.codecogs.com/png.latex?d%5E%7B%5Cast%7D%20%5Cmathcal%7BE%7D%5B%5Cmathbb%7BO%7D%5D"> is a quasi-coherent <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BE%7D%5E%7B%5Cpitchfork%7D">-topos, and we may take this for <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BX%7D"> in the theorem above. Maps <img src="https://latex.codecogs.com/png.latex?x%20:%20%5Cmathcal%7BE%7D%20%5Cto%20d%5E%7B%5Cast%7D%20%5Cmathcal%7BE%7D%5B%5Cmathbb%7BO%7D%5D"> over <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BE%7D%5E%7B%5Cpitchfork%7D"> are equivalent to maps <img src="https://latex.codecogs.com/png.latex?%5Cpi_%7B%5Cmathcal%7BE%7D%5B%5Cmathbb%7BO%7D%5D%7Dx%20:%20%5Cmathcal%7BE%7D%20%5Cto%20%5Cmathcal%7BE%7D%5B%5Cmathbb%7BO%7D%5D"> over <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BE%7D"> since <img src="https://latex.codecogs.com/png.latex?di%20=%20%5Cmathsf%7Bid%7D_%7B%5Cmathcal%7BE%7D%7D">; these are <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BE%7D">-objects of <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BE%7D">. On the other hand, maps <img src="https://latex.codecogs.com/png.latex?r%20:%20%5Cmathcal%7BE%7D%5E%7B%5Cpitchfork%7D%20%5Cto%20d%5E%7B%5Cast%7D%5Cmathcal%7BE%7D%5B%5Cmathbb%7BO%7D%5D"> correspond to maps <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BE%7D%5E%7B%5Cpitchfork%7D%20%5Cto%20%5Cmathcal%7BE%7D%5B%5Cmathbb%7BO%7D%5D"> over <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BE%7D">; these are <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BE%7D">-objects of <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BE%7D%5E%7B%5Cpitchfork%7D">. Quasi-coherent induction says that <img src="https://latex.codecogs.com/png.latex?%5Cmathsf%7Bran%7D_%7Bi%7D"> gives an equivalence between <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BE%7D">-objects of <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BE%7D"> and quasi-coherent <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BE%7D">-objects of <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BE%7D%5E%7B%5Cpitchfork%7D">.</p>
<p>Let <img src="https://latex.codecogs.com/png.latex?%5Cbeta%20%5Cin%20%5Cmathcal%7BB%7D"> be such that <img src="https://latex.codecogs.com/png.latex?%5Cmathsf%7Bran%7D_i%20x"> is <img src="https://latex.codecogs.com/png.latex?%5Cbeta">-presentable in <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BE%7D%5E%7B%5Cpitchfork%7D"> for any <img src="https://latex.codecogs.com/png.latex?x%20%5Cin%20%5Cmathcal%7BE%7D">. By an analogue of the results in D.3.3 of <em>the Elephant</em>, such an object <img src="https://latex.codecogs.com/png.latex?%5Cmathsf%7Bran%7D_i%20x"> is representable in the <img src="https://latex.codecogs.com/png.latex?%5Cbeta">-coherent site of presentation of <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BE%7D%5E%7B%5Cpitchfork%7D"> over <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BE%7D">; this is the <img src="https://latex.codecogs.com/png.latex?%5Cbeta">-coherent syntactic category of the slice theory <img src="https://latex.codecogs.com/png.latex?U_%7B%5Cmathbb%7BT%7D%7D%20%5Cdownarrow%20%5Cgamma%5E%7B%5Cast%7D%5Cmathbb%7BT%7D">, showing that <img src="https://latex.codecogs.com/png.latex?%5Cmathsf%7Bran%7D_i%20x"> is <img src="https://latex.codecogs.com/png.latex?%5Cbeta">-coherently definable.</p>
<p>To deduce the second claim, run the argument again but taking <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BX%7D%20=%20d%5E%7B%5Cast%7D%5Cmathcal%7BE%7D%5B%5Cmathbb%7BO%7D_%7B%5Cbullet%7D%5D"> to be the classifier for pointed objects.</p>
</div>
</section>
<section id="the-internal-logic-of-all-toposes" class="level1" data-number="6">
<h1 data-number="6"><span class="header-section-number">6</span> The internal logic of all toposes</h1>
<p>Quasi-coherent induction resembles path induction in that both <a href="https://home.sandiego.edu/~shulman/hottminicourse2012/03models-handout2up.pdf">express a lifting property of some class of display maps against the inclusion of constants into a sort of path object</a>:</p>
<!-- https://q.uiver.app/#q=WzAsOCxbMCwwLCJcXG1hdGhjYWx7RX0iXSxbMSwwLCJcXG1hdGhjYWx7WH0iXSxbMCwxLCJcXG1hdGhjYWx7RX1ee1xccGl0Y2hmb3JrfSJdLFsxLDEsIlxcbWF0aGNhbHtFfV57XFxwaXRjaGZvcmt9Il0sWzMsMCwiQSJdLFszLDEsIkFeSSJdLFs0LDAsIlgiXSxbNCwxLCJBXkkiXSxbMiwzLCIiLDAseyJsZXZlbCI6Miwic3R5bGUiOnsiaGVhZCI6eyJuYW1lIjoibm9uZSJ9fX1dLFsxLDMsIlxcbWF0aHNme3Fjb2h9Il0sWzAsMiwiaSIsMl0sWzAsMSwieCJdLFsyLDEsIiIsMix7InN0eWxlIjp7ImJvZHkiOnsibmFtZSI6ImRhc2hlZCJ9fX1dLFs1LDcsIiIsMix7ImxldmVsIjoyLCJzdHlsZSI6eyJoZWFkIjp7Im5hbWUiOiJub25lIn19fV0sWzQsNSwiXFxtYXRoc2Z7cmVmbH0iLDJdLFs0LDYsIngiXSxbNiw3XSxbNSw2LCJcXG1hdGhzZntKfSIsMSx7InN0eWxlIjp7ImJvZHkiOnsibmFtZSI6ImRhc2hlZCJ9fX1dXQ== -->
<iframe class="quiver-embed" src="https://q.uiver.app/#q=WzAsOCxbMCwwLCJcXG1hdGhjYWx7RX0iXSxbMSwwLCJcXG1hdGhjYWx7WH0iXSxbMCwxLCJcXG1hdGhjYWx7RX1ee1xccGl0Y2hmb3JrfSJdLFsxLDEsIlxcbWF0aGNhbHtFfV57XFxwaXRjaGZvcmt9Il0sWzMsMCwiQSJdLFszLDEsIkFeSSJdLFs0LDAsIlgiXSxbNCwxLCJBXkkiXSxbMiwzLCIiLDAseyJsZXZlbCI6Miwic3R5bGUiOnsiaGVhZCI6eyJuYW1lIjoibm9uZSJ9fX1dLFsxLDMsIlxcbWF0aHNme3Fjb2h9Il0sWzAsMiwiaSIsMl0sWzAsMSwieCJdLFsyLDEsIiIsMix7InN0eWxlIjp7ImJvZHkiOnsibmFtZSI6ImRhc2hlZCJ9fX1dLFs1LDcsIiIsMix7ImxldmVsIjoyLCJzdHlsZSI6eyJoZWFkIjp7Im5hbWUiOiJub25lIn19fV0sWzQsNSwiXFxtYXRoc2Z7cmVmbH0iLDJdLFs0LDYsIngiXSxbNiw3XSxbNSw2LCJcXG1hdGhzZntKfSIsMSx7InN0eWxlIjp7ImJvZHkiOnsibmFtZSI6ImRhc2hlZCJ9fX1dXQ==&amp;embed" width="688" height="304" style="border-radius: 8px; border: none;">
</iframe>
<p>As in cubical approaches to homotopy type theory, <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BE%7D%5E%7B%5Cpitchfork%7D"> is a space of functions from an interval object: specfically, the <a href="https://ncatlab.org/nlab/show/Sierpinski+topos"><em>Sierpinski topos</em></a> which classifies <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BB%7D">-propositions.</p>
<p>If we had a type theory where contexts were interepreted as <em>toposes</em> (and not just objects of a fixed topos), then we could potentially express <em>quasi-coherent induction</em> as an induction principle. If we could also express all the ordinary type theory constructions <em>in</em> a particular topos (considered as the toposes etale over that particular one), then we could have a type theory where <em>synthetic quasi-coherence</em> was provable and not an axiom, for any sort of synthetic mathematics what-so-ever. Mitchell and I have been calling such a potential type theory “theory type theory” or “<img src="https://latex.codecogs.com/png.latex?%5B%5Cmathbb%7BT%7D%5D%5Cmathsf%7BTT%7D">”.</p>
<p>Such a type theory would have a number of benefits for synthetic mathematics. First, of course, is that <em>synthetic quasi-coherence</em> should become provable, rather than an axiom. But also, the ability to jump between toposes in the middle of an argument promises a resolution to one of the curious problems of homotopy type theory: despite the fact that all types are now implicitly homotopy types, much of <em>homotopical mathematics</em> (“<a href="https://ncatlab.org/nlab/show/brave+new+algebra">brave new algebra</a>”) becomes impossibly difficult because combinatorial methods become infeasibly littered with coherence conditions. With a type theory that interprets into all toposes, we could just jump into the topos of simplicial objects of our current topos whenever we wanted to make a simplicial (or categorical) argument.<sup>25</sup> I want to give a very rough sketch of what such a type theory could look like.</p>
<p>Here at the Topos Institute, we are interested in <a href="https://topos.institute/blog/2024-10-31-declarative-models-and-collaborative-modeling/">declarative modelling</a>: first, the modeller <em>schematizes</em> their models, defining the <em>theory</em> what it means to be a model (this is also known as <a href="https://en.wikipedia.org/wiki/Metamodeling"><em>metamodelling</em></a>). Then they develop models within that schema. And then they analyze those models computationally. By making the model description explicit, it becomes clear how we could change the model when analysis conflicts with our data or intentions; by making the theory explicit, we extend this fleetness of thought to a change in modelling paradigms.</p>
<p>Declarative modelling underlies the <a href="https://arxiv.org/abs/2005.04831">modelling approach</a> of the <a href="https://www.algebraicjulia.org">Algebraic Julia project</a>, where one first schematizes using a <a href="https://arxiv.org/abs/2404.04837"><em>generalized algebraic theory</em> (GAT)</a>, potentially including base-type valued <a href="https://blog.algebraicjulia.org/post/2020/10/acset-theory/"><em>attributes</em></a>. Generalized algebraic theories correspond to the lex fragment of positive logic whose classifying toposes are the cofree toposes <img src="https://latex.codecogs.com/png.latex?%5Cmathsf%7BSet%7D%5BC%5D"> of presheaves on a finitely complete category <img src="https://latex.codecogs.com/png.latex?C">.<sup>26</sup></p>
<p>This approach to declarative modelling also underlies the design of <a href="https://topos.institute/blog/2024-10-02-introducing-catcolab/">CatColab</a>, where a theory is a <a href="https://arxiv.org/abs/2310.05384">cartesian double theory</a> and a model within that theory is expressed as a notebook in a structure editor (left below) and analyzed using general computations (right below):</p>
<div class="quarto-video"><video id="video_shortcode_videojs_video1" class="video-js vjs-default-skin vjs-fluid" controls="" preload="auto" data-setup="{}" title="Analyzing dynamics of a Lotka-Volterra model"><source src="small_lotka.mov"></video></div>
<p>At a very high level, then, the modelling task consists of defining a (positive) theory for models, presenting a model within that theory (via positive definitions), and then analyzing that model using general computation (using the <em>negative</em> notions of streams and functions). I have a lot more to say about this point of view, especially concerning the <em>development</em> of models and the <em>ecology of models</em> (to take a term from <a href="https://www.cs.usask.ca/people/faculty%20profiles/nathaniel-osgood.php">Nate Osgood</a>), but I think I’ll save this for another blog post.</p>
<p>Our own <a href="https://owenlynch.org">Owen Lynch</a> has come up with a 2-level type theory, <a href="https://www.youtube.com/watch?list=PLhgq-BqyZ7i4zZ9nAIcTQ3w6H0YBo8DR0&amp;v=Id-9XE5TsA8&amp;feature=youtu.be&amp;themeRefresh=1">“<em>Element Model Type Theory</em> (EMTT)”</a> for defining lex theories and their models, named after its four basic judgements. The theory has a simple presentation in the <a href="https://arxiv.org/abs/1406.3219">natural model style</a> which I will now include:</p>
<div id="def-emtt" class="theorem definition">
<p><span class="theorem-title"><strong>Definition 5</strong></span> A natural model presentation <em>element model type theory</em> consists of:</p>
<ol type="1">
<li><p>A representable transformation <img src="https://latex.codecogs.com/png.latex?u_%7B%5Cbullet%7D%20:%20%5Cmathsf%7BEm%7D%20%5Cto%20%5Cmathsf%7BTy%7D"> expressing the judgement <img src="https://latex.codecogs.com/png.latex?%5CGamma%20%5Cvdash%20a%20:%20A"> that <img src="https://latex.codecogs.com/png.latex?a"> is an element of the type <img src="https://latex.codecogs.com/png.latex?A">. We suppose that this type theory supports a unit type, record (<img src="https://latex.codecogs.com/png.latex?%5CSigma">-)types, and identity types.</p></li>
<li><p>A representable transformation <img src="https://latex.codecogs.com/png.latex?u_%7B%5Ccirc%7D%20:%20%5Cmathsf%7BMod%7D%20%5Cto%20%5Cmathsf%7BThy%7D"> expressing the judgement <img src="https://latex.codecogs.com/png.latex?%5CGamma%20%5Cvdash%20M%20%5CvDash%20%5Cmathbb%7BT%7D"> that <img src="https://latex.codecogs.com/png.latex?M"> is a model of a theory <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BT%7D">. We suppose this type theory supports a unit type and record types.</p></li>
<li><p>For any type <img src="https://latex.codecogs.com/png.latex?A">, we have a theory <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BE%7D%5Cmathsf%7Bl%7D(A)"> of elements of <img src="https://latex.codecogs.com/png.latex?A">, expressed as a pullback square:</p></li>
</ol>
<!-- https://q.uiver.app/#q=WzAsNCxbMCwwLCJcXG1hdGhzZntFbH0iXSxbMCwxLCJcXG1hdGhzZntUeX0iXSxbMSwwLCJcXG1hdGhzZntNb2R9Il0sWzEsMSwiXFxtYXRoc2Z7VGh5fSJdLFsxLDMsIlxcbWF0aGJie0V9XFxtYXRoc2Z7bH0iLDJdLFswLDEsInVfe1xcYnVsbGV0fSIsMl0sWzAsMiwiXFx1bGNvcm5lciAtIFxcdXJjb3JuZXIiXSxbMiwzLCJ1X3tcXGNpcmN9Il0sWzAsMywiIiwxLHsic3R5bGUiOnsibmFtZSI6ImNvcm5lciJ9fV1d -->
<iframe class="quiver-embed" src="https://q.uiver.app/#q=WzAsNCxbMCwwLCJcXG1hdGhzZntFbH0iXSxbMCwxLCJcXG1hdGhzZntUeX0iXSxbMSwwLCJcXG1hdGhzZntNb2R9Il0sWzEsMSwiXFxtYXRoc2Z7VGh5fSJdLFsxLDMsIlxcbWF0aGJie0V9XFxtYXRoc2Z7bH0iLDJdLFswLDEsInVfe1xcYnVsbGV0fSIsMl0sWzAsMiwiXFx1bGNvcm5lciAtIFxcdXJjb3JuZXIiXSxbMiwzLCJ1X3tcXGNpcmN9Il0sWzAsMywiIiwxLHsic3R5bGUiOnsibmFtZSI6ImNvcm5lciJ9fV1d&amp;embed" width="304" height="304" style="border-radius: 8px; border: none;">
</iframe>
<ol start="4" type="1">
<li>We have <img src="https://latex.codecogs.com/png.latex?%5CPi">-types for theories indexed by types: that is, theories <img src="https://latex.codecogs.com/png.latex?%5Cforall%20x%20:%20A.%5C,%20%5Cmathbb%7BT%7D(x)"> whose models are given by <img src="https://latex.codecogs.com/png.latex?A">-indexed families of models of the theories <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BT%7D(x)">.</li>
</ol>
<!-- https://q.uiver.app/#q=WzAsNCxbMCwwLCIoQSA6IFxcbWF0aHNme1R5fSkgXFx0aW1lcyBcXG1hdGhzZntNb2R9XntBfSJdLFswLDEsIihBIDogXFxtYXRoc2Z7VHl9KSBcXHRpbWVzIFxcbWF0aHNme1RoeX1ee0F9Il0sWzEsMCwiXFxtYXRoc2Z7TW9kfSJdLFsxLDEsIlxcbWF0aHNme1RoeX0iXSxbMSwzLCJcXGZvcmFsbCIsMl0sWzAsMSwidV97XFxidWxsZXR9IiwyXSxbMCwyLCJcXGZvcmFsbCJdLFsyLDMsInVfe1xcY2lyY30iXSxbMCwzLCIiLDEseyJzdHlsZSI6eyJuYW1lIjoiY29ybmVyIn19XV0= -->
<iframe class="quiver-embed" src="https://q.uiver.app/#q=WzAsNCxbMCwwLCIoQSA6IFxcbWF0aHNme1R5fSkgXFx0aW1lcyBcXG1hdGhzZntNb2R9XntBfSJdLFswLDEsIihBIDogXFxtYXRoc2Z7VHl9KSBcXHRpbWVzIFxcbWF0aHNme1RoeX1ee0F9Il0sWzEsMCwiXFxtYXRoc2Z7TW9kfSJdLFsxLDEsIlxcbWF0aHNme1RoeX0iXSxbMSwzLCJcXGZvcmFsbCIsMl0sWzAsMSwidV97XFxidWxsZXR9IiwyXSxbMCwyLCJcXGZvcmFsbCJdLFsyLDMsInVfe1xcY2lyY30iXSxbMCwzLCIiLDEseyJzdHlsZSI6eyJuYW1lIjoiY29ybmVyIn19XV0=&amp;embed" width="467" height="304" style="border-radius: 8px; border: none;">
</iframe>
<ol start="5" type="1">
<li>Finally, as Owen likes to say, “the first rule of element model type theory is <img src="https://latex.codecogs.com/png.latex?%5Cmathsf%7Btype%7D%5C,%20%5Cmathsf%7Btheory%7D">”: we have a theory <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BT%7D%5Cmathsf%7Bype%7D"> of types.</li>
</ol>
<!-- https://q.uiver.app/#q=WzAsNCxbMCwwLCJcXG1hdGhzZntUeX0iXSxbMCwxLCJcXGFzdCJdLFsxLDAsIlxcbWF0aHNme01vZH0iXSxbMSwxLCJcXG1hdGhzZntUaHl9Il0sWzEsMywiXFxtYXRoYmJ7VH1cXG1hdGhzZnt5cGV9IiwyXSxbMCwxXSxbMCwyXSxbMiwzLCJ1X3tcXGNpcmN9Il0sWzAsMywiIiwxLHsic3R5bGUiOnsibmFtZSI6ImNvcm5lciJ9fV1d -->
<iframe class="quiver-embed" src="https://q.uiver.app/#q=WzAsNCxbMCwwLCJcXG1hdGhzZntUeX0iXSxbMCwxLCJcXGFzdCJdLFsxLDAsIlxcbWF0aHNme01vZH0iXSxbMSwxLCJcXG1hdGhzZntUaHl9Il0sWzEsMywiXFxtYXRoYmJ7VH1cXG1hdGhzZnt5cGV9IiwyXSxbMCwxXSxbMCwyXSxbMiwzLCJ1X3tcXGNpcmN9Il0sWzAsMywiIiwxLHsic3R5bGUiOnsibmFtZSI6ImNvcm5lciJ9fV1d&amp;embed" width="304" height="304" style="border-radius: 8px; border: none;">
</iframe>
</div>
<p>This type theory is highly reminiscent of the multi-level type theories in <a href="https://andraskovacs.github.io/pdfs/phdthesis_compact.pdf">András Kovács’ extraordinary thesis</a>, which goes much further in the exploration of type theories for theories and their models.</p>
<p>Toposes over <img src="https://latex.codecogs.com/png.latex?%5Cmathsf%7BSet%7D"> are a model of EMTT, as presented above. We take the theories over a topos <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BE%7D"> to be the bounded geometric morphisms <img src="https://latex.codecogs.com/png.latex?%5Cgamma%20:%20%5Cmathcal%7BX%7D%20%5Cto%20%5Cmathcal%7BE%7D"> and we take the types over a topos <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BE%7D"> to be the <em>etale morphisms</em> <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BE%7D%20%5Cdownarrow%20A%20%5Cto%20%5Cmathcal%7BE%7D">. The existence of <img src="https://latex.codecogs.com/png.latex?%5CPi">-theories over types comes from the exponentiability of etale maps, proved in B4.3.1 of <em>the Elephant</em>.</p>
<p>We could then add to the above rules all higher inductive types to <img src="https://latex.codecogs.com/png.latex?u_%7B%5Cbullet%7D">, since these are all stable under inverse image of geometric morphisms (they are <em>positive</em>). Indeed, such higher inductive types eliminate into all toposes, since <a href="https://arxiv.org/abs/2506.10431">colimits of etale maps are etale</a>. To get negative types, and to express <em>quasi-coherence</em>, we need to keep track of the difference between a general extension and an etale extension. Etale maps preserve both positive and negative types; they are <em>logical</em>. Indeed, in higher topos theory, preserving functions and universes characterizes the etale maps (see Proposition 5.10 of <a href="https://arxiv.org/abs/2506.10431"><em>ibid.</em></a>).</p>
<p>Rather than add negative types in one-by-one, we can add in a single negative type former that suffices to construct all of them (I contend): <em>model universes</em> <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BM%7D%5Cmathsf%7Bod%7D(%5Cmathbb%7BT%7D)">. If <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BT%7D"> is a theory, them <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BM%7D%5Cmathsf%7Bod%7D(%5Cmathbb%7BT%7D)"> is the <em>type</em> of models of that theory. Geometrically speaking, this is the (core of the) category of points of the classifying topos of <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BT%7D">. This certainly suffices to give us universes and functions:</p>
<ul>
<li><p>The type <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BM%7D%5Cmathsf%7Bod%7D(%5Cmathbb%7BT%7D%5Cmathsf%7Bype%7D)"> of models of the theory of types is a type universe.</p></li>
<li><p>Given a dependent type <img src="https://latex.codecogs.com/png.latex?x%20:%20A%20%5Cvdash%20B(x)%20%5C,%5Cmathsf%7Btype%7D">, the type <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BM%7D%5Cmathsf%7Bod%7D(%5Cforall%20x%20:%20A.%5C,%20%5Cmathbb%7BE%7D%5Cmathsf%7Bl%7D(B(x)))"> of models of the theory of elements of <img src="https://latex.codecogs.com/png.latex?B(x)"> indexed by <img src="https://latex.codecogs.com/png.latex?x%20:%20A"> is a type of functions <img src="https://latex.codecogs.com/png.latex?(x%20:%20A)%20%5Cto%20B(x)">.</p></li>
</ul>
<p>The difficulty is that <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BM%7D%5Cmathsf%7Bod%7D"> is only stable under etale substitution. It is not clear to me how to handle this syntactically in a 2-level type theory. However, in the natural model style, it should be described by a pullback as follows:</p>
<!-- https://q.uiver.app/#q=WzAsNCxbMCwwLCJcXG1hdGhzZntNb2R9fF97XFwmfSJdLFswLDEsIlxcbWF0aHNme1RoeX18X3tcXCZ9Il0sWzEsMSwiXFxtYXRoc2Z7VHl9fF97XFwmfSJdLFsxLDAsIlxcbWF0aHNme0VsfXxfe1xcJn0iXSxbMCwxLCJ1X3tcXGNpcmN9IiwyXSxbMywyLCJ1X3tcXGJ1bGxldH0iXSxbMSwyLCJcXG1hdGhjYWx7TX1cXG1hdGhzZntvZH0iLDJdLFswLDNdLFswLDIsIiIsMSx7InN0eWxlIjp7Im5hbWUiOiJjb3JuZXIifX1dXQ== -->
<iframe class="quiver-embed" src="https://q.uiver.app/#q=WzAsNCxbMCwwLCJcXG1hdGhzZntNb2R9fF97XFwmfSJdLFswLDEsIlxcbWF0aHNme1RoeX18X3tcXCZ9Il0sWzEsMSwiXFxtYXRoc2Z7VHl9fF97XFwmfSJdLFsxLDAsIlxcbWF0aHNme0VsfXxfe1xcJn0iXSxbMCwxLCJ1X3tcXGNpcmN9IiwyXSxbMywyLCJ1X3tcXGJ1bGxldH0iXSxbMSwyLCJcXG1hdGhjYWx7TX1cXG1hdGhzZntvZH0iLDJdLFswLDNdLFswLDIsIiIsMSx7InN0eWxlIjp7Im5hbWUiOiJjb3JuZXIifX1dXQ==&amp;embed" width="327" height="304" style="border-radius: 8px; border: none;">
</iframe>
<p>where the natural models have been restricted to the category of contexts and etale substitutions.<sup>27</sup></p>
<p>Actually expressing the <em>quasi-coherent induction</em> rule in such a setting is difficult for a number of reasons; not the least of which being that defining <em>quasi-coherent</em> is difficult. The notion of <em>quasi-coherence</em> is a bit like “crispness” in <a href="https://arxiv.org/abs/1509.07584">Shulman’s cohesive type theory</a>; it means that a theory extension doesn’t use types defined from that theory.</p>
<p>For example, the theory <img src="https://latex.codecogs.com/png.latex?(X%20%5CvDash%20%5Cmathbb%7BT%7D%5Cmathsf%7Bype%7D),%20(x%20:%20%5Cmathbb%7BE%7D%5Cmathsf%7Bl%7D(X))"> is quasi-coherent in the empty context, but the theory <img src="https://latex.codecogs.com/png.latex?%5Cmathbb%7BE%7D%5Cmathsf%7Bl%7D(X)"> is not quasi-coherent in the context of <img src="https://latex.codecogs.com/png.latex?X%20%5CvDash%20%5Cmathbb%7BT%7D%5Cmathsf%7Bype%7D">. This examples shows that a naive inductive approach to defining quasi-coherence will have to be modified. For this reason, Mitchell and I have also been playing around with a much more involved type theory that includes judgements for <em>definition</em> and <em>term</em>; but nothing has firmed up yet.</p>
<p>The second difficulty concerns the slice theories (and Hom-theories). In principle, these should be <em>observable</em> from the structure of the theory itself. If this is the case, it may be better to understand <em>quasi-coherent induction</em> not as an induction principle, but rather as a fibrancy condition on quasi-coherent theory extensions which enables certain transports.</p>
<p>I’ll leave the elaboration of these ideas to the future. My goal in this blog post is only really to express the <em>possibility</em> of a type theory for all toposes which is complete for all negative properties of all universal models.</p>


</section>


<script defer="" src="https://comments.topos.institute/comentario.js"></script>

<div id="quarto-appendix" class="default"><section id="footnotes" class="footnotes footnotes-end-of-document"><h2 class="anchored quarto-appendix-heading">Footnotes</h2>

<ol>
<li id="fn1"><p>This introduction is a bit of historical fiction meant to dramatize this blog post and should not be taken too literally. Those interested in the history of categorical logic should check out <a href="https://ncatlab.org/nlab/files/MarquisReyes_CategoricalLogic.pdf">this article</a> for a more sober retelling.↩︎</p></li>
<li id="fn2"><p>Remember that a function <img src="https://latex.codecogs.com/png.latex?f%20:%20A%20%5Cto%20B"> is, in the Bourbakiste style, a subset <img src="https://latex.codecogs.com/png.latex?G_f%20%5Csubseteq%20A%20%5Ctimes%20B"> of the set of pairs satisfying a property.↩︎</p></li>
<li id="fn3"><p>Sure, these other categories have objects which may be described as arrangements of sets themselves, but there’s a big difference between “<img src="https://latex.codecogs.com/png.latex?G"> is a group (in the category of manifolds)” and “<img src="https://latex.codecogs.com/png.latex?G"> is a Lie group (in the category of sets)”: these two statements involve two different theories. Thinking of Lie groups as “just” groups, but in another category, lets us work with the comparatively simple theory of groups when we need to, and with the special features of smooth manifolds when we need to, without always having to face the full combined structure. It also makes possible analogies to other structures which may be obscured if we have to think of them only in terms of their set-valued models. For example, it’s a cute (<a href="https://ncatlab.org/nlab/show/stabilization+hypothesis">but deep</a>) theorem that a group in the category of groups is an abelian group; we would never notice this by looking at the theory of abelian groups (with set-valued models) alone.↩︎</p></li>
<li id="fn4"><p>For an introduction to one of the many toposes where this is the case, check out <a href="https://grossack.site/2024/07/03/life-in-johnstones-topological-topos.html">this</a> <a href="https://grossack.site/2024/07/03/topological-topos-2-algebras">excellent</a> <a href="https://grossack.site/2024/07/03/topological-topos-3-bonus-axioms">series</a> on <a href="https://academic.oup.com/plms/article-abstract/s3-38/2/237/1484548?redirectedFrom=PDF">Johnstone’s <em>topological topos</em></a>↩︎</p></li>
<li id="fn5"><p>This case differs a bit from the other two, but we’ll come back to it.↩︎</p></li>
<li id="fn6"><p>I’m not impressing any algebraic geometers here, but I do recommend looking at <a href="https://rawgit.com/iblech/internal-methods/master/notes.pdf">Blechschmidt’s thesis</a> for more in depth and useful examples. The above examples are specifically <a href="https://math.stackexchange.com/questions/394194/what-does-a-proof-in-an-internal-logic-actually-look-like/394981#394981">from this MathStackExchange answer by Ingo Blechschmidt</a>. I also recommend looking at his <a href="https://youtu.be/7S8--bIKaWQ?si=yhxQlEfeuO1qmErQ">excellent talk</a> on the subject.↩︎</p></li>
<li id="fn7"><p>I’m only mentioning a few key instigators for each subject; please see the links for more!↩︎</p></li>
<li id="fn8"><p>These are <a href="https://arxiv.org/abs/2106.15390">my</a> <a href="https://arxiv.org/abs/2205.15887">papers</a> in synthetic differential geometry.↩︎</p></li>
<li id="fn9"><p>I also <a href="https://higher-structures.math.cas.cz/api/files/issues/Vol6Iss1/Myers">wrote a paper in synthetic algebraic topology</a>, giving a notion of <em>fibration</em> adapted to the synthetic setting.↩︎</p></li>
<li id="fn10"><p>This happened to me while writing <a href="https://arxiv.org/abs/2205.15887">my paper on orbifolds in SDG</a>; I took Bunge’s axioms, but required another “covering axiom” from an earlier work of her’s and Dubuc’s in order to prove what I needed about compact sets. I didn’t see it coming at the time, though the extra axiom turned out to be a special case of <em>local choice</em>.↩︎</p></li>
<li id="fn11"><p>Though it may be desirable. And possible! At least, in a singular “meta-foundation”. More on that below.↩︎</p></li>
<li id="fn12"><p>See, e.g., Section 4.2 of <a href="https://arxiv.org/pdf/2205.15887">my paper on orbifolds</a>.↩︎</p></li>
<li id="fn13"><p>Really, this adjoint only appears externally, or internally with a “Frobenius formula”. See <a href="https://arxiv.org/abs/2403.01939">Mitchell Riley’s tiny type theory</a> for more.↩︎</p></li>
<li id="fn14"><p>See, e.g.&nbsp;<a href="https://link.springer.com/book/10.1007/978-1-4612-0927-0">Mac Lane &amp; Moerdijk, Sheaves in Geometry and Logic, §VIII.6.</a>.↩︎</p></li>
<li id="fn15"><p>I will remark that this <em><a href="https://ncatlab.org/nlab/show/polarity+in+type+theory">polarity</a></em> distinction between positive (finite limits and colimits) and negative (limits, functions, (sub)object classifiers) phenomena is something that only makes sense in a <em>first order</em> context.↩︎</p></li>
<li id="fn16"><p>We’ll come back to this in a bit, but there is a major difficulty in internalizing the notion of “only using <img src="https://latex.codecogs.com/png.latex?%5Cmathsf%7BSet%7D">-indexed disjunctions” to <img src="https://latex.codecogs.com/png.latex?%5Cmathsf%7BSet%7D%5B%5Cmathbb%7BT%7D%5D">, since “being a <img src="https://latex.codecogs.com/png.latex?%5Cmathsf%7BSet%7D">” is not a pullback stable notion. Rather, we could use <em>locally constantly indexed</em> disjunctions, which is the internalization of the notion of “being a <img src="https://latex.codecogs.com/png.latex?%5Cmathsf%7BSet%7D">”, and is more directly comparable to quasi-coherence for sheaves.↩︎</p></li>
<li id="fn17"><p>Over a locally Noetherian scheme…↩︎</p></li>
<li id="fn18"><p>This analogy is somewhat stained by the fact that a coherent sheaf of modules is not just locally of finite presentation over a general base scheme. This difference between “coherence” and “finite presentation” become more severe in higher category theory, where these notions fail to coincide even for bare homotopy types (where the former are the <img src="https://latex.codecogs.com/png.latex?%5Cpi">-finite homotopy types (having finite homotopy groups, and only finitely many of them), and the latter are the retracts of finite cell complexes). In this blog post, I will always fall on the side of <em>presentation</em>. In general, we will see quasi-coherence as “<em>locally of constant presentation</em>”; it therefore generalizes finite presentation and quasi-coherence, but not coherence.↩︎</p></li>
<li id="fn19"><p>I would have preferred to use the term <em>construction</em> over <em>definition</em> here. However, “constructible” firmly lies in the <em>coherent</em> (and not <em>quasi-coherent</em>) side of the generalizations from 1-categories to <img src="https://latex.codecogs.com/png.latex?%5Cinfty">-categories, and I imagine it would cause confusion if I named the principle “quasi-coherent constructibility”. I could also have gone with “presentation”, since the principle also has to do with the <img src="https://latex.codecogs.com/png.latex?%5Cmathsf%7BHo%7D">-presentability of <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BE%7D">-toposes.↩︎</p></li>
<li id="fn20"><p>Ivan and I had a pleasant chat over dinner at CT2023 (where he had presented that paper) during which I told him about this <em>quasi-coherent induction</em> idea; he said he expected to see the story told at the next CT. I have certainly kept him wanting. I hope this blog post, prepared in advance of CT2025, suffices for the time being.↩︎</p></li>
<li id="fn21"><p>More precisely, we should say that an <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BE%7D">-topos <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BX%7D"> is <img src="https://latex.codecogs.com/png.latex?%5Cgamma">-quasi-coherent for <img src="https://latex.codecogs.com/png.latex?%5Cgamma%20:%20%5Cmathcal%7BE%7D%20%5Cto%20%5Cmathcal%7BB%7D"> the global sections maps when <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BX%7D"> is <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BE%7D">-<img src="https://latex.codecogs.com/png.latex?%5Cgamma%5E%7B%5Cast%7D%5Ckappa">-presentable for <img src="https://latex.codecogs.com/png.latex?%5Ckappa%20%5Cin%20%5Cmathcal%7BB%7D">.↩︎</p></li>
<li id="fn22"><p>I want to thank Mathieu Anel for a delightful walk in the woods while I was a student at Johns Hopkins where we discussed the importance of the arrow topos for synthetic quasi-coherence.↩︎</p></li>
<li id="fn23"><p>This claim contains an internalization subtlety which needs careful resolution.↩︎</p></li>
<li id="fn24"><p>A major difficulty in turning this conjectural account into a rigorous proof is the fact that regular cardinals (<img src="https://latex.codecogs.com/png.latex?%5CSigma">-closed subuniverses) do not quite pull back. I’m sure this difficulty is surmountable, but it is a thorn in my toe.↩︎</p></li>
<li id="fn25"><p>It is worth wondering whether <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BE%7D%5E%7B%5CDelta%5E%7B%5Cmathsf%7Bop%7D%7D%7D"> classifies total orders with distinct top and bottom elements over <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BE%7D"> without assuming a classical meta-theory. The <a href="http://mathieu.anel.free.fr/mat/doc/Anel-2021-CRM.pdf">enveloping topos arguments of Mathieu Anel</a> makes use of the generation of all simplicial objects as colimits of monomorphisms, which strikes me as the sort of reasoning that led to the adoption of cubical methods over simplicial methods in constructive approaches to homotopy type theory.↩︎</p></li>
<li id="fn26"><p>Roughly speaking, GATs with <em>attributes</em> correspond to the (infinitary) lextensive fragment which allows for the internalization <img src="https://latex.codecogs.com/png.latex?%5CDelta%20B"> of base types <img src="https://latex.codecogs.com/png.latex?B%20%5Cin%20%5Cmathsf%7BSet%7D"> as <img src="https://latex.codecogs.com/png.latex?%5CDelta%20B%20:=%20%5Ccoprod_%7Bb%20%5Cin%20B%7D%20%5Ctop">; attributes valued in the base type <img src="https://latex.codecogs.com/png.latex?B%20%5Cin%20%5Cmathsf%7BSet%7D"> correspond to terms <img src="https://latex.codecogs.com/png.latex?%5CGamma%20%5C,%5Cvdash%20t%20:%20%5CDelta%20B">.↩︎</p></li>
<li id="fn27"><p>…and I’m ignoring obvious size issues.↩︎</p></li>
</ol>
</section></div> ]]></description>
  <category>topos theory</category>
  <category>type theory</category>
  <guid>https://topos.institute/blog/2025-07-13-liberating-synthetic-quasi-coherence-from-forcing/</guid>
  <pubDate>Sun, 13 Jul 2025 00:00:00 GMT</pubDate>
</item>
<item>
  <title>Blog / Our Summer Research Associates in 2025</title>
  <dc:creator>Molly White</dc:creator>
  <link>https://topos.institute/blog/2025-07-01-summer-research-associates-2025/</link>
  <description><![CDATA[ 





<p>It is, once again, the time of year where we welcome our Summer Research Associates (RAs) to Topos. These early-career researchers bring with them not just technical knowledge and capability, but also their perspectives on the sort of culture that we should be actively cultivating within Topos. We are very lucky to be able to award these positions, which are a key part of our academic community building mission.</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><a href="2025-group.jpg" class="lightbox" data-gallery="quarto-lightbox-gallery-1" title="The Summer RAs, from left to right: Ea, Lucy, Matt, Corinthia, Aaron, Tony"><img src="https://topos.institute/blog/2025-07-01-summer-research-associates-2025/2025-group.jpg" class="img-fluid figure-img" alt="The Summer RAs, from left to right: Ea, Lucy, Matt, Corinthia, Aaron, Tony"></a></p>
<figcaption>The Summer RAs, from left to right: Ea, Lucy, Matt, Corinthia, Aaron, Tony</figcaption>
</figure>
</div>
<hr>
<p><strong>Tony Wehbe</strong> is a PhD student in Applied Mathematics at the University of Toledo, advised by William Kalies. His research interests are in dynamical systems (specifically hybrid systems), and he also has a strong interest in Category Theory for its use in studying them. At Topos this summer, he is working with Sophie Libkind on understanding the composition of attractor lattices. Specifically, he is exploring how the lattice of attractors in coupled and feedback systems can be characterized in terms of the lattices of attractors of the component systems.</p>
<p><strong>Lucy Horowitz</strong> just finished the first year of her PhD in logic up the hill in Evans Hall, and this summer is working with Kristopher Brown on logical expressivism. They are trying to understand the relationship between “implication-space semantics” and phase-space semantics for linear logic, as well as how to do this kind of substructural logic in some kind of category (likely virtual double categories). Previously Lucy has collaborated with Valeria de Paiva on knowledge graphs of mathematics. When not doing logic Lucy likes to go hiking, play soccer, listen to and play music, and read science fiction.</p>
<p><strong>Aaron Fairbanks</strong> is working with Kevin and David studying comonads on the category <img src="https://latex.codecogs.com/png.latex?%5Cmathbf%7BSet%7D">. Several people at Topos are already fans of <em>polynomial</em> comonads on <img src="https://latex.codecogs.com/png.latex?%5Cmathbf%7BSet%7D">. This means that the comonad endofunctor <img src="https://latex.codecogs.com/png.latex?%5Cmathbf%7BSet%7D%5Cto%5Cmathbf%7BSet%7D"> is of the form <img src="https://latex.codecogs.com/png.latex?%5Csum_%7Bi%5Cin%20I%7Dy%5E%7BX_i%7D">, where <img src="https://latex.codecogs.com/png.latex?y%5E%7BX_i%7D"> denotes the representable functor homming out of the set <img src="https://latex.codecogs.com/png.latex?X_i">. Surprisingly, it turns out that polynomial comonads on <img src="https://latex.codecogs.com/png.latex?%5Cmathbf%7BSet%7D"> are the same thing as categories (shown <a href="https://arxiv.org/abs/1604.01187">here</a>). They plan to study general (not necessarily polynomial) comonads on <img src="https://latex.codecogs.com/png.latex?%5Cmathbf%7BSet%7D">, viewing them as a kind of “generalised category”.</p>
<p><strong>Matt Cuffaro</strong> is a programmer visiting Topos as an RA, splitting his time between building features which capture selections from H.T. Odum’s Systems Ecology into CatColab as well as discussing modelling with Dana Scott. Matt has collaborated with Topos on the AlgebraicJulia ecosystem as a programmer in the GATAS lab in Gainesville, FL, but is glad to be here on the other side this Summer!</p>
<p><a href="https://eaetopoi.github.io/"><strong>Ea E T</strong></a> is a first-year math PhD student at the University of Illinois Urbana-Champaign, working in homotopy theory, infinity-categories, and higher algebra. They did their undergrad in Physics and Mathematics at the University of Calgary, Alberta Canada, which inspired their interest in exploring connections and applications of higher categorical methods in the natural sciences. This summer they are working with Sophie Libkind to explore the use of loose bimodules in the study of dynamical systems.</p>
<p><a href="https://cbaberle.com/"><strong>Corinthia Aberle</strong></a> is a 2nd year PhD student in Pure and Applied Logic in the CS Department at Carnegie Mellon. This Summer, she is working with Evan Patterson and Kevin Carlson on double-categorical logic—specifically, extending the framework of Cartesian double theories to include other sorts of double-categorical limits such as tabulators— she is also working with Dana Scott on the side on promoting formalization in Agda (since She’ll be formalizing all of her results on double categories anyway!) Corinthia was an RA here last summer as well (under the name CB, back then), during which time she worked with David Spivak on applications of polynomial functors to the semantics of dependent type theory. Corinthia is also a composer, songwriter, and producer, who just released her first pop album and is currently working on another one in her spare time! Before starting her PhD, Corinthia also did half her undergrad in philosophy, and remains keenly interested in philosophical issues pertaining to math, logic, technology, and their role in society.</p>



<script defer="" src="https://comments.topos.institute/comentario.js"></script>

 ]]></description>
  <category>Topos</category>
  <category>personnel</category>
  <guid>https://topos.institute/blog/2025-07-01-summer-research-associates-2025/</guid>
  <pubDate>Tue, 01 Jul 2025 00:00:00 GMT</pubDate>
</item>
<item>
  <title>Blog / How to prove equations using diagrams, part 2</title>
  <dc:creator>Evan Patterson</dc:creator>
  <link>https://topos.institute/blog/2025-06-10-e-graphs-2/</link>
  <description><![CDATA[ 





<p>This is the second part in a series about diagrammatic reasoning, inspired by e-graphs. <a href="../e-graphs-1">Last time</a>, we reviewed the concept of <a href="https://ncatlab.org/nlab/show/initial+functor"><em>initial functor</em></a> and showed by example how to calculate with diagrams and initial functors. This time, we make that calculus more systematic and we reconceive e-graphs in terms of initial functors.</p>
<section id="weak-equivalence-of-diagrams" class="level2" data-number="1">
<h2 data-number="1" data-anchor-id="weak-equivalence-of-diagrams"><span class="header-section-number">1</span> Weak equivalence of diagrams</h2>
<p>We’ve been deriving equations by chaining together initial functors between diagrams, going in either direction. Let’s give a name to this equivalence relation on diagrams.</p>
<div id="def-weak-equivalence" class="theorem definition">
<p><span class="theorem-title"><strong>Definition 1</strong></span> A <strong>weak equivalence</strong> from a diagram <img src="https://latex.codecogs.com/png.latex?D:%20%5Cmathsf%7BJ%7D%20%5Cto%20%5Cmathsf%7BC%7D"> to another diagram <img src="https://latex.codecogs.com/png.latex?D':%20%5Cmathsf%7BJ%7D'%20%5Cto%20%5Cmathsf%7BC%7D"> is an initial functor <img src="https://latex.codecogs.com/png.latex?R:%20%5Cmathsf%7BJ%7D%20%5Ctwoheadrightarrow%0A%5Cmathsf%7BJ%7D'"> making the triangle commute:</p>
<div class="tikz">
<img src="https://topos.institute/blog/2025-06-10-e-graphs-2/_svgs/e430bc25e646f834bee5bc7cacfe869ba3eabc7d.svg" class="img-fluid">
</div>
<p>Two diagrams in a category are said to be <strong>weakly equivalent</strong> if they can be connected by a zig-zag of weak equivalences.</p>
</div>
<p>Why call this relation <em>weak</em> equivalence? First, it is not <a href="https://ncatlab.org/nlab/show/equivalence+in+a+2-category">equivalence</a> in any familiar 2-category of diagrams. Moreover, though initial functors are closed under composition and any isomorphism of categories is initial, as follows directly from the definition, initial functors are most interesting when they’re <em>not</em> invertible. So, in order to make weak equivalence be an equivalence relation, we have to consider <em>zig-zags</em> of initial functors.<sup>1</sup></p>
<div class="callout callout-style-simple callout-warning no-icon callout-titled">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon no-icon"></i>
</div>
<div class="callout-title-container flex-fill">
<span class="screen-reader-only">Warning</span>Weak equivalence versus commutativity
</div>
</div>
<div class="callout-body-container callout-body">
<p>By definition, weak equivalence of diagrams preserves limits whenever they exist. Sometimes this property can be used to extract commutation relations from diagrams, as we saw last time. However, we caution that weak equivalence does <em>not</em> preserve commutativity:<sup>2</sup> if a commutative diagram <img src="https://latex.codecogs.com/png.latex?D"> is weakly equivalent to another diagram <img src="https://latex.codecogs.com/png.latex?D'">, it need not be the case that <img src="https://latex.codecogs.com/png.latex?D'"> commutes.</p>
<p>The following weak equivalence of diagrams is a minimal counterexample.</p>
<div class="tikz">
<img src="https://topos.institute/blog/2025-06-10-e-graphs-2/_svgs/ab6fa11ac1ee7c489bd6c6c42f5080401ff90d07.svg" class="img-fluid">
</div>
<p>The functor shown is initial because the limit of both diagrams is the equalizer of <img src="https://latex.codecogs.com/png.latex?g%20%5Ccirc%20f"> and <img src="https://latex.codecogs.com/png.latex?h%20%5Ccirc%20f">, whenever it exists. However, if we suppose that</p>
<p><img src="https://latex.codecogs.com/png.latex?%20g%20%5Ccirc%20f%20=%20h%20%5Ccirc%20f%20%5Cqquad%5Ctext%7Bbut%7D%5Cqquad%20g%20%5Cneq%20h,%20"></p>
<p>so that limit of both diagrams is <img src="https://latex.codecogs.com/png.latex?X">, then the first diagram commutes but the second does not.</p>
<p>It can be a useful feature of weak equivalence that it works just as well regardless of whether the diagrams involved commute. As it happens, I first got into this topic by studying “Tonti diagrams,” which present partial differential equations in physics <span class="citation" data-cites="patterson2023">(Patterson et al. 2023)</span>. These diagrams do <em>not</em> commute; if they did, the equations would already be solved!</p>
</div>
</div>
</section>
<section id="e-diagrams" class="level2" data-number="2">
<h2 data-number="2" data-anchor-id="e-diagrams"><span class="header-section-number">2</span> E-diagrams</h2>
<p>We now attempt to make contact with e-graphs. That’s less straightforward than it might seem since, taken at face value, the concrete descriptions of e-graphs offered by <span class="citation" data-cites="nelson1980 detlefs2005">Nelson (1980; see also Detlefs, Nelson, and Saxe 2005, sec. 4.2)</span> and by <span class="citation" data-cites="willsey2021">Willsey et al. (2021, sec. 2.1)</span> look rather different. We reproduce features of both without claiming to be fully faithful to either.</p>
<div id="def-e-diagram" class="theorem definition">
<p><span class="theorem-title"><strong>Definition 2</strong></span> An <strong>e-diagram</strong> over a diagram <img src="https://latex.codecogs.com/png.latex?D:%20%5Cmathsf%7BJ%7D%20%5Cto%20%5Cmathsf%7BC%7D"> is a factorization of <img src="https://latex.codecogs.com/png.latex?D"> through an initial functor, comprising a category <img src="https://latex.codecogs.com/png.latex?%5Cmathsf%7BH%7D">, an initial functor <img src="https://latex.codecogs.com/png.latex?E:%20%5Cmathsf%7BJ%7D%20%5Ctwoheadrightarrow%5Cmathsf%7BH%7D">, and a diagram <img src="https://latex.codecogs.com/png.latex?P:%20%5Cmathsf%7BH%7D%20%5Cto%20%5Cmathsf%7BC%7D"> such that <img src="https://latex.codecogs.com/png.latex?D%20=%20P%20%5Ccirc%20E">.</p>
<div class="tikz">
<img src="https://topos.institute/blog/2025-06-10-e-graphs-2/_svgs/2620451891be67befce7f5931c80cdee36760990.svg" class="img-fluid">
</div>
</div>
<p>The pieces constituting an e-diagram have interpretations in e-graph jargon:</p>
<ul>
<li>The target category <img src="https://latex.codecogs.com/png.latex?%5Cmathsf%7BC%7D"> is a <strong>theory</strong>, most clearly when <img src="https://latex.codecogs.com/png.latex?%5Cmathsf%7BC%7D"> is finitely presented, so that its generating graph is a <strong>signature</strong>, defining types and (unary) operations, and its path equations are equational <strong>axioms</strong>.</li>
<li>The diagram <img src="https://latex.codecogs.com/png.latex?D:%20%5Cmathsf%7BJ%7D%20%5Cto%20%5Cmathsf%7BC%7D"> is a <strong>term graph</strong> in the theory <img src="https://latex.codecogs.com/png.latex?%5Cmathsf%7BC%7D">, particularly when the indexing category <img src="https://latex.codecogs.com/png.latex?%5Cmathsf%7BJ%7D"> is freely generated by a finite graph. The objects of <img src="https://latex.codecogs.com/png.latex?%5Cmathsf%7BJ%7D"> are <strong>e-class IDs</strong>.</li>
<li>The category <img src="https://latex.codecogs.com/png.latex?%5Cmathsf%7BH%7D"> is something like a <strong>hash cons</strong>. Its objects are <strong>canonical e-class IDs</strong>.<sup>3</sup> Below, we give conditions on the functor <img src="https://latex.codecogs.com/png.latex?P:%20%5Cmathsf%7BH%7D%20%5Cto%20%5Cmathsf%7BC%7D"> that make the morphisms of <img src="https://latex.codecogs.com/png.latex?%5Cmathsf%7BH%7D"> encode the mapping of a hash cons.</li>
<li>As for the functor <img src="https://latex.codecogs.com/png.latex?E:%20%5Cmathsf%7BJ%7D%20%5Ctwoheadrightarrow%5Cmathsf%7BH%7D">, the object map <img src="https://latex.codecogs.com/png.latex?%5Cmathop%7B%5Cmathrm%7BOb%7D%7DE:%20%5Cmathop%7B%5Cmathrm%7BOb%7D%7D%0A%5Cmathsf%7BJ%7D%20%5Cto%20%5Cmathop%7B%5Cmathrm%7BOb%7D%7D%5Cmathsf%7BH%7D"> assigns each e-class ID to a canonical e-class ID, like in a <strong>union-find</strong>, while the morphism map just exists to witness the initiality of <img src="https://latex.codecogs.com/png.latex?E">.</li>
</ul>
<p>We now define the <em>category</em> of all e-diagrams over a diagram.</p>
<div id="def-e-diagram-morphism" class="theorem definition">
<p><span class="theorem-title"><strong>Definition 3</strong></span> A <strong>morphism of e-diagrams</strong> <img src="https://latex.codecogs.com/png.latex?(%5Cmathsf%7BH%7D,%20E,%20P)%20%5Cto%20(%5Cmathsf%7BH%7D',%20E',%20P')"> over a common diagram <img src="https://latex.codecogs.com/png.latex?D:%20%5Cmathsf%7BJ%7D%20%5Cto%20%5Cmathsf%7BC%7D"> is a functor <img src="https://latex.codecogs.com/png.latex?R:%20%5Cmathsf%7BH%7D%20%5Cto%20%5Cmathsf%7BH%7D'"> making the two triangles commute:</p>
<div class="tikz">
<img src="https://topos.institute/blog/2025-06-10-e-graphs-2/_svgs/cbfcc415217051d10d11b5009b79a862543d598f.svg" class="img-fluid">
</div>
</div>
<p>We do not assume that the functor <img src="https://latex.codecogs.com/png.latex?R"> is initial but, as we will see shortly, a cancellation property of initial functors ensures that <img src="https://latex.codecogs.com/png.latex?R"> is automatically initial. So there is not actually a choice to make.</p>
<p>In other words, the category of e-diagrams over a diagram <img src="https://latex.codecogs.com/png.latex?D"> is the full subcategory of the <a href="https://ncatlab.org/nlab/show/factorization+category">factorization category</a> of <img src="https://latex.codecogs.com/png.latex?D"> spanned by factorizations whose left component is initial. The factorization category construction goes back at least to <span class="citation" data-cites="lawvere1986">Lawvere (1986)</span>.</p>
</section>
<section id="the-trivial-e-diagram" class="level2" data-number="3">
<h2 data-number="3" data-anchor-id="the-trivial-e-diagram"><span class="header-section-number">3</span> The trivial e-diagram</h2>
<p>Any diagram <img src="https://latex.codecogs.com/png.latex?D:%20%5Cmathsf%7BJ%7D%20%5Cto%20%5Cmathsf%7BC%7D"> trivially has an e-diagram over it, given by the factorization <img src="https://latex.codecogs.com/png.latex?(1_%5Cmathsf%7BJ%7D,%20D)">. This e-diagram is initial in the category of e-diagrams over <img src="https://latex.codecogs.com/png.latex?D">:</p>
<div class="tikz">
<img src="https://topos.institute/blog/2025-06-10-e-graphs-2/_svgs/3ef1c2f89b691c8d7cbe18e495143368b03478c8.svg" class="img-fluid">
</div>
<p>The terminology is apt because the initial e-diagram is, in practice, how an e-diagram will be initialized from an existing diagram (term graph).</p>
</section>
<section id="the-ideal-e-diagram" class="level2" data-number="4">
<h2 data-number="4" data-anchor-id="the-ideal-e-diagram"><span class="header-section-number">4</span> The ideal e-diagram</h2>
<p>What is not so obvious is that the category of e-diagrams over a fixed diagram also has a terminal object. This follows from the foundational theorem by <span class="citation" data-cites="street1973">Street and Walters (1973)</span> that initial functors form the left class of morphisms in an orthogonal factorization system (OFS) on <img src="https://latex.codecogs.com/png.latex?%5Cmathsf%7BCat%7D">, called the <a href="https://ncatlab.org/nlab/show/comprehensive+factorization+system"><em>comprehensive factorization system</em></a>.</p>
<div id="thm-comprehensive-factorization" class="theorem">
<p><span class="theorem-title"><strong>Theorem 1 (Comprehensive factorization)</strong></span> Initial functors and discrete opfibrations form the left and right classes, respectively, of an orthogonal factorization system on <img src="https://latex.codecogs.com/png.latex?%5Cmathsf%7BCat%7D">. Thus, any functor <img src="https://latex.codecogs.com/png.latex?F:%20%5Cmathsf%7BC%7D%20%5Cto%20%5Cmathsf%7BD%7D"> admits a factorization <img src="https://latex.codecogs.com/png.latex?%5Cmathsf%7BC%7D%20%5Ctwoheadrightarrow%5Cmathsf%7BE%7D%0A%5Crightarrowtail%5Cmathsf%7BD%7D"> as initial functor followed by a discrete opfibration, and this factorization is unique up to unique isomorphism.</p>
</div>
<p>Recall that a functor <img src="https://latex.codecogs.com/png.latex?P:%20%5Cmathsf%7BE%7D%20%5Cto%20%5Cmathsf%7BC%7D"> is a <strong>discrete opfibration</strong>, here denoted<sup>4</sup> <img src="https://latex.codecogs.com/png.latex?P:%20%5Cmathsf%7BE%7D%20%5Crightarrowtail%0A%5Cmathsf%7BC%7D">, if, for every morphism <img src="https://latex.codecogs.com/png.latex?f:%20X%20%5Cto%20Y"> in <img src="https://latex.codecogs.com/png.latex?%5Cmathsf%7BC%7D"> and every object <img src="https://latex.codecogs.com/png.latex?x%0A%5Cin%20%5Cmathsf%7BE%7D"> with <img src="https://latex.codecogs.com/png.latex?P(x)%20=%20X">, there exists a unique morphism <img src="https://latex.codecogs.com/png.latex?%5Cbar%20f:%20x%20%5Cto%20y"> in <img src="https://latex.codecogs.com/png.latex?%5Cmathsf%7BE%7D"> such that <img src="https://latex.codecogs.com/png.latex?P(%5Cbar%20f)%20=%20f">.</p>
<div class="tikz">
<img src="https://topos.institute/blog/2025-06-10-e-graphs-2/_svgs/fc6c56b85b850c544fc8fe91ca4f32450541ad7d.svg" class="img-fluid">
</div>
<p>The existence of the comprehensive factorization system is a powerful result with many consequences, such as:</p>
<ul>
<li>the <a href="https://ncatlab.org/nlab/show/orthogonal+factorization+system#CancellationProperties">cancellation property</a> of the left class in an OFS implies that any functor <img src="https://latex.codecogs.com/png.latex?R:%20%5Cmathsf%7BH%7D%20%5Cto%20%5Cmathsf%7BH%7D'"> constituting a morphism of e-diagrams is initial, as noted above;</li>
<li>a <a href="https://ncatlab.org/nlab/show/weak+factorization+system#ClosureProperties">closure property</a> of the left class states that initial functors are stable under pushout, as used below.</li>
</ul>
<p>Moreover, comprehensive factorization implies that the factorization of a diagram <img src="https://latex.codecogs.com/png.latex?D:%20%5Cmathsf%7BJ%7D%20%5Cto%20%5Cmathsf%7BC%7D"> as an initial functor <img src="https://latex.codecogs.com/png.latex?%5Cmathsf%7BE%7D_*:%20%5Cmathsf%7BJ%7D%0A%5Ctwoheadrightarrow%5Cmathsf%7BH%7D_*"> followed by a discrete opfibration <img src="https://latex.codecogs.com/png.latex?P_*:%20%5Cmathsf%7BH%7D_*%20%5Crightarrowtail%0A%5Cmathsf%7BC%7D"> is terminal in the category of e-diagrams over <img src="https://latex.codecogs.com/png.latex?D">:</p>
<div class="tikz">
<img src="https://topos.institute/blog/2025-06-10-e-graphs-2/_svgs/c82a9b8278477549c968a2a36b0b85f17a4e08c7.svg" class="img-fluid">
</div>
<p>The existence and uniqueness of a functor <img src="https://latex.codecogs.com/png.latex?R"> filling the square is a direct application of initial functors being <em>left orthogonal</em> with respect to discrete opfibrations.</p>
<p>The e-diagram produced by comprehensive factorization is ideal in the sense that the “hash cons invariant” <span class="citation" data-cites="willsey2021">(Willsey et al. 2021, Definition 2.7)</span> is satisfied for any canonical e-node that can be formed. Rephrased in e-graph jargon, the functor <img src="https://latex.codecogs.com/png.latex?P_*:%20%5Cmathsf%7BH%7D_*%20%5Crightarrowtail%5Cmathsf%7BC%7D"> being a discrete opfibration says that for every canonical e-class ID <img src="https://latex.codecogs.com/png.latex?x%20%5Cin%20%5Cmathsf%7BH%7D_*"> and every operation <img src="https://latex.codecogs.com/png.latex?f:%20X%20%5Cto%20Y"> in <img src="https://latex.codecogs.com/png.latex?%5Cmathsf%7BC%7D"> with domain <img src="https://latex.codecogs.com/png.latex?X%20=%20P_*(x)">—that is, for every <strong>canonical e-node</strong> “<img src="https://latex.codecogs.com/png.latex?f(x)">”—there exists a unique lift of <img src="https://latex.codecogs.com/png.latex?f"> through <img src="https://latex.codecogs.com/png.latex?P_*"> to a morphism <img src="https://latex.codecogs.com/png.latex?%5Cbar%0Af:%20x%20%5Cto%20y">. The codomain <img src="https://latex.codecogs.com/png.latex?y%20=%20%5Coperatorname%7Bcod%7D(%5Cbar%20f)"> of this unique lift is the canonical e-class ID associated with the canonical e-node “<img src="https://latex.codecogs.com/png.latex?f(x)">”. Thus, in the ideal e-diagram, the relation from canonical e-nodes to canonical e-class IDs is a function, and evaluating this function decides whether canonical e-nodes are equivalent.</p>
<p>So, is the ideal e-diagram the only e-diagram we’ll ever need? No, because in general it cannot be computed. As we’ll have occasion to study in a future post, the comprehensive factorization of a functor <img src="https://latex.codecogs.com/png.latex?F:%20%5Cmathsf%7BC%7D%20%5Cto%20%5Cmathsf%7BD%7D"> is constructed by left Kan extending the terminal copresheaf on <img src="https://latex.codecogs.com/png.latex?%5Cmathsf%7BC%7D"> along <img src="https://latex.codecogs.com/png.latex?F">. Left Kan extensions generally cannot be computed, for two reasons. First, even when all the input data is finite, the output may be infinite. Second, even when the output is finite, it still might not be possible to compute it. Left Kan extension is formally uncomputable: it includes solving the word problem for categories, hence also the word problem for groups, an early and famous undecidable problem. Thus, to suggest that comprehensive factorization or left Kan extension “solves” the problem of reasoning with e-graphs would be entirely backward; rather, it is <em>because</em> left Kan extension is uncomputable that we need a flexible e-graph data structure supporting a variety of reasoning heuristics.<sup>5</sup> Iteratively approximating a left Kan extension is just one important application of e-graphs.</p>
</section>
<section id="rewriting-e-diagrams" class="level2" data-number="5">
<h2 data-number="5" data-anchor-id="rewriting-e-diagrams"><span class="header-section-number">5</span> Rewriting e-diagrams</h2>
<p>Having codified the <em>objects</em> of interest as e-diagrams, we turn to <em>manipulating</em> e-diagrams using the formalism of pushout-based rewriting. The goal is to show that calculations similar to <a href="../e-graphs-1/#examples-and-calculations">last time’s</a> can be carried out by applying rewrite rules, where each rule application is guaranteed to preserve weak equivalence of diagrams. Note that this scheme is not intended as a guide to implementation. Though e-graphs can be implemented using rewriting techniques, it should likely not be in terms of initial functors between categories. Rather, having proved the procedure correct, we can forget about initiality and compile to rewrite rules operating directly on the graphs generating the diagram shapes. As a proof of concept, my colleague <a href="../../people/kristopher-brown/">Kris Brown</a> has implemented e-graphs using hypergraph rewriting <span class="citation" data-cites="brown2025">(Brown 2025)</span>.</p>
<p>Rewrites of an e-diagram <img src="https://latex.codecogs.com/png.latex?%5Cmathsf%7BJ%7D%20%5Ctwoheadrightarrow%5Cmathsf%7BH%7D%20%5Cto%20%5Cmathsf%7BC%7D"> may affect just the category <img src="https://latex.codecogs.com/png.latex?%5Cmathsf%7BH%7D"> or both <img src="https://latex.codecogs.com/png.latex?%5Cmathsf%7BJ%7D"> and <img src="https://latex.codecogs.com/png.latex?%5Cmathsf%7BH%7D">. Below we imagine that the “term graph” <img src="https://latex.codecogs.com/png.latex?%5Cmathsf%7BJ%7D"> only ever grows by introducing new terms, whereas the “hash cons” <img src="https://latex.codecogs.com/png.latex?%5Cmathsf%7BH%7D"> is also reduced through equation introduction and congruence closure. Other schemes are also possible.</p>
<section id="rewriting-over-a-fixed-diagram" class="level3" data-number="5.1">
<h3 data-number="5.1" data-anchor-id="rewriting-over-a-fixed-diagram"><span class="header-section-number">5.1</span> Rewriting over a fixed diagram</h3>
<p>The simplest rewrites change the e-diagram <img src="https://latex.codecogs.com/png.latex?(%5Cmathsf%7BH%7D,%20E,%20P)"> without changing the diagram <img src="https://latex.codecogs.com/png.latex?D:%20%5Cmathsf%7BJ%7D%20%5Cto%20%5Cmathsf%7BC%7D"> it is over. Given a <strong>rewrite rule</strong> of the form</p>
<div class="tikz">
<img src="https://topos.institute/blog/2025-06-10-e-graphs-2/_svgs/eeb1667cb2bfe155b4fa0857c80d303d61e9a301.svg" class="img-fluid">
</div>
<p>along with a <strong>match</strong> of its left-hand side, namely any map <img src="https://latex.codecogs.com/png.latex?%5Cmathsf%7BL%7D%20%5Cto%0A%5Cmathsf%7BH%7D"> in <img src="https://latex.codecogs.com/png.latex?%5Cmathsf%7BCat%7D/%5Cmathsf%7BC%7D">, we take a pushout</p>
<div class="tikz">
<img src="https://topos.institute/blog/2025-06-10-e-graphs-2/_svgs/2b5791372d5eba2452289edbcac805cc43f31956.svg" class="img-fluid">
</div>
<p>to obtain a new e-diagram <img src="https://latex.codecogs.com/png.latex?(%5Cmathsf%7BH%7D',%20E',%20P')"> over <img src="https://latex.codecogs.com/png.latex?D">. We use the fact that initial functors are stable under pushout.</p>
<div class="callout callout-style-simple callout-tip no-icon callout-titled">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon no-icon"></i>
</div>
<div class="callout-title-container flex-fill">
<span class="screen-reader-only">Tip</span>Rule: congruence reduction
</div>
</div>
<div class="callout-body-container callout-body">
<p>Each morphism <img src="https://latex.codecogs.com/png.latex?f:%20X%20%5Cto%20Y"> in <img src="https://latex.codecogs.com/png.latex?%5Cmathsf%7BC%7D"> generates a rewrite rule</p>
<div class="tikz">
<img src="https://topos.institute/blog/2025-06-10-e-graphs-2/_svgs/614f581ff2c3e28d1ac0509373729e8fdce96f1b.svg" class="img-fluid">
</div>
<p>that can be applied in this fashion to perform congruence reduction in <img src="https://latex.codecogs.com/png.latex?%5Cmathsf%7BH%7D">.</p>
</div>
</div>
<div class="callout callout-style-simple callout-tip no-icon callout-titled">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon no-icon"></i>
</div>
<div class="callout-title-container flex-fill">
<span class="screen-reader-only">Tip</span>Rule: equation introduction
</div>
</div>
<div class="callout-body-container callout-body">
<p>Any path equation in <img src="https://latex.codecogs.com/png.latex?%5Cmathsf%7BC%7D">, say <img src="https://latex.codecogs.com/png.latex?g%20%5Ccirc%20f%20=%20k%20%5Ccirc%20h">, generates a rewrite rule</p>
<div class="tikz">
<img src="https://topos.institute/blog/2025-06-10-e-graphs-2/_svgs/92abd199de799dbc4626ce6209b1663829676119.svg" class="img-fluid">
</div>
<p>where the checkmark indicates that the square <em>in the indexing category itself</em> commutes. Thus, at the expense of using diagram shapes that are not free, we can apply an equation in <img src="https://latex.codecogs.com/png.latex?%5Cmathsf%7BC%7D"> using a single initial functor, rather than a span of initial functors as in <a href="../e-graphs-1/#motifs-among-initial-functors">previous post</a>.</p>
</div>
</div>
</section>
<section id="rewriting-the-diagram-itself" class="level3" data-number="5.2">
<h3 data-number="5.2" data-anchor-id="rewriting-the-diagram-itself"><span class="header-section-number">5.2</span> Rewriting the diagram itself</h3>
<p>Given a rewrite rule <img src="https://latex.codecogs.com/png.latex?R:%20%5Cmathsf%7BL%7D%20%5Ctwoheadrightarrow%5Cmathsf%7BR%7D"> in <img src="https://latex.codecogs.com/png.latex?%5Cmathsf%7BCat%7D/%5Cmathsf%7BC%7D"> as above along with a <strong>match</strong> <img src="https://latex.codecogs.com/png.latex?%5Cmathsf%7BL%7D%20%5Cto%20%5Cmathsf%7BJ%7D">, now in <img src="https://latex.codecogs.com/png.latex?%5Cmathsf%7BJ%7D">, we produce a compatible match in <img src="https://latex.codecogs.com/png.latex?%5Cmathsf%7BH%7D"> by post-composing with <img src="https://latex.codecogs.com/png.latex?E:%20%5Cmathsf%7BJ%7D%20%5Ctwoheadrightarrow%0A%5Cmathsf%7BH%7D">. We then apply the rule along both matches by taking two pushouts, which the pasting law for pushout squares allows us to express as:</p>
<div class="tikz">
<img src="https://topos.institute/blog/2025-06-10-e-graphs-2/_svgs/ed662103212c8f08e5dfd8c564b14e53abe2943e.svg" class="img-fluid">
</div>
<p>The result is a new e-diagram <img src="https://latex.codecogs.com/png.latex?(%5Cmathsf%7BH%7D',%20E',%20P')"> over the new diagram <img src="https://latex.codecogs.com/png.latex?D'%0A%5Ccoloneqq%20P'%20%5Ccirc%20E'"> and, by construction, <img src="https://latex.codecogs.com/png.latex?D'"> is weakly equivalent to the original diagram <img src="https://latex.codecogs.com/png.latex?D%20=%20P%20%5Ccirc%20E">. Again, we use that initial functors are stable under pushout.</p>
<div class="callout callout-style-simple callout-tip no-icon callout-titled">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon no-icon"></i>
</div>
<div class="callout-title-container flex-fill">
<span class="screen-reader-only">Tip</span>Rule: term introduction
</div>
</div>
<div class="callout-body-container callout-body">
<p>Each morphism <img src="https://latex.codecogs.com/png.latex?f:%20X%20%5Cto%20Y"> in <img src="https://latex.codecogs.com/png.latex?%5Cmathsf%7BC%7D"> generates a rewrite rule</p>
<p><img src="https://latex.codecogs.com/png.latex?%0A%5Cbig%5C%7B%20X%20%5Cbig%5C%7D%20%5Cquad%5Ctwoheadrightarrow%5Cquad%20%5Cleft%5C%7B%20X%20%5Cxrightarrow%7Bf%7D%20Y%20%5Cright%5C%7D%0A"></p>
<p>that can be applied as above to introduce a new term in both <img src="https://latex.codecogs.com/png.latex?%5Cmathsf%7BJ%7D"> and <img src="https://latex.codecogs.com/png.latex?%5Cmathsf%7BH%7D">.</p>
</div>
</div>
</section>
</section>
<section id="outlook" class="level2" data-number="6">
<h2 data-number="6" data-anchor-id="outlook"><span class="header-section-number">6</span> Outlook</h2>
<p>In this second post on diagrammatic reasoning, we filled in aspects of the formalism neglected in the first post, proposing a definition of <em>e-diagram</em> and showing how to rewrite e-diagrams by applying rules in the form of initial functor <em>motifs</em>. While this is all “just” formalism, with the key ideas already present in the examples and calculations from last time, it has been a good excuse to review the comprehensive factorization system on <img src="https://latex.codecogs.com/png.latex?%5Cmathsf%7BCat%7D">, a powerful theorem that, among other consequences, points to the ideal object of e-graph computation.</p>
<p>Having set out the basic formalism, we are now free to embelish it by considering categories with extra structure. Next time we’ll study diagrams and initial functors for categories with finite products, recovering the standard setting of e-graphs that allows constants and operations of arity greater than one. More ambitiously, in future posts, we hope to show the benefits of a clean categorical semantics by generalizing to new settings where e-graphs are not standardly applied.</p>
</section>
<section id="references" class="level2" data-number="7">
<h2 data-number="7" data-anchor-id="references"><span class="header-section-number">7</span> References</h2>
<div id="refs" class="references csl-bib-body hanging-indent" data-entry-spacing="0">
<div id="ref-brown2025" class="csl-entry">
Brown, Kris. 2025. <span>“<span class="nocase">CSetEGraphs.jl</span>.”</span> <a href="https://github.com/kris-brown/CSetEGraphs.jl">https://github.com/kris-brown/CSetEGraphs.jl</a>.
</div>
<div id="ref-carlson2024" class="csl-entry">
Carlson, Kevin, James Fairbanks, Tim Hosgood, and Evan Patterson. 2024. <span>“The Diagrammatic Presentation of Equations in Categories.”</span> <a href="https://arxiv.org/abs/2401.09751">https://arxiv.org/abs/2401.09751</a>.
</div>
<div id="ref-detlefs2005" class="csl-entry">
Detlefs, David, Greg Nelson, and James B. Saxe. 2005. <span>“Simplify: A Theorem Prover for Program Checking.”</span> <em>Journal of the ACM</em> 52 (3): 365–473. <a href="https://doi.org/10.1145/1066100.1066102">https://doi.org/10.1145/1066100.1066102</a>.
</div>
<div id="ref-lawvere1986" class="csl-entry">
Lawvere, F. William. 1986. <span>“State Categories and Response Functors.”</span> <a href="https://github.com/mattearnshaw/lawvere/blob/master/pdfs/1986-state-categories-and-response-functors.pdf">https://github.com/mattearnshaw/lawvere/blob/master/pdfs/1986-state-categories-and-response-functors.pdf</a>.
</div>
<div id="ref-nelson1980" class="csl-entry">
Nelson, Greg. 1980. <span>“Techniques for Program Verification.”</span> PhD thesis, Stanford University.
</div>
<div id="ref-patterson2023" class="csl-entry">
Patterson, Evan, Andrew Baas, Timothy Hosgood, and James Fairbanks. 2023. <span>“A Diagrammatic View of Differential Equations in Physics.”</span> <em>Mathematics in Engineering</em> 5 (2): 1–59. <a href="https://doi.org/10.3934/mine.2023036">https://doi.org/10.3934/mine.2023036</a>.
</div>
<div id="ref-street1973" class="csl-entry">
Street, Ross, and R. F. C. Walters. 1973. <span>“The Comprehensive Factorization of a Functor.”</span> <em>Bulletin of the American Mathematical Society</em> 79 (5): 936–41. <a href="https://doi.org/10.1090/S0002-9904-1973-13268-9">https://doi.org/10.1090/S0002-9904-1973-13268-9</a>.
</div>
<div id="ref-willsey2021" class="csl-entry">
Willsey, Max, Chandrakana Nandi, Yisu Remy Wang, Oliver Flatt, Zachary Tatlock, and Pavel Panchekha. 2021. <span>“Egg: Fast and Extensible Equality Saturation.”</span> <em>Proceedings of the ACM on Programming Languages</em> 5 (POPL): 1–29. <a href="https://doi.org/10.1145/3434304">https://doi.org/10.1145/3434304</a>.
</div>
</div>


</section>


<script defer="" src="https://comments.topos.institute/comentario.js"></script>

<div id="quarto-appendix" class="default"><section id="footnotes" class="footnotes footnotes-end-of-document"><h2 class="anchored quarto-appendix-heading">Footnotes</h2>

<ol>
<li id="fn1"><p>Instead of passing to a mere relation of weak equivalence, which forgets <em>how</em> two diagrams are weakly equivalent, the believing structuralist would rather <a href="https://ncatlab.org/nlab/show/category+of+fractions"><em>localize</em></a> at the initial functors, formally inverting that class of morphisms within the category of diagrams. In a paper led by Kevin Carlson <span class="citation" data-cites="carlson2024">(Carlson et al. 2024)</span>, we proved that localizing at initial functors is equivalent to localizing at the largest class of diagram morphisms that preserve solutions to equations (lifts against any discrete opfibration). This justifies defining weak equivalences of diagrams to be initial functors.↩︎</p></li>
<li id="fn2"><p>Recall from the <a href="../e-graphs-1/#def-diagram">first post</a> that a diagram <strong>commutes</strong> if, for every pair of parallel morphisms in the diagram’s shape, their images in the target category are equal.↩︎</p></li>
<li id="fn3"><p>Calling a chosen representative of an equivalence class “canonical” is traditional in computer science but should not be confused with <a href="https://mathoverflow.net/q/19644">“canonical”</a> as a term of art in mathematics. Far from being mathematically canonical, the choice of elements to play the role of canonical e-class IDs is completely arbitrary. In a union-find data structure, the canonical IDs are usually taken to be a subset of the set of all IDs—a set-theoretic distinction meaningless in structuralist mathematics. What <em>is</em> canonical is the ideal e-diagram introduced later, since it is unique up to unique isomorphism.↩︎</p></li>
<li id="fn4"><p>Writing initial functors with “<img src="https://latex.codecogs.com/png.latex?%5Ctwoheadrightarrow">” arrows and discrete opfibrations with “<img src="https://latex.codecogs.com/png.latex?%5Crightarrowtail">” arrows calls to mind the ur-example of a factorization system, the epi-mono factorization in <img src="https://latex.codecogs.com/png.latex?%5Cmathsf%7BSet%7D">. However, the analogy runs deeper than that: the comprehensive factorization in <img src="https://latex.codecogs.com/png.latex?%5Cmathsf%7BCat%7D"> categorifies the epi-mono factorization in <img src="https://latex.codecogs.com/png.latex?%5Cmathsf%7BSet%7D">. A discrete opfibration (as well as a discrete fibration) is a map into a 1-category whose fibers are 0-categories, i.e., sets, while an injection is a map into a 0-category whose fibers are <a href="https://ncatlab.org/nlab/show/%28-1%29-category">(-1)-categories</a>, i.e., propositions. Moreover, an initial functor is a functor <img src="https://latex.codecogs.com/png.latex?R:%20%5Cmathsf%7BJ%7D%20%5Cto%0A%5Cmathsf%7BK%7D"> such that each comma category (“lax pullback”) <img src="https://latex.codecogs.com/png.latex?R/k"> is non-empty and connected, while a surjection is a function <img src="https://latex.codecogs.com/png.latex?R:%20J%20%5Cto%20K"> such that each pullback <img src="https://latex.codecogs.com/png.latex?R%20%5Ctimes_K%20k"> is nonempty. I thank David Jaz Myers for pointing out this analogy to me.↩︎</p></li>
<li id="fn5"><p>In the e-graph engine <code>egglog</code>, these heuristics take of the form of <em>schedules</em> for applying rewrite rules.↩︎</p></li>
</ol>
</section></div> ]]></description>
  <category>category theory</category>
  <category>rewriting</category>
  <guid>https://topos.institute/blog/2025-06-10-e-graphs-2/</guid>
  <pubDate>Tue, 10 Jun 2025 00:00:00 GMT</pubDate>
</item>
</channel>
</rss>
