<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="/public/default.xsl"?>
<fr:tree xmlns:fr="http://www.forester-notes.org" xmlns:html="http://www.w3.org/1999/xhtml" xmlns:xml="http://www.w3.org/XML/1998/namespace" root="false" base-url="/public/">
  <fr:frontmatter>
    <fr:authors>
      <fr:author>
        <fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link>
      </fr:author>
    </fr:authors>
    <fr:date>
      <fr:year>2025</fr:year>
      <fr:month>2</fr:month>
      <fr:day>28</fr:day>
    </fr:date>
    <fr:uri>https://forest.topos.site/ocl-006Y/</fr:uri>
    <fr:display-uri>https://forest.topos.site/ocl-006Y</fr:display-uri>
    <fr:route>/ocl-006Y/</fr:route>
    <fr:title text="Abstraction without semantic expansion">Abstraction without semantic expansion</fr:title>
    <fr:meta name="subtitle">Notes on the applications of two-level type theory</fr:meta>
  </fr:frontmatter>
  <fr:mainmatter>
    <fr:tree show-metadata="false">
      <fr:frontmatter>
        <fr:authors>
          <fr:contributor>
            <fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link>
          </fr:contributor>
        </fr:authors>
        <fr:date>
          <fr:year>2025</fr:year>
          <fr:month>2</fr:month>
          <fr:day>28</fr:day>
        </fr:date>
        <fr:uri>https://forest.topos.site/ocl-006Z/</fr:uri>
        <fr:display-uri>https://forest.topos.site/ocl-006Z</fr:display-uri>
        <fr:route>/ocl-006Z/</fr:route>
        <fr:title text="Introduction">Introduction</fr:title>
      </fr:frontmatter>
      <fr:mainmatter>
        <fr:tree show-metadata="false">
          <fr:frontmatter>
            <fr:authors>
              <fr:author>
                <fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link>
              </fr:author>
            </fr:authors>
            <fr:date>
              <fr:year>2025</fr:year>
              <fr:month>5</fr:month>
              <fr:day>12</fr:day>
            </fr:date>
            <fr:uri>https://forest.topos.site/ocl-00ER/</fr:uri>
            <fr:display-uri>https://forest.topos.site/ocl-00ER</fr:display-uri>
            <fr:route>/ocl-00ER/</fr:route>
            <fr:title text="Warnings">Warnings</fr:title>
          </fr:frontmatter>
          <fr:mainmatter>
            <html:ol><html:li>This is work-in-progress; I am fairly sure most of what I have written is correct, but the sections on the semantics of EMTT need work</html:li>
  <html:li>I have recently discovered that a large amount of EMTT that I believed was original is in fact a rediscovery of the work in <fr:link href="/andrás-kovács/" title="András Kovács" uri="https://forest.topos.site/andrás-kovács/" display-uri="https://forest.topos.site/andrás-kovács" type="local">András Kovács</fr:link>'s <fr:link href="/kovács-2022-type/" title="Type-Theoretic Signatures for Algebraic Theories and Inductive Types" uri="https://forest.topos.site/kovács-2022-type/" display-uri="https://forest.topos.site/kovács-2022-type" type="local">thesis</fr:link>. On one hand, this is good news, because it means that I can draw upon a much larger body of work than I previously knew about, and some of my “future work” has in fact already been done. On the other hand, this will require a substantial reworking of this paper to be up-to-date with the more recent literature.</html:li></html:ol>
          </fr:mainmatter>
        </fr:tree>
        <fr:tree show-metadata="false">
          <fr:frontmatter>
            <fr:authors>
              <fr:contributor>
                <fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link>
              </fr:contributor>
            </fr:authors>
            <fr:date>
              <fr:year>2025</fr:year>
              <fr:month>2</fr:month>
              <fr:day>28</fr:day>
            </fr:date>
            <fr:uri>https://forest.topos.site/ocl-0078/</fr:uri>
            <fr:display-uri>https://forest.topos.site/ocl-0078</fr:display-uri>
            <fr:route>/ocl-0078/</fr:route>
            <fr:title text="The meaning of “abstraction without semantic expansion”">The meaning of “abstraction without semantic expansion”</fr:title>
          </fr:frontmatter>
          <fr:mainmatter>
            <html:p>Category theory has been used as a semantic framework for programming languages, going at least back to <fr:link href="/lambek-1986-introduction/" title="Introduction to higher-order categorical logic" uri="https://forest.topos.site/lambek-1986-introduction/" display-uri="https://forest.topos.site/lambek-1986-introduction" type="local">Reference <fr:contextual-number uri="https://forest.topos.site/lambek-1986-introduction/" display-uri="https://forest.topos.site/lambek-1986-introduction" /></fr:link>, but possibly earlier (see the <fr:link href="https://ncatlab.org/nlab/show/computational+trilogy" type="external">nlab article on computational trilogy</fr:link>). The central idea of this is that certain classes of category support “internal languages” that can be used to compactly and efficiently reason about morphisms in that category. Most classically, the internal language of a cartesian closed category is simply typed lambda calculus.</html:p>
            <html:p>Often working in this internal language is far more efficient and convenient than working “externally” in a combinator style. For instance, building up morphisms in a cartesian closed category by just directly using the cartesian and closed structures (e.g., projections, evaluations, etc.) can be vastly more difficult and unintuitive than working with simply typed lambda calculus.</html:p>
            <html:p>In certain situations, the internal language of the type of category that one cares about is rich enough to support good abstraction features. For instance, in simply typed lambda calculus, one can produce “higher-order” functions like <html:code>map : (a -&gt; b) -&gt; List a -&gt; List b</html:code> which encapsulate a general pattern (iterating over a list to produce a new list) and allow the “inner” part of the iteration to be instantiated to many different functions by the user.</html:p>
            <html:p>However, in many situations this is <html:em>not</html:em> the case. For instance, if one is working in the category of finite-dimensional smooth manifolds (or an appropriate relaxation, like some appropriate subcategory of the opposite category of <fr:tex display="inline"><![CDATA[\mathbb {R}]]></fr:tex>-algebras, as discussed in <fr:link href="/nestruev-2020-smooth/" title="Smooth Manifolds and Observables" uri="https://forest.topos.site/nestruev-2020-smooth/" display-uri="https://forest.topos.site/nestruev-2020-smooth" type="local">Reference <fr:contextual-number uri="https://forest.topos.site/nestruev-2020-smooth/" display-uri="https://forest.topos.site/nestruev-2020-smooth" /></fr:link> or <fr:link href="/fritz-2024-differential/" title="Differential geometry and general relativity with algebraifolds" uri="https://forest.topos.site/fritz-2024-differential/" display-uri="https://forest.topos.site/fritz-2024-differential" type="local">Reference <fr:contextual-number uri="https://forest.topos.site/fritz-2024-differential/" display-uri="https://forest.topos.site/fritz-2024-differential" /></fr:link>), as the category of smooth manifolds has products, simple type theory without function types is an appropriate internal language. In fact, even dependent type theory (again, without function types) could be an appropriate internal language, which would allow the tangent bundle for a space <fr:tex display="inline"><![CDATA[X]]></fr:tex> to be expressed as <fr:tex display="inline"><![CDATA[T_X \colon  X \to  \mathsf {type}]]></fr:tex>. But the disallowal of function types is <html:em>important</html:em>, because one might want to, for instance, provide a meta-linguistic feature where for any type <fr:tex display="inline"><![CDATA[X]]></fr:tex>, any derivation of the judgment <fr:tex display="inline"><![CDATA[x \colon  X \,\vdash \, v(x) \colon  T_X(x)]]></fr:tex> can be plugged into an ordinary differential equation solver. Various features of a language (function types, but also if statements) can complicate this (by making types non-finite-dimensional, or destroying differentiability), so it is desirable to control their usage if the language is being used to write down vector fields.</html:p>
            <html:p>And even in the case of simply typed lambda calculus, while one may abstract over functions, one cannot abstract over types. One approach to this problem is to move to dependent type theory with a universe (ignoring inconsistency from size issues for the time being). However, that changes the semantics of the language; we now must carry around types at runtime. Instead, the standard solution is something like System F, which is not the internal language of any one single category (rather, it can be seen as the internal language of a bundle of categories of types fibered over a category of kinds).</html:p>
            <html:p>We propose that in general in the situation where the internal language of a class of categories is not rich enough for abstraction, the way to recover facilities for abstraction without compromising certain semantical properties is to move to a two-level type theory, where certain types used for abstraction only exist at “compile time”. This is the meaning of the slogan “abstraction without semantic expansion”.</html:p>
            <html:p>“Abstraction without semantic expansion” is by no means a novel idea. In programming languages, there is a principle of a <fr:link href="https://without.boats/blog/zero-cost-abstractions/" type="external">zero-cost abstraction</fr:link>, which is an abstraction that can be “compiled away” to achieve the same performance as code which did not use the abstraction and instead just manually repeated the same pattern with small variations in various places.</html:p>
            <fr:tree show-metadata="false">
              <fr:frontmatter>
                <fr:authors>
                  <fr:author>
                    <fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link>
                  </fr:author>
                </fr:authors>
                <fr:date>
                  <fr:year>2025</fr:year>
                  <fr:month>3</fr:month>
                  <fr:day>22</fr:day>
                </fr:date>
                <fr:uri>https://forest.topos.site/ocl-00C1/</fr:uri>
                <fr:display-uri>https://forest.topos.site/ocl-00C1</fr:display-uri>
                <fr:route>/ocl-00C1/</fr:route>
                <fr:title text="Function traits in Rust">Function traits in Rust</fr:title>
                <fr:taxon>example</fr:taxon>
              </fr:frontmatter>
              <fr:mainmatter>
                <html:p>Rust does not have function types. Instead, it has a <html:code>Fn</html:code> trait, which could be used like</html:p>
                <html:pre><![CDATA[fn map<A, B, F: Fn(&A) -> B>(xs: Vec<A>) -> Vec<B> {
    let out: Vec<B> = Vec::new();
    for x in xs.iter() {
        out.push(f(x));
    }
    out
}]]></html:pre>
                <html:p>When <html:code>map</html:code> is used, Rust is able to at compile time see which implementation of the <html:code>Fn</html:code> trait will be used, and this enables the code</html:p>
                <html:pre><![CDATA[map(|x| x + 1, vec![1,2,3])]]></html:pre>
                <html:p>to be compiled to</html:p>
                <html:pre><![CDATA[let xs = vec![1,2,3];
let out: Vec<usize> = Vec::new();
for x in xs.iter() {
    out.push(x + 1);
}
out]]></html:pre>
                <html:p>which does not require the function <html:code>|x| x + 1</html:code> to exist at runtime.</html:p>
              </fr:mainmatter>
            </fr:tree>
            <html:p>Another instantiation of abstraction without semantic expansion is the use of “embedded domain specific languages” in functional programming. The idea embedded domain specific language is to implement a domain specific language as a library in a more powerful language, essentially using the more powerful language to manipulate the syntax of the domain specific language. The advantage of an embedded domain specific language is that the host language can be used for metaprogramming.</html:p>
            <html:p>One perspective on two-level type theory is that it is a way of designing a host language and embedded language simultaneously, so that the compiler may be aware of more features in the embedded language than would be possible in general.</html:p>
          </fr:mainmatter>
        </fr:tree>
        <fr:tree show-metadata="false">
          <fr:frontmatter>
            <fr:authors />
            <fr:date>
              <fr:year>2025</fr:year>
              <fr:month>2</fr:month>
              <fr:day>28</fr:day>
            </fr:date>
            <fr:uri>https://forest.topos.site/ocl-007A/</fr:uri>
            <fr:display-uri>https://forest.topos.site/ocl-007A</fr:display-uri>
            <fr:route>/ocl-007A/</fr:route>
            <fr:title text="Overview">Overview</fr:title>
          </fr:frontmatter>
          <fr:mainmatter>
            <html:p>In this paper, we present a two-level type theory called <fr:link href="https://github.com/ToposInstitute/emtt" type="external">EMTT</fr:link> (Element Model Type Theory) which follows the principle of “abstraction without semantic expansion” in allowing the user to abstract over finite limit theories without adding function or universe types to the finite limit theories themselves.</html:p>
            <html:p>Specifically, the outer-level types in EMTT correspond to finite limit theories, and their outer-level terms are the models of those finite limit theories. The inner-level types are types internal to a finite limit theory, and the inner-level terms are the elements of those types.</html:p>
            <html:p>EMTT is an interesting type theory with a variety of applications. First of all, EMTT can be used for equational reasoning in universal algebra, using e-graphs in conversion checking to do a limited form of derivation reconstruction for extensional equalities. EMTT can also be used to construct finitely-presented models of theories in a compositional manner, including the theories used in <fr:link href="https://github.com/ToposInstitute/CatColab" type="external">CatColab</fr:link>.</html:p>
            <html:p>However, we are also interested in EMTT as a stepping stone in a larger research program of investigating how two-level type theory may be used to realize abstraction without semantic expansion. Thus, our exposition of EMTT emphasizes how choices we made at various points in the design could be made in different ways, and the resulting type theory would likely be similarly interesting. In other words, we aim to make type theory feel less like an ad-hoc collection of rules, and more like a “garden of forking paths”.</html:p>
            <html:p>The paper is structured in the following way. We begin in <fr:link href="/ocl-0070/" title="A review of categorical algebra" uri="https://forest.topos.site/ocl-0070/" display-uri="https://forest.topos.site/ocl-0070" type="local">§ <fr:contextual-number uri="https://forest.topos.site/ocl-0070/" display-uri="https://forest.topos.site/ocl-0070" /></fr:link> with a review of categorical algebra. This is because essential to our exposition of the “garden of forking paths” is the concept of an <fr:tex display="inline"><![CDATA[n]]></fr:tex>-theory, the origins of which are found in categorical algebra.</html:p>
            <html:p>We then move on in <fr:link href="/ocl-0075/" title="Type theory as organized into 3-theories" uri="https://forest.topos.site/ocl-0075/" display-uri="https://forest.topos.site/ocl-0075" type="local">§ <fr:contextual-number uri="https://forest.topos.site/ocl-0075/" display-uri="https://forest.topos.site/ocl-0075" /></fr:link> to an exposition of type theory from the <fr:tex display="inline"><![CDATA[n]]></fr:tex>-theory point of view. Specifically, we treat the 3-theories of simple type theory, dependent type theory, and two-level type theory. The 3-theory of two-level type theory is the most interesting 3-theory for us, and this is the place where the “garden of forking paths” is most apparent, as constructs from regular dependent type theory may be imported into the two-level setting in a multitude of ways.</html:p>
            <html:p><fr:link href="/ocl-0076/" title="EMTT: an implementation of finite limit theories" uri="https://forest.topos.site/ocl-0076/" display-uri="https://forest.topos.site/ocl-0076" type="local">§ <fr:contextual-number uri="https://forest.topos.site/ocl-0076/" display-uri="https://forest.topos.site/ocl-0076" /></fr:link> is the place in which we discuss EMTT, which is the main original contribution of this paper. The impatient reader may wish to skip to <fr:link href="/ocl-007I/" title="An introduction to EMTT by examples" uri="https://forest.topos.site/ocl-007I/" display-uri="https://forest.topos.site/ocl-007I" type="local">§ <fr:contextual-number uri="https://forest.topos.site/ocl-007I/" display-uri="https://forest.topos.site/ocl-007I" /></fr:link>, which introduces EMTT by code examples. We then give the rules <fr:link href="/ocl-007J/" title="Type theory of EMTT" uri="https://forest.topos.site/ocl-007J/" display-uri="https://forest.topos.site/ocl-007J" type="local">§ <fr:contextual-number uri="https://forest.topos.site/ocl-007J/" display-uri="https://forest.topos.site/ocl-007J" /></fr:link>, semantics <fr:link href="/ocl-00BG/" title="A model for EMTT in lex categories" uri="https://forest.topos.site/ocl-00BG/" display-uri="https://forest.topos.site/ocl-00BG" type="local">§ <fr:contextual-number uri="https://forest.topos.site/ocl-00BG/" display-uri="https://forest.topos.site/ocl-00BG" /></fr:link>, and some implementation details <fr:link href="/ocl-007H/" title="Adapting Coquand's algorithm to the two-level setting" uri="https://forest.topos.site/ocl-007H/" display-uri="https://forest.topos.site/ocl-007H" type="local">§ <fr:contextual-number uri="https://forest.topos.site/ocl-007H/" display-uri="https://forest.topos.site/ocl-007H" /></fr:link>, <fr:link href="/ocl-007G/" title="Integrating e-graphs into normalization-by-evaluation" uri="https://forest.topos.site/ocl-007G/" display-uri="https://forest.topos.site/ocl-007G" type="local">§ <fr:contextual-number uri="https://forest.topos.site/ocl-007G/" display-uri="https://forest.topos.site/ocl-007G" /></fr:link>.</html:p>
            <html:p>Finally, we have an extensive “future work” section in <fr:link href="/ocl-0077/" title="Directions for future research" uri="https://forest.topos.site/ocl-0077/" display-uri="https://forest.topos.site/ocl-0077" type="local">§ <fr:contextual-number uri="https://forest.topos.site/ocl-0077/" display-uri="https://forest.topos.site/ocl-0077" /></fr:link>. EMTT is just the beginning of our studies of two-level type theory, and we have a number of projects which we plan to turn our attention to next. This current paper might be best understood as a “work in progress” report, which was necessary to understand the prototype EMTT implementation, but as it stands the EMTT implementation is more of an interesting toy and not directly applicable to many of the problems that it aims to solve. For instance, the only type one can write down in the empty context is the unit type; we have joked that EMTT should be pronounced “empty-tee”. <fr:link href="/ocl-0077/" title="Directions for future research" uri="https://forest.topos.site/ocl-0077/" display-uri="https://forest.topos.site/ocl-0077" type="local">§ <fr:contextual-number uri="https://forest.topos.site/ocl-0077/" display-uri="https://forest.topos.site/ocl-0077" /></fr:link> sketches out plans for how to build on top of EMTT for interesting applications.</html:p>
          </fr:mainmatter>
        </fr:tree>
        <fr:tree show-metadata="false">
          <fr:frontmatter>
            <fr:authors>
              <fr:author>
                <fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link>
              </fr:author>
            </fr:authors>
            <fr:date>
              <fr:year>2025</fr:year>
              <fr:month>3</fr:month>
              <fr:day>24</fr:day>
            </fr:date>
            <fr:uri>https://forest.topos.site/ocl-00CD/</fr:uri>
            <fr:display-uri>https://forest.topos.site/ocl-00CD</fr:display-uri>
            <fr:route>/ocl-00CD/</fr:route>
            <fr:title text="Related work">Related work</fr:title>
          </fr:frontmatter>
          <fr:mainmatter>
            <html:p>In some ways, it might be easier to write an “unrelated work” section, as this paper is explicitly intended to tie together a wide variety of research themes.</html:p>
            <html:p>However, there is a core to this paper, which is the development of a type theory for finite limit theories, and accordingly in this section we will focus more narrowly on work related to to this type theory.</html:p>
            <html:p>Element Model Type Theory would not exist if it were not for the year and a half that the main author spent working on GATlab <fr:link href="/lynch-2024-gatlab/" title="GATlab: Modeling and Programming with Generalized Algebraic Theories" uri="https://forest.topos.site/lynch-2024-gatlab/" display-uri="https://forest.topos.site/lynch-2024-gatlab" type="local">Reference <fr:contextual-number uri="https://forest.topos.site/lynch-2024-gatlab/" display-uri="https://forest.topos.site/lynch-2024-gatlab" /></fr:link>. In the introduction to the GATlab paper, we endeavored to give a reasonably broad overview of the history of algebraic theories and their software implementations. However, there were some developments which we either missed or were not around at the time of writing that paper.</html:p>
            <html:p>One such development is Kammar and Wright's <fr:link href="https://github.com/madman-bob/semantic-reflection" type="external">semantic reflection</fr:link> library, with accompanying extended abstract <fr:link href="/kammar-2024-firstclass/" title="First-class Algebraic Presentations with Elaborator Reflection" uri="https://forest.topos.site/kammar-2024-firstclass/" display-uri="https://forest.topos.site/kammar-2024-firstclass" type="local">Reference <fr:contextual-number uri="https://forest.topos.site/kammar-2024-firstclass/" display-uri="https://forest.topos.site/kammar-2024-firstclass" /></fr:link>. This works with algebraic theories as a deeply-embedded DSL within Idris 2, by extending the Idris 2 elaborator.</html:p>
            <html:p>This is an approach to two-level type theory which takes as the outer level a full dependent type theory. This is quite convenient, because one can do many things with full dependent type theory that one cannot do in EMTT. However, the outer level types in EMTT can all be interpreted as finite limit theories, which is not true of Idris types. What EMTT gives up for this is the ability to play nicely with the wide variety of other mathematics formalized in Idris, and we imagine that elaborator reflection is significantly easier to implement than writing an elaborator from scratch.</html:p>
            <html:p>Related to the above is the <fr:link href="https://www.cl.cam.ac.uk/~jdy22/projects/frex/" type="external">Frex</fr:link> project, which integrates reasoning over algebraic theories into dependently-typed programming languages. In contrast to EMTT, frex emphasizes the development of normal-form computations for specific algebraic theories, and like the semantic-reflection library frex integrates into pre-existing programming languages rather than using a programming language written from scratch. This supports a much more predictable style of programming with algebraic theories, where equations like <fr:tex display="inline"><![CDATA[x + 0 = x]]></fr:tex> are automatically handled without the user needing to explicitly cite axioms as in EMTT.</html:p>
            <html:p>For some intended applications of EMTT (for instance, as the backing type theory of <fr:link href="https://github.com/ToposInstitute/CatColab" type="external">CatColab</fr:link>), it is not desirable to integrate with a full dependent programming language like Idris or Agda. However, taking a normal-form approach to rewriting rather than an e-graph approach is attractive for computer algebra applications, and so we hope to integrate more with the ideas behind frex in the future.</html:p>
            <html:p>Another software which takes very seriously the concept of 2-theories is the <fr:link href="https://github.com/homalg-project/CAP_project" type="external">CAP project</fr:link>, (Categories, Algorithms, and Programming) which is a quite advanced computer algebra system whose core is given by 2-adjunctions between various 2-categories that allow constructions to be done in great generality. One contrast between EMTT and CAP is that when CAP considers free (rings/modules/etc.), it takes as its set of variables a collection of strings. In contrast, EMTT's use of dependent records as presentations for free algebraic structure naturally supports namespacing, like <html:code>a.x</html:code>, <html:code>a.y</html:code>, <html:code>b.q.y</html:code>, which we consider to be essential for compositional systems theory.</html:p>
            <html:p>There are likely other projects that we have missed; we encourage the reader to send references and we will update this section accordingly.</html:p>
          </fr:mainmatter>
        </fr:tree>
      </fr:mainmatter>
    </fr:tree>
    <fr:tree show-metadata="false">
      <fr:frontmatter>
        <fr:authors>
          <fr:contributor>
            <fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link>
          </fr:contributor>
        </fr:authors>
        <fr:date>
          <fr:year>2025</fr:year>
          <fr:month>2</fr:month>
          <fr:day>28</fr:day>
        </fr:date>
        <fr:uri>https://forest.topos.site/ocl-0070/</fr:uri>
        <fr:display-uri>https://forest.topos.site/ocl-0070</fr:display-uri>
        <fr:route>/ocl-0070/</fr:route>
        <fr:title text="A review of categorical algebra">A review of categorical algebra</fr:title>
      </fr:frontmatter>
      <fr:mainmatter>
        <html:p>In <fr:link href="/ocl-0075/" title="Type theory as organized into 3-theories" uri="https://forest.topos.site/ocl-0075/" display-uri="https://forest.topos.site/ocl-0075" type="local">§ <fr:contextual-number uri="https://forest.topos.site/ocl-0075/" display-uri="https://forest.topos.site/ocl-0075" /></fr:link>, we give a review of type theory from the perspective of <fr:tex display="inline"><![CDATA[n]]></fr:tex>-theories. In this section, we give a brief overview of the history of the idea of <fr:tex display="inline"><![CDATA[n]]></fr:tex>-theories, focusing on a few specific examples.</html:p>
        <fr:tree show-metadata="false">
          <fr:frontmatter>
            <fr:authors>
              <fr:contributor>
                <fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link>
              </fr:contributor>
            </fr:authors>
            <fr:date>
              <fr:year>2025</fr:year>
              <fr:month>2</fr:month>
              <fr:day>28</fr:day>
            </fr:date>
            <fr:uri>https://forest.topos.site/ocl-007B/</fr:uri>
            <fr:display-uri>https://forest.topos.site/ocl-007B</fr:display-uri>
            <fr:route>/ocl-007B/</fr:route>
            <fr:title text="Finite product theories">Finite product theories</fr:title>
          </fr:frontmatter>
          <fr:mainmatter>
            <html:p>For an overview of the history of finite product theories, we refer the reader to section 1.2 of <fr:link href="/lynch-2024-gatlab/" title="GATlab: Modeling and Programming with Generalized Algebraic Theories" uri="https://forest.topos.site/lynch-2024-gatlab/" display-uri="https://forest.topos.site/lynch-2024-gatlab" type="local">Reference <fr:contextual-number uri="https://forest.topos.site/lynch-2024-gatlab/" display-uri="https://forest.topos.site/lynch-2024-gatlab" /></fr:link>.</html:p>
            <html:p>The modern (starting with <fr:link href="/lawvere-1963-functorial/" title="Functorial Semantics of Algebraic Theories and Some Algebraic Problems in the context of Functorial Semantics of Algebraic Theories" uri="https://forest.topos.site/lawvere-1963-functorial/" display-uri="https://forest.topos.site/lawvere-1963-functorial" type="local">Reference <fr:contextual-number uri="https://forest.topos.site/lawvere-1963-functorial/" display-uri="https://forest.topos.site/lawvere-1963-functorial" /></fr:link>) treatment of finite product theories starts with the following definition.</html:p>
            <fr:tree show-metadata="false">
              <fr:frontmatter>
                <fr:authors>
                  <fr:author>
                    <fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link>
                  </fr:author>
                </fr:authors>
                <fr:date>
                  <fr:year>2025</fr:year>
                  <fr:month>3</fr:month>
                  <fr:day>22</fr:day>
                </fr:date>
                <fr:uri>https://forest.topos.site/ocl-00C2/</fr:uri>
                <fr:display-uri>https://forest.topos.site/ocl-00C2</fr:display-uri>
                <fr:route>/ocl-00C2/</fr:route>
                <fr:title text="Finite Product Theory">Finite Product Theory</fr:title>
                <fr:taxon>definition</fr:taxon>
              </fr:frontmatter>
              <fr:mainmatter>
                <html:p>An <html:strong>finite product theory</html:strong> is a category <fr:tex display="inline"><![CDATA[\mathsf {T}]]></fr:tex> with finite products and an identity-on-objects, finite-product-preserving functor <fr:tex display="inline"><![CDATA[\mathsf {Finset}^{\mathsf {op}} \to  \mathsf {T}]]></fr:tex>.</html:p>
                <html:p>The category of finite product theories <fr:tex display="inline"><![CDATA[\mathsf {FinProdTh}]]></fr:tex> is given by the subcategory of <fr:tex display="inline"><![CDATA[\mathsf {Finset}^{\mathsf {op}} \downarrow  \mathsf {FinProdCat}]]></fr:tex> on the identity-on-objects functors.</html:p>
              </fr:mainmatter>
            </fr:tree>
            <html:p>This definition is equivalent to the more common definition (an finite product theory is a finite product category whose objects are freely generated by a single object), but is slightly more precise about what “objects being freely generated” means. That is, <fr:tex display="inline"><![CDATA[\mathsf {Finset}^{\mathsf {op}}]]></fr:tex> is the free finite product category on a single object, so a category with a product-preserving, identity-on-objects functor from <fr:tex display="inline"><![CDATA[\mathsf {Finset}^{\mathsf {op}}]]></fr:tex> can be said “to have its objects freely generated by a single object”.</html:p>
            <fr:tree show-metadata="false">
              <fr:frontmatter>
                <fr:authors>
                  <fr:author>
                    <fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link>
                  </fr:author>
                </fr:authors>
                <fr:date>
                  <fr:year>2025</fr:year>
                  <fr:month>3</fr:month>
                  <fr:day>22</fr:day>
                </fr:date>
                <fr:uri>https://forest.topos.site/ocl-00C4/</fr:uri>
                <fr:display-uri>https://forest.topos.site/ocl-00C4</fr:display-uri>
                <fr:route>/ocl-00C4/</fr:route>
                <fr:title text="Model of an finite product theory">Model of an finite product theory</fr:title>
                <fr:taxon>definition</fr:taxon>
              </fr:frontmatter>
              <fr:mainmatter>
                <html:p>A model <fr:tex display="inline"><![CDATA[M]]></fr:tex> of an finite product theory <fr:tex display="inline"><![CDATA[\mathsf {T}]]></fr:tex> is a finite-product-preserving functor <fr:tex display="inline"><![CDATA[\mathsf {T} \to  \mathsf {Set}]]></fr:tex>. Let <fr:tex display="inline"><![CDATA[\mathsf {Mod}(T)]]></fr:tex> be the category of models of <fr:tex display="inline"><![CDATA[M]]></fr:tex>, with natural transformations as morphisms.</html:p>
              </fr:mainmatter>
            </fr:tree>
            <html:p>It is somewhat tricky to write down finite product theories directly without some means of “presenting” them, but at least the theory of monoids is not too hard to describe. First, we review the definition of a monoid.</html:p>
            <fr:tree show-metadata="false">
              <fr:frontmatter>
                <fr:authors>
                  <fr:author>
                    <fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link>
                  </fr:author>
                </fr:authors>
                <fr:date>
                  <fr:year>2025</fr:year>
                  <fr:month>3</fr:month>
                  <fr:day>22</fr:day>
                </fr:date>
                <fr:uri>https://forest.topos.site/ocl-00C5/</fr:uri>
                <fr:display-uri>https://forest.topos.site/ocl-00C5</fr:display-uri>
                <fr:route>/ocl-00C5/</fr:route>
                <fr:title text="Monoid">Monoid</fr:title>
                <fr:taxon>definition</fr:taxon>
              </fr:frontmatter>
              <fr:mainmatter>
                <html:p>A monoid is a set <fr:tex display="inline"><![CDATA[X]]></fr:tex> equipped with a function <fr:tex display="inline"><![CDATA[m \colon  X \times  X \to  X]]></fr:tex> and an element <fr:tex display="inline"><![CDATA[e \colon  X]]></fr:tex>, such that</html:p>
                <html:ul><html:li>For all <fr:tex display="inline"><![CDATA[x,y,z \colon  X]]></fr:tex>, <fr:tex display="inline"><![CDATA[m(x, m(y, z)) = m(m(x, y), z)]]></fr:tex></html:li>
  <html:li>For all <fr:tex display="inline"><![CDATA[x \colon  X]]></fr:tex>, <fr:tex display="inline"><![CDATA[x = m(x, e) = m(e, x)]]></fr:tex></html:li></html:ul>
              </fr:mainmatter>
            </fr:tree>
            <fr:tree show-metadata="false">
              <fr:frontmatter>
                <fr:authors>
                  <fr:author>
                    <fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link>
                  </fr:author>
                </fr:authors>
                <fr:date>
                  <fr:year>2025</fr:year>
                  <fr:month>3</fr:month>
                  <fr:day>22</fr:day>
                </fr:date>
                <fr:uri>https://forest.topos.site/ocl-00C3/</fr:uri>
                <fr:display-uri>https://forest.topos.site/ocl-00C3</fr:display-uri>
                <fr:route>/ocl-00C3/</fr:route>
                <fr:title text="The finite product theory of monoids">The finite product theory of monoids</fr:title>
                <fr:taxon>example</fr:taxon>
              </fr:frontmatter>
              <fr:mainmatter>
                <html:p>Let <fr:tex display="inline"><![CDATA[\mathbf {List} \colon  \mathsf {Set} \to  \mathsf {Set}]]></fr:tex> be the functor sending a set <fr:tex display="inline"><![CDATA[X]]></fr:tex> to the set <fr:tex display="inline"><![CDATA[\sum _{n \in  \mathbb {N}} X^N]]></fr:tex> of lists with elements taken from <fr:tex display="inline"><![CDATA[X]]></fr:tex>. Then <fr:tex display="inline"><![CDATA[\mathbf {List}]]></fr:tex> is a monad on <fr:tex display="inline"><![CDATA[\mathsf {Set}]]></fr:tex>, so we may form its Kleisli category <fr:tex display="inline"><![CDATA[\mathsf {kl}(\mathbf {List})]]></fr:tex>, and let <fr:tex display="inline"><![CDATA[\mathsf {ThMon}]]></fr:tex> be the full subcategory of <fr:tex display="inline"><![CDATA[\mathsf {kl}(\mathbf {List})^{\mathsf {op}}]]></fr:tex> on finite sets. By general arguments, <fr:tex display="inline"><![CDATA[\mathsf {kl}(\mathbf {List})]]></fr:tex> has finite coproducts, so thus <fr:tex display="inline"><![CDATA[\mathsf {ThMon}]]></fr:tex> is a finite product category with an identity-on-objects functor from <fr:tex display="inline"><![CDATA[\mathsf {Finset}^{\mathsf {op}}]]></fr:tex>, e.g. an finite product theory.</html:p>
                <html:p>This category has two important morphisms. One is the morphism <fr:tex display="inline"><![CDATA[m \colon  \{0,1\} \to  \{0\}]]></fr:tex> that sends <fr:tex display="inline"><![CDATA[0]]></fr:tex> to <fr:tex display="inline"><![CDATA[[0, 1] \colon  \mathbf {List}(\{0,1\})]]></fr:tex>, and the other is the morphism <fr:tex display="inline"><![CDATA[e \colon  \{\} \to  \{0\}]]></fr:tex> that sends <fr:tex display="inline"><![CDATA[0]]></fr:tex> to <fr:tex display="inline"><![CDATA[[] \colon  \mathbf {List}(\{\})]]></fr:tex>.</html:p>
                <html:p>These morphisms represent “multiplication” and “the identity”. Specifically, in a model <fr:tex display="inline"><![CDATA[M \colon  \mathsf {ThMon} \to  \mathsf {Set}]]></fr:tex>, then we have:</html:p>
                <html:ul><html:li><fr:tex display="inline"><![CDATA[M(m) \colon  (M(\{0, 1\}) = M(\{0\})^2) \to  M(\{0\})]]></fr:tex></html:li>
  <html:li><fr:tex display="inline"><![CDATA[M(e) \colon  (M(\{\}) = 1) \to  M(\{0\})]]></fr:tex></html:li></html:ul>
                <html:p>And then one can check that associativity and unitality are satisfied using the definitions of product and composition in <fr:tex display="inline"><![CDATA[\mathsf {ThMon}]]></fr:tex>.</html:p>
              </fr:mainmatter>
            </fr:tree>
            <html:p>A signature feature of Lawvere's development of finite product theories is a pervasive use of adjoint functors. For instance, the following.</html:p>
            <fr:tree show-metadata="false">
              <fr:frontmatter>
                <fr:authors>
                  <fr:author>
                    <fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link>
                  </fr:author>
                </fr:authors>
                <fr:date>
                  <fr:year>2025</fr:year>
                  <fr:month>3</fr:month>
                  <fr:day>23</fr:day>
                </fr:date>
                <fr:uri>https://forest.topos.site/ocl-00C6/</fr:uri>
                <fr:display-uri>https://forest.topos.site/ocl-00C6</fr:display-uri>
                <fr:route>/ocl-00C6/</fr:route>
                <fr:title text="The free-forgetful adjunction for a finite product theory">The free-forgetful adjunction for a finite product theory</fr:title>
                <fr:taxon>definition</fr:taxon>
              </fr:frontmatter>
              <fr:mainmatter><html:p>Given any finite product theory <fr:tex display="inline"><![CDATA[\mathsf {T}]]></fr:tex>, there is always an adjunction</html:p>



<html:figure><fr:resource hash="f07e7da67e55c965cf2e52298e0464a1"><fr:resource-content><html:img src="https://forest.topos.site/f07e7da67e55c965cf2e52298e0464a1.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[

\usepackage[utf8]{inputenc}
\DeclareFontFamily{U}{min}{}
\DeclareFontShape{U}{min}{m}{n}{<-> udmj30}{}
\newcommand\yo{\!\text{\usefont{U}{min}{m}{n}\symbol{'207}}\!}
\DeclareUnicodeCharacter{3088}{\yo}


\usepackage{tikz, tikz-cd, mathtools, amssymb, stmaryrd,xcolor}
\usetikzlibrary{matrix,arrows}
\usetikzlibrary{backgrounds,fit,positioning,calc,shapes}
\usetikzlibrary{decorations.pathreplacing}
\usetikzlibrary{decorations.pathmorphing}
\usetikzlibrary{decorations.markings}

% `tikz-cd` is necessary to draw commutative diagrams.
\RequirePackage{tikz-cd}
% `amssymb` is necessary for `\lrcorner` and `\ulcorner`.
\RequirePackage{amssymb}
% `calc` is necessary to draw curved arrows.
\usetikzlibrary{calc}
% `pathmorphing` is necessary to draw squiggly arrows.
\usetikzlibrary{decorations.pathmorphing}
% `spath3` is necessary to draw shortened edges.
\usetikzlibrary{spath3}

% A TikZ style for curved arrows of a fixed height, due to AndréC.
\tikzset{curve/.style={settings={#1},to path={(\tikztostart)
    .. controls ($(\tikztostart)!\pv{pos}!(\tikztotarget)!\pv{height}!270:(\tikztotarget)$)
    and ($(\tikztostart)!1-\pv{pos}!(\tikztotarget)!\pv{height}!270:(\tikztotarget)$)
    .. (\tikztotarget)\tikztonodes}},
    settings/.code={\tikzset{quiver/.cd,#1}
        \def\pv##1{\pgfkeysvalueof{/tikz/quiver/##1}}},
    quiver/.cd,pos/.initial=0.35,height/.initial=0}

% A TikZ style for shortening paths without the poor behaviour of `shorten <' and `shorten >'.
\tikzset{between/.style n args={2}{/tikz/spath/at end path construction={
    \tikzset{spath/split at keep middle={current}{#1}{#2}}
}}}

% TikZ arrowhead/tail styles.
\tikzset{tail reversed/.code={\pgfsetarrowsstart{tikzcd to}}}
\tikzset{2tail/.code={\pgfsetarrowsstart{Implies[reversed]}}}
\tikzset{2tail reversed/.code={\pgfsetarrowsstart{Implies}}}
% TikZ arrow styles.
\tikzset{no body/.style={/tikz/dash pattern=on 0 off 1mm}}


\newcommand{\triplecolon}{%
  \mathrel{\vbox{\baselineskip=2pt \hbox{.}\hbox{.}\hbox{.}}}%
}

\DeclareUnicodeCharacter{2AF6}{\triplecolon}
\usepackage{mathpartir}

]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[
\begin {tikzcd}
	{\mathsf {Mod}(\mathsf {T})} & {\mathsf {Set}}
	\arrow [""{name=0, anchor=center, inner sep=0}, "F", shift left=2, from=1-1, to=1-2]
	\arrow [""{name=1, anchor=center, inner sep=0}, "U", shift left=2, from=1-2, to=1-1]
	\arrow ["\dashv "{anchor=center, rotate=-90}, draw=none, from=0, to=1]
\end {tikzcd}
]]></fr:resource-source></fr:resource></html:figure>

<html:p>between the category of models of <fr:tex display="inline"><![CDATA[\mathsf {T}]]></fr:tex> and <fr:tex display="inline"><![CDATA[\mathsf {Set}]]></fr:tex>, where <fr:tex display="inline"><![CDATA[U \colon  \mathsf {Mod}(\mathsf {T}) \to  \mathsf {Set}]]></fr:tex> is induced by precomposition with <fr:tex display="inline"><![CDATA[\mathsf {Finset}^{\mathsf {op}} \to  \mathsf {T}]]></fr:tex> and the equivalence between <fr:tex display="inline"><![CDATA[\mathsf {Set}]]></fr:tex> and the category of finite-product-preserving functors <fr:tex display="inline"><![CDATA[\mathsf {Finset}^{\mathsf {op}} \to  \mathsf {Set}]]></fr:tex>.</html:p><html:p>More concretely, <fr:tex display="inline"><![CDATA[U(M) = M(\{0\})]]></fr:tex>.</html:p><html:p>The left adjoint may be shown to exist by either left Kan extension or the adjoint functor theorem (after proving that <fr:tex display="inline"><![CDATA[U]]></fr:tex> preserves limits).</html:p><html:p>Intuitively, the left adjoint sends a set <fr:tex display="inline"><![CDATA[X]]></fr:tex> to the “free model of <fr:tex display="inline"><![CDATA[\mathsf {T}]]></fr:tex> with generators taken from <fr:tex display="inline"><![CDATA[X]]></fr:tex>”.</html:p></fr:mainmatter>
            </fr:tree>
            <html:p>And it turns out that this adjunction is always <html:em>monadic</html:em>, so that the category of models for <fr:tex display="inline"><![CDATA[\mathsf {T}]]></fr:tex> is equivalent to the category of algebras for the monad <fr:tex display="inline"><![CDATA[UF]]></fr:tex>.</html:p>
            <html:p>We can go the other way too, which was hinted at in <fr:link href="/ocl-00C3/" title="The finite product theory of monoids" uri="https://forest.topos.site/ocl-00C3/" display-uri="https://forest.topos.site/ocl-00C3" type="local">example <fr:contextual-number uri="https://forest.topos.site/ocl-00C3/" display-uri="https://forest.topos.site/ocl-00C3" /></fr:link>. If we start with a <html:em>finitary</html:em> monad <fr:tex display="inline"><![CDATA[T \colon  \mathsf {Set} \to  \mathsf {Set}]]></fr:tex> (finitary meaning that it preserves filtered colimits), then the category of algebras for <fr:tex display="inline"><![CDATA[T]]></fr:tex> is equivalent to the category of models of the finite product theory given by <fr:tex display="inline"><![CDATA[\mathsf {kl}(T)^{\mathsf {op}}]]></fr:tex> restricted to finite sets.</html:p>
            <html:p>But how are we to define a finite product theory without starting from an explicit description of the monad like in <fr:link href="/ocl-00C3/" title="The finite product theory of monoids" uri="https://forest.topos.site/ocl-00C3/" display-uri="https://forest.topos.site/ocl-00C3" type="local">example <fr:contextual-number uri="https://forest.topos.site/ocl-00C3/" display-uri="https://forest.topos.site/ocl-00C3" /></fr:link>? The answer is more adjunctions.</html:p>
            <fr:tree show-metadata="false">
              <fr:frontmatter>
                <fr:authors>
                  <fr:author>
                    <fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link>
                  </fr:author>
                </fr:authors>
                <fr:date>
                  <fr:year>2025</fr:year>
                  <fr:month>3</fr:month>
                  <fr:day>23</fr:day>
                </fr:date>
                <fr:uri>https://forest.topos.site/ocl-00C7/</fr:uri>
                <fr:display-uri>https://forest.topos.site/ocl-00C7</fr:display-uri>
                <fr:route>/ocl-00C7/</fr:route>
                <fr:title text="Free finite product theory on a signature">Free finite product theory on a signature</fr:title>
                <fr:taxon>definition</fr:taxon>
              </fr:frontmatter>
              <fr:mainmatter>
                <html:p>A <html:strong>signature</html:strong> consists of a collection <fr:tex display="inline"><![CDATA[S = \{O_n\}_{n \colon  \mathbb {N}}]]></fr:tex> of sets for each natural number <fr:tex display="inline"><![CDATA[n]]></fr:tex>. We call <fr:tex display="inline"><![CDATA[O_n]]></fr:tex> <html:strong>the operations of arity <fr:tex display="inline"><![CDATA[n]]></fr:tex></html:strong>. The category <fr:tex display="inline"><![CDATA[\mathsf {Sig}]]></fr:tex> of signatures is given by <fr:tex display="inline"><![CDATA[\mathsf {Set}^\mathbb {N}]]></fr:tex>.</html:p>
                <html:p>Then there is a forgetful functor <fr:tex display="inline"><![CDATA[U]]></fr:tex> from <fr:tex display="inline"><![CDATA[\mathsf {FinProdTh}]]></fr:tex> to <fr:tex display="inline"><![CDATA[\mathsf {Sig}]]></fr:tex>, which sends a finite product theory <fr:tex display="inline"><![CDATA[\mathsf {T}]]></fr:tex> to <fr:tex display="inline"><![CDATA[\{\mathsf {T}(\{0,\ldots ,n-1\}, \{0\})\}_{n \colon  \mathbb {N}}]]></fr:tex>.</html:p>
                <html:p>This forgetful functor has a left adjoint <fr:tex display="inline"><![CDATA[F]]></fr:tex>, and we call <fr:tex display="inline"><![CDATA[F(S)]]></fr:tex> the free finite product theory on a signature <fr:tex display="inline"><![CDATA[S]]></fr:tex>.</html:p>
              </fr:mainmatter>
            </fr:tree>
            <fr:tree show-metadata="false">
              <fr:frontmatter>
                <fr:authors>
                  <fr:author>
                    <fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link>
                  </fr:author>
                </fr:authors>
                <fr:date>
                  <fr:year>2025</fr:year>
                  <fr:month>3</fr:month>
                  <fr:day>23</fr:day>
                </fr:date>
                <fr:uri>https://forest.topos.site/ocl-00C8/</fr:uri>
                <fr:display-uri>https://forest.topos.site/ocl-00C8</fr:display-uri>
                <fr:route>/ocl-00C8/</fr:route>
                <fr:title text="The signature for monoids">The signature for monoids</fr:title>
                <fr:taxon>example</fr:taxon>
              </fr:frontmatter>
              <fr:mainmatter>
                <html:p>The signature for monoids is given by <fr:tex display="inline"><![CDATA[O_0 = \{e\}]]></fr:tex>, <fr:tex display="inline"><![CDATA[O_2 = \{m\}]]></fr:tex>, and <fr:tex display="inline"><![CDATA[O_i = \emptyset ]]></fr:tex> for <fr:tex display="inline"><![CDATA[i \neq  0,2]]></fr:tex>.</html:p>
                <html:p>The free finite product theory on this signature may be called the “theory of a pointed magma”; models for this are given by sets <fr:tex display="inline"><![CDATA[X]]></fr:tex> with a binary operation <fr:tex display="inline"><![CDATA[X \times  X \to  X]]></fr:tex> and a nullary operation <fr:tex display="inline"><![CDATA[1 \to  X]]></fr:tex>, but no laws.</html:p>
              </fr:mainmatter>
            </fr:tree>
            <html:p>To produce a general finite product theory, we then ask for certain pairs of parallel morphisms in <fr:tex display="inline"><![CDATA[F(S)]]></fr:tex> to be identified; this allows us to impose laws like associativity and unitality on our finite product theories.</html:p>
            <fr:tree show-metadata="false">
              <fr:frontmatter>
                <fr:authors>
                  <fr:author>
                    <fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link>
                  </fr:author>
                </fr:authors>
                <fr:date>
                  <fr:year>2025</fr:year>
                  <fr:month>3</fr:month>
                  <fr:day>23</fr:day>
                </fr:date>
                <fr:uri>https://forest.topos.site/ocl-00C9/</fr:uri>
                <fr:display-uri>https://forest.topos.site/ocl-00C9</fr:display-uri>
                <fr:route>/ocl-00C9/</fr:route>
                <fr:title text="Presented finite product theory">Presented finite product theory</fr:title>
                <fr:taxon>definition</fr:taxon>
              </fr:frontmatter>
              <fr:mainmatter>
                <html:p>A <html:strong>finite product theory presentation</html:strong> consists of a signature <fr:tex display="inline"><![CDATA[S = \{O_n\}_{n \colon  \mathbb {N}}]]></fr:tex>, along with a selection <fr:tex display="inline"><![CDATA[\{E_n \subset  UF(S)(\{0,\ldots ,n-1\}, \{0\})^2\}_{n \colon  N}]]></fr:tex> of equated pairs of morphisms.</html:p>
                <html:p>As any finite product theory <fr:tex display="inline"><![CDATA[\mathsf {T}]]></fr:tex> induces an algebra <fr:tex display="inline"><![CDATA[\alpha ]]></fr:tex> for the monad <fr:tex display="inline"><![CDATA[UF]]></fr:tex> on <fr:tex display="inline"><![CDATA[U(\mathsf {T})]]></fr:tex>, given <fr:tex display="inline"><![CDATA[f_1,f_2 \in  U(F(U(\mathsf {T})))]]></fr:tex>, we may ask whether <fr:tex display="inline"><![CDATA[\alpha (f_1) = \alpha (f_2)]]></fr:tex>. Thus, there is a forgetful functor from finite product theories to finite product theory presentations, which sends <fr:tex display="inline"><![CDATA[\mathsf {T}]]></fr:tex> to <fr:tex display="inline"><![CDATA[U(\mathsf {T})]]></fr:tex> with the above choice of equated pairs. The left adjoint to the forgetful functor sends a finite product theory presentation to the finite product theory that it presents.</html:p>
              </fr:mainmatter>
            </fr:tree>
            <html:p>Finite product theories may be considered “paradigmatic” for categorical logic, in that the selection of results that we have presented here will show up in analogous form for most other subjects in categorical algebra.</html:p>
            <html:p>Specifically:</html:p>
            <html:ul><html:li>Theories may be identified with certain categories, and models of those theories are functors out of those categories into some concrete category like <fr:tex display="inline"><![CDATA[\mathsf {Set}]]></fr:tex></html:li>
  <html:li>There is an equivalent presentation of theories which involves monads and their algebras. This equivalent presentation is induced by the free-forgetful adjunction between models of a theory and sets.</html:li>
  <html:li>Theories may be presented via generators and relations.</html:li></html:ul>
            <html:p>Finally, we will note that for simplicity we have only treated the “single-sorted” case of finite product theories. In general, one can replace <fr:tex display="inline"><![CDATA[\mathsf {Finset}^{\mathsf {op}}]]></fr:tex> with <fr:tex display="inline"><![CDATA[(\mathsf {Finset}^{\mathsf {op}})^S]]></fr:tex> for a set <fr:tex display="inline"><![CDATA[S]]></fr:tex> of “sorts” in the definition of finite product theory, and then the rest of the development is analogous.</html:p>
          </fr:mainmatter>
        </fr:tree>
        <fr:tree show-metadata="false">
          <fr:frontmatter>
            <fr:authors />
            <fr:date>
              <fr:year>2025</fr:year>
              <fr:month>2</fr:month>
              <fr:day>28</fr:day>
            </fr:date>
            <fr:uri>https://forest.topos.site/ocl-007C/</fr:uri>
            <fr:display-uri>https://forest.topos.site/ocl-007C</fr:display-uri>
            <fr:route>/ocl-007C/</fr:route>
            <fr:title text="Finite limit theories">Finite limit theories</fr:title>
          </fr:frontmatter>
          <fr:mainmatter><html:p>There are many algebraic structures which do not arise as the models of any finite product theory. Perhaps the most famous one of these is categories. Roughly speaking is because in a category, when one composes morphisms one must first check that the codomain and domain match up, and finite product theories do not provide an affordance for this.</html:p><html:p>Finit limit theories are similar to finite product theories, except that we require that the theory has all finite limits instead of just finite products, and additionally that models (which are functors out of the theory into <fr:tex display="inline"><![CDATA[\mathsf {Set}]]></fr:tex>) preserve those limits.</html:p><html:p>This allows us to express composition in a category in the following way.</html:p><html:p>Let <fr:tex display="inline"><![CDATA[O]]></fr:tex> be the set of objects in the category, and <fr:tex display="inline"><![CDATA[M]]></fr:tex> be the set of morphisms, with <fr:tex display="inline"><![CDATA[\partial _0, \partial _1 \colon  M \to  O]]></fr:tex> the domain and codomain functions respectively. Then composition is given by the function <fr:tex display="inline"><![CDATA[c]]></fr:tex> in the following diagram</html:p>



<html:figure><fr:resource hash="7505dfd4ebee18bac5efbc0a71d31be7"><fr:resource-content><html:img src="https://forest.topos.site/7505dfd4ebee18bac5efbc0a71d31be7.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[

\usepackage[utf8]{inputenc}
\DeclareFontFamily{U}{min}{}
\DeclareFontShape{U}{min}{m}{n}{<-> udmj30}{}
\newcommand\yo{\!\text{\usefont{U}{min}{m}{n}\symbol{'207}}\!}
\DeclareUnicodeCharacter{3088}{\yo}


\usepackage{tikz, tikz-cd, mathtools, amssymb, stmaryrd,xcolor}
\usetikzlibrary{matrix,arrows}
\usetikzlibrary{backgrounds,fit,positioning,calc,shapes}
\usetikzlibrary{decorations.pathreplacing}
\usetikzlibrary{decorations.pathmorphing}
\usetikzlibrary{decorations.markings}

% `tikz-cd` is necessary to draw commutative diagrams.
\RequirePackage{tikz-cd}
% `amssymb` is necessary for `\lrcorner` and `\ulcorner`.
\RequirePackage{amssymb}
% `calc` is necessary to draw curved arrows.
\usetikzlibrary{calc}
% `pathmorphing` is necessary to draw squiggly arrows.
\usetikzlibrary{decorations.pathmorphing}
% `spath3` is necessary to draw shortened edges.
\usetikzlibrary{spath3}

% A TikZ style for curved arrows of a fixed height, due to AndréC.
\tikzset{curve/.style={settings={#1},to path={(\tikztostart)
    .. controls ($(\tikztostart)!\pv{pos}!(\tikztotarget)!\pv{height}!270:(\tikztotarget)$)
    and ($(\tikztostart)!1-\pv{pos}!(\tikztotarget)!\pv{height}!270:(\tikztotarget)$)
    .. (\tikztotarget)\tikztonodes}},
    settings/.code={\tikzset{quiver/.cd,#1}
        \def\pv##1{\pgfkeysvalueof{/tikz/quiver/##1}}},
    quiver/.cd,pos/.initial=0.35,height/.initial=0}

% A TikZ style for shortening paths without the poor behaviour of `shorten <' and `shorten >'.
\tikzset{between/.style n args={2}{/tikz/spath/at end path construction={
    \tikzset{spath/split at keep middle={current}{#1}{#2}}
}}}

% TikZ arrowhead/tail styles.
\tikzset{tail reversed/.code={\pgfsetarrowsstart{tikzcd to}}}
\tikzset{2tail/.code={\pgfsetarrowsstart{Implies[reversed]}}}
\tikzset{2tail reversed/.code={\pgfsetarrowsstart{Implies}}}
% TikZ arrow styles.
\tikzset{no body/.style={/tikz/dash pattern=on 0 off 1mm}}


\newcommand{\triplecolon}{%
  \mathrel{\vbox{\baselineskip=2pt \hbox{.}\hbox{.}\hbox{.}}}%
}

\DeclareUnicodeCharacter{2AF6}{\triplecolon}
\usepackage{mathpartir}

]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[
\begin {tikzcd}
	&& {M \times _O M} \\
	& M && M \\
	O && O && O \\
	&& M
	\arrow [from=1-3, to=2-2]
	\arrow [from=1-3, to=2-4]
	\arrow ["\lrcorner "{anchor=center, pos=0.125, rotate=-45}, draw=none, from=1-3, to=3-3]
	\arrow ["c", curve={height=12pt}, from=1-3, to=4-3]
	\arrow ["{\partial _0}"', from=2-2, to=3-1]
	\arrow ["{\partial _1}", from=2-2, to=3-3]
	\arrow ["{\partial _0}"', from=2-4, to=3-3]
	\arrow ["{\partial _1}", from=2-4, to=3-5]
	\arrow ["{\partial _0}", from=4-3, to=3-1]
	\arrow ["{\partial _1}"', from=4-3, to=3-5]
\end {tikzcd}
]]></fr:resource-source></fr:resource></html:figure>

<html:p>where <fr:tex display="inline"><![CDATA[M \times _O M]]></fr:tex> is the set of pairs of morphisms <fr:tex display="inline"><![CDATA[(f,g)]]></fr:tex> such that <fr:tex display="inline"><![CDATA[\partial _1(f) = \partial _0(g)]]></fr:tex>.</html:p><html:p>Finite limit theories are significantly trickier to deal with than finite product theories, because general finite limits generate a much larger class of objects than products. We will discuss finite limit theories in greater detail in <fr:link href="/ocl-00BG/" title="A model for EMTT in lex categories" uri="https://forest.topos.site/ocl-00BG/" display-uri="https://forest.topos.site/ocl-00BG" type="local">§ <fr:contextual-number uri="https://forest.topos.site/ocl-00BG/" display-uri="https://forest.topos.site/ocl-00BG" /></fr:link> under the heading of “sketches”.</html:p><html:p>For now, we will simply say that a finite limit theory is a category that has all finite limits; we refer the reader to <fr:link href="/adamek-1999-essentially/" title="On essentially algebraic theorries and their generalizations" uri="https://forest.topos.site/adamek-1999-essentially/" display-uri="https://forest.topos.site/adamek-1999-essentially" type="local">Reference <fr:contextual-number uri="https://forest.topos.site/adamek-1999-essentially/" display-uri="https://forest.topos.site/adamek-1999-essentially" /></fr:link> and <fr:link href="/adamek-1994-locally/" title="Locally Presentable and Accessible Categories" uri="https://forest.topos.site/adamek-1994-locally/" display-uri="https://forest.topos.site/adamek-1994-locally" type="local">Reference <fr:contextual-number uri="https://forest.topos.site/adamek-1994-locally/" display-uri="https://forest.topos.site/adamek-1994-locally" /></fr:link> for more details.</html:p></fr:mainmatter>
        </fr:tree>
        <fr:tree show-metadata="false">
          <fr:frontmatter>
            <fr:authors>
              <fr:contributor>
                <fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link>
              </fr:contributor>
            </fr:authors>
            <fr:date>
              <fr:year>2025</fr:year>
              <fr:month>2</fr:month>
              <fr:day>28</fr:day>
            </fr:date>
            <fr:uri>https://forest.topos.site/ocl-007D/</fr:uri>
            <fr:display-uri>https://forest.topos.site/ocl-007D</fr:display-uri>
            <fr:route>/ocl-007D/</fr:route>
            <fr:title text="Doctrines (2-theories)">Doctrines (2-theories)</fr:title>
          </fr:frontmatter>
          <fr:mainmatter>
            <html:p>Both <fr:link href="/ocl-007B/" title="Finite product theories" uri="https://forest.topos.site/ocl-007B/" display-uri="https://forest.topos.site/ocl-007B" type="local">§ <fr:contextual-number uri="https://forest.topos.site/ocl-007B/" display-uri="https://forest.topos.site/ocl-007B" /></fr:link> and <fr:link href="/ocl-007C/" title="Finite limit theories" uri="https://forest.topos.site/ocl-007C/" display-uri="https://forest.topos.site/ocl-007C" type="local">§ <fr:contextual-number uri="https://forest.topos.site/ocl-007C/" display-uri="https://forest.topos.site/ocl-007C" /></fr:link> dealt with what we will now call <html:em>1-theories</html:em>, which are theories that have a <html:em>category</html:em> of models.</html:p>
            <html:p>However, there are some “theories” which naturally have a 2-category of models. For instance, the “theory of monoidal categories” naturally has a 2-category of models, where the objects are monoidal categories, the morphisms are (some choice of strict/pseudo/lax/colax) monoidal functors, and the 2-cells are natural transformations.</html:p>
            <html:p>Classically, such a theory has been called a <html:em>doctrine</html:em>. Early references on doctrines include <fr:link href="/lawvere-1969-ordinal/" title="Ordinal sums and equational doctrines" uri="https://forest.topos.site/lawvere-1969-ordinal/" display-uri="https://forest.topos.site/lawvere-1969-ordinal" type="local">Reference <fr:contextual-number uri="https://forest.topos.site/lawvere-1969-ordinal/" display-uri="https://forest.topos.site/lawvere-1969-ordinal" /></fr:link> and <fr:link href="/kock-1977-doctrines/" title="Doctrines in Categorical Logic" uri="https://forest.topos.site/kock-1977-doctrines/" display-uri="https://forest.topos.site/kock-1977-doctrines" type="local">Reference <fr:contextual-number uri="https://forest.topos.site/kock-1977-doctrines/" display-uri="https://forest.topos.site/kock-1977-doctrines" /></fr:link>. For uniformity, we will refer to doctrines as 2-theories, following Shulman <fr:link href="/shulman-2018-type/" title="Type 2-theories" uri="https://forest.topos.site/shulman-2018-type/" display-uri="https://forest.topos.site/shulman-2018-type" type="local">Reference <fr:contextual-number uri="https://forest.topos.site/shulman-2018-type/" display-uri="https://forest.topos.site/shulman-2018-type" /></fr:link>.</html:p>
            <html:p>In fact, the 2-category of categories with finite products, finite product preserving functors, and natural transformations can itself be thought of as the 2-category of models of some “2-theory of finite products”. This leads to our real definition of 1-theory; a 1-theory is a model of a 2-theory!</html:p>
            <html:p>This likewise suggests that a 2-theory should be thought of as some model of a 3-theory. However, this leads to an infinite regress. In practice, we will fix some <fr:tex display="inline"><![CDATA[n]]></fr:tex> to be our “highest level”, define <fr:tex display="inline"><![CDATA[n-1]]></fr:tex>-theories concretely, and then not worry about what the precise structure of the <fr:tex display="inline"><![CDATA[n]]></fr:tex>-theory that we have implicitly defined is. So for instance in <fr:link href="/ocl-0075/" title="Type theory as organized into 3-theories" uri="https://forest.topos.site/ocl-0075/" display-uri="https://forest.topos.site/ocl-0075" type="local">§ <fr:contextual-number uri="https://forest.topos.site/ocl-0075/" display-uri="https://forest.topos.site/ocl-0075" /></fr:link>, we will talk about different 3-theories without ever defining what a 3-theory is; informally a 3-theory is a “paradigm of 2-theories”.</html:p>
            <html:p>If we take this down a level, and say that “informally, a 2-theory is a paradigm of 1-theories”, then we can think of <fr:link href="/ocl-007B/" title="Finite product theories" uri="https://forest.topos.site/ocl-007B/" display-uri="https://forest.topos.site/ocl-007B" type="local">§ <fr:contextual-number uri="https://forest.topos.site/ocl-007B/" display-uri="https://forest.topos.site/ocl-007B" /></fr:link> and <fr:link href="/ocl-007C/" title="Finite limit theories" uri="https://forest.topos.site/ocl-007C/" display-uri="https://forest.topos.site/ocl-007C" type="local">§ <fr:contextual-number uri="https://forest.topos.site/ocl-007C/" display-uri="https://forest.topos.site/ocl-007C" /></fr:link> as defining two particular 2-theories.</html:p>
            <html:p>But it is often profitable to “work a level higher”. In this section, we will briefly touch upon some historical and modern formal notions of 2-theory (each of which may be thought of as a 3-theory).</html:p>
            <fr:tree show-metadata="false">
              <fr:frontmatter>
                <fr:authors>
                  <fr:author>
                    <fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link>
                  </fr:author>
                </fr:authors>
                <fr:date>
                  <fr:year>2025</fr:year>
                  <fr:month>3</fr:month>
                  <fr:day>23</fr:day>
                </fr:date>
                <fr:uri>https://forest.topos.site/ocl-00CA/</fr:uri>
                <fr:display-uri>https://forest.topos.site/ocl-00CA</fr:display-uri>
                <fr:route>/ocl-00CA/</fr:route>
                <fr:title text="2-theories as 2-monads on \mathcal {C}\mathsf {at}">2-theories as 2-monads on <fr:tex display="inline"><![CDATA[\mathcal {C}\mathsf {at}]]></fr:tex></fr:title>
              </fr:frontmatter>
              <fr:mainmatter><html:p>In <fr:link href="/lawvere-1969-ordinal/" title="Ordinal sums and equational doctrines" uri="https://forest.topos.site/lawvere-1969-ordinal/" display-uri="https://forest.topos.site/lawvere-1969-ordinal" type="local">Reference <fr:contextual-number uri="https://forest.topos.site/lawvere-1969-ordinal/" display-uri="https://forest.topos.site/lawvere-1969-ordinal" /></fr:link>, Lawvere defines an <html:strong>equational doctrine</html:strong> to be precisely what a modern category theorist would call a 2-monad on <fr:tex display="inline"><![CDATA[\mathcal {C}\mathsf {at}]]></fr:tex>. An exposition of the theory of 2-monads is beyond the scope of this work, but the interested reader is encouraged to refer to <fr:link href="/lack-2009-categories/" title="A 2-Categories Companion" uri="https://forest.topos.site/lack-2009-categories/" display-uri="https://forest.topos.site/lack-2009-categories" type="local">Reference <fr:contextual-number uri="https://forest.topos.site/lack-2009-categories/" display-uri="https://forest.topos.site/lack-2009-categories" /></fr:link>.</html:p><html:p>In this section, we simply go through an example of the 2-theory for monoidal categories.</html:p><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link></fr:author></fr:authors><fr:date><fr:year>2025</fr:year><fr:month>3</fr:month><fr:day>23</fr:day></fr:date><fr:uri>https://forest.topos.site/ocl-00CB/</fr:uri><fr:display-uri>https://forest.topos.site/ocl-00CB</fr:display-uri><fr:route>/ocl-00CB/</fr:route><fr:title text="The free monoidal category on a category">The free monoidal category on a category</fr:title><fr:taxon>definition</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>Given a category <fr:tex display="inline"><![CDATA[\mathsf {C}]]></fr:tex>, let <fr:tex display="inline"><![CDATA[M(\mathsf {C})]]></fr:tex> be the following monoidal category.</html:p><html:ul><html:li>The objects of <fr:tex display="inline"><![CDATA[M(\mathsf {C})]]></fr:tex> are lists <fr:tex display="inline"><![CDATA[[X_1,\ldots ,X_n]]]></fr:tex> of objects in <fr:tex display="inline"><![CDATA[\mathsf {C}]]></fr:tex>, that is elements of <fr:tex display="inline"><![CDATA[\mathbf {List}(\mathsf {C}_0)]]></fr:tex>.</html:li>
<html:li>The morphisms of <fr:tex display="inline"><![CDATA[M(\mathsf {C})]]></fr:tex> are likewise lists <fr:tex display="inline"><![CDATA[[f_1,\ldots ,f_n]]]></fr:tex> of morphismsin <fr:tex display="inline"><![CDATA[\mathsf {C}]]></fr:tex>, that is elements of <fr:tex display="inline"><![CDATA[\mathbf {List}(\mathsf {C}_1)]]></fr:tex>. The domain and codomain of such a list of morphisms is given by <fr:tex display="inline"><![CDATA[\mathbf {List}(\partial _0), \mathbf {List}(\partial _1) \colon  \mathbf {List}(\mathsf {C}_1) \to  \mathbf {List}(\mathsf {C}_0)]]></fr:tex>, so <fr:tex display="inline"><![CDATA[[f_1,\ldots ,f_n] \colon  [X_1,\ldots ,X_n] \to  [Y_1,\ldots ,Y_n]]]></fr:tex> if <fr:tex display="inline"><![CDATA[f_i \colon  X_i \to  Y_i]]></fr:tex>.</html:li>
<html:li>The monoidal structure on <fr:tex display="inline"><![CDATA[M(\mathsf {C})]]></fr:tex> is given by list concatenation.</html:li></html:ul><html:p>I claim that <fr:tex display="inline"><![CDATA[M]]></fr:tex> is a monad on the 1-category <fr:tex display="inline"><![CDATA[\mathsf {Cat}]]></fr:tex>. In general, this is not the same as a 2-monad on the 2-category <fr:tex display="inline"><![CDATA[\mathcal {C}\mathsf {at}]]></fr:tex>, but an endo-2-functor of <fr:tex display="inline"><![CDATA[\mathcal {C}\mathsf {at}]]></fr:tex> that is a 1-monad is also a 2-monad.</html:p><html:p>The unit for <fr:tex display="inline"><![CDATA[M]]></fr:tex>, <fr:tex display="inline"><![CDATA[\eta _{\mathsf {C}} \colon  \mathsf {C} \to  M(\mathsf {C})]]></fr:tex>, is given by singleton lists:</html:p><fr:tex display="block"><![CDATA[\eta _{\mathsf {C}}(X) = [X]]]></fr:tex><fr:tex display="block"><![CDATA[\eta _{\mathsf {C}}(f) = [f]]]></fr:tex><html:p>Likewise, the multiplication for <fr:tex display="inline"><![CDATA[M]]></fr:tex>, <fr:tex display="inline"><![CDATA[\mu _{\mathsf {C}} \colon  M(M(\mathsf {C})) \to  M(\mathsf {C})]]></fr:tex> is given by list flattening:</html:p><fr:tex display="block"><![CDATA[\mu _{\mathsf {C}}([[X_{1,1},\ldots ,X_{1,m_1}],\ldots ,[X_{n,1},\ldots ,X_{n,m_n}]]) = [X_{1,1},\ldots ,X_{n,m_n}]]]></fr:tex><fr:tex display="block"><![CDATA[\mu _{\mathsf {C}}([[f_{1,1},\ldots ,f_{1,m_1}],\ldots ,[f_{n,1},\ldots ,f_{n,m_n}]]) = [f_{1,1},\ldots ,f_{n,m_n}]]]></fr:tex></fr:mainmatter></fr:tree><html:p>It then not hard to show that strict monoidal categories are algebras of the 2-monad <fr:tex display="inline"><![CDATA[M]]></fr:tex> in <fr:link href="/ocl-00CB/" title="The free monoidal category on a category" uri="https://forest.topos.site/ocl-00CB/" display-uri="https://forest.topos.site/ocl-00CB" type="local">definition <fr:contextual-number uri="https://forest.topos.site/ocl-00CB/" display-uri="https://forest.topos.site/ocl-00CB" /></fr:link>. Moreover, strict monoidal functors are algebra morphisms, and thus there is a 2-category of strict monoidal categories, strict monoidal functors, and natural transformations.</html:p><html:p>One of the nice things about 2-monads is that we are not limited to the strict algebras. Specifically, we may define a pseudo-algebra to be a functor <fr:tex display="inline"><![CDATA[M(\mathsf {C}) \to  \mathsf {C}]]></fr:tex> where the commutative squares in the definition of algebra commute only up to isomorphism, such as</html:p>



<html:figure><fr:resource hash="3b7e5da5da6d56b70b526b354514f4db"><fr:resource-content><html:img src="https://forest.topos.site/3b7e5da5da6d56b70b526b354514f4db.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[

\usepackage[utf8]{inputenc}
\DeclareFontFamily{U}{min}{}
\DeclareFontShape{U}{min}{m}{n}{<-> udmj30}{}
\newcommand\yo{\!\text{\usefont{U}{min}{m}{n}\symbol{'207}}\!}
\DeclareUnicodeCharacter{3088}{\yo}


\usepackage{tikz, tikz-cd, mathtools, amssymb, stmaryrd,xcolor}
\usetikzlibrary{matrix,arrows}
\usetikzlibrary{backgrounds,fit,positioning,calc,shapes}
\usetikzlibrary{decorations.pathreplacing}
\usetikzlibrary{decorations.pathmorphing}
\usetikzlibrary{decorations.markings}

% `tikz-cd` is necessary to draw commutative diagrams.
\RequirePackage{tikz-cd}
% `amssymb` is necessary for `\lrcorner` and `\ulcorner`.
\RequirePackage{amssymb}
% `calc` is necessary to draw curved arrows.
\usetikzlibrary{calc}
% `pathmorphing` is necessary to draw squiggly arrows.
\usetikzlibrary{decorations.pathmorphing}
% `spath3` is necessary to draw shortened edges.
\usetikzlibrary{spath3}

% A TikZ style for curved arrows of a fixed height, due to AndréC.
\tikzset{curve/.style={settings={#1},to path={(\tikztostart)
    .. controls ($(\tikztostart)!\pv{pos}!(\tikztotarget)!\pv{height}!270:(\tikztotarget)$)
    and ($(\tikztostart)!1-\pv{pos}!(\tikztotarget)!\pv{height}!270:(\tikztotarget)$)
    .. (\tikztotarget)\tikztonodes}},
    settings/.code={\tikzset{quiver/.cd,#1}
        \def\pv##1{\pgfkeysvalueof{/tikz/quiver/##1}}},
    quiver/.cd,pos/.initial=0.35,height/.initial=0}

% A TikZ style for shortening paths without the poor behaviour of `shorten <' and `shorten >'.
\tikzset{between/.style n args={2}{/tikz/spath/at end path construction={
    \tikzset{spath/split at keep middle={current}{#1}{#2}}
}}}

% TikZ arrowhead/tail styles.
\tikzset{tail reversed/.code={\pgfsetarrowsstart{tikzcd to}}}
\tikzset{2tail/.code={\pgfsetarrowsstart{Implies[reversed]}}}
\tikzset{2tail reversed/.code={\pgfsetarrowsstart{Implies}}}
% TikZ arrow styles.
\tikzset{no body/.style={/tikz/dash pattern=on 0 off 1mm}}


\newcommand{\triplecolon}{%
  \mathrel{\vbox{\baselineskip=2pt \hbox{.}\hbox{.}\hbox{.}}}%
}

\DeclareUnicodeCharacter{2AF6}{\triplecolon}
\usepackage{mathpartir}

]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[
  \begin {tikzcd}
	{M^2(\mathsf {C})} & {M(\mathsf {C})} \\
	{M(\mathsf {C})} & {\mathsf {C}}
	\arrow [from=1-1, to=1-2]
	\arrow [""{name=0, anchor=center, inner sep=0}, from=1-1, to=2-1]
	\arrow [""{name=1, anchor=center, inner sep=0}, from=1-2, to=2-2]
	\arrow [from=2-1, to=2-2]
	\arrow ["\cong "{description}, draw=none, from=0, to=1]
\end {tikzcd}
]]></fr:resource-source></fr:resource></html:figure>

<html:p>(and those isomorphisms satisfy coherences).</html:p><html:p>Considering pseudoalgebras for <fr:tex display="inline"><![CDATA[M]]></fr:tex> gives us a 2-category of weak monoidal categories, weak monoidal functors, and natural transformations.</html:p></fr:mainmatter>
            </fr:tree>
            <fr:tree show-metadata="false">
              <fr:frontmatter>
                <fr:authors>
                  <fr:author>
                    <fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link>
                  </fr:author>
                </fr:authors>
                <fr:date>
                  <fr:year>2025</fr:year>
                  <fr:month>3</fr:month>
                  <fr:day>23</fr:day>
                </fr:date>
                <fr:uri>https://forest.topos.site/ocl-00CC/</fr:uri>
                <fr:display-uri>https://forest.topos.site/ocl-00CC</fr:display-uri>
                <fr:route>/ocl-00CC/</fr:route>
                <fr:title text="2-theories as cartesian double theories">2-theories as cartesian double theories</fr:title>
              </fr:frontmatter>
              <fr:mainmatter>
                <html:p>In the case of finite product theories, there is a correspondence between finite product theories and finitary monads on <fr:tex display="inline"><![CDATA[\mathsf {Set}]]></fr:tex>. A natural question to ask is whether there is a presentation of 2-theories which is analogous to finite product theories rather than monads.</html:p>
                <html:p>In <fr:link href="/lambert-2024-cartesian/" title="Cartesian double theories: A double-categorical framework for categorical doctrines" uri="https://forest.topos.site/lambert-2024-cartesian/" display-uri="https://forest.topos.site/lambert-2024-cartesian" type="local">Reference <fr:contextual-number uri="https://forest.topos.site/lambert-2024-cartesian/" display-uri="https://forest.topos.site/lambert-2024-cartesian" /></fr:link>, Lambert and Patterson give a notion of “cartesian double theory” which brings us closer to answering this question in the affirmative. It is not yet known the precise relationship between 2-monads and cartesian double theories, but many of the natural 2-theories one would like to consider appear as both 2-monads and as cartesian double theories, so it seems likely that some formal relationship could hold.</html:p>
                <html:p>Note that in the 1-theory case, the correspondence is between monads on <fr:tex display="inline"><![CDATA[\mathsf {Set}]]></fr:tex> and finite product theories <html:em>generated by a single object</html:em>, so one might expect that the relationship would be between 2-monads on <fr:tex display="inline"><![CDATA[\mathcal {C}\mathsf {at}]]></fr:tex> and cartesian double theories generated by a single object and single proarrow, rather than a full correspondence.</html:p>
                <html:p>Similar to this approach is the “algebraic 2-theories” of <fr:link href="/yanofsky-2000-coherence/" title="Coherence, Homotopy and 2-Theories" uri="https://forest.topos.site/yanofsky-2000-coherence/" display-uri="https://forest.topos.site/yanofsky-2000-coherence" type="local">Reference <fr:contextual-number uri="https://forest.topos.site/yanofsky-2000-coherence/" display-uri="https://forest.topos.site/yanofsky-2000-coherence" /></fr:link>, which uses 2-categories instead of double categories.</html:p>
                <html:p>We will not discuss cartesian double theories at length here. We will note, however, that cartesian double theories form the backbone of <fr:link href="https://catcolab.org/" type="external">CatColab</fr:link>, and one of the intended applications of EMTT is to provide the theoretical background for compositional notebooks in CatColab, so at some point we may develop a closer connection between EMTT and cartesian double theories.</html:p>
              </fr:mainmatter>
            </fr:tree>
          </fr:mainmatter>
        </fr:tree>
      </fr:mainmatter>
    </fr:tree>
    <fr:tree show-metadata="false">
      <fr:frontmatter>
        <fr:authors>
          <fr:contributor>
            <fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link>
          </fr:contributor>
        </fr:authors>
        <fr:date>
          <fr:year>2025</fr:year>
          <fr:month>2</fr:month>
          <fr:day>28</fr:day>
        </fr:date>
        <fr:uri>https://forest.topos.site/ocl-0075/</fr:uri>
        <fr:display-uri>https://forest.topos.site/ocl-0075</fr:display-uri>
        <fr:route>/ocl-0075/</fr:route>
        <fr:title text="Type theory as organized into 3-theories">Type theory as organized into 3-theories</fr:title>
      </fr:frontmatter>
      <fr:mainmatter>
        <html:p>In this section, we give an overview of type theory from the <fr:tex display="inline"><![CDATA[n]]></fr:tex>-theory point of view. Here, we note a couple things before we start.</html:p>
        <html:p>First of all, this overview is neither comprehensive, pedagogical, or original. Rather, it is intended to <html:em>organize</html:em> subject matter that the reader has prior exposure with into some kind of semi-unified whole which may be discussed later on in a condensed manner. The reader without previous exposure to type theory but with exposure to category theory is encouraged to read <fr:link href="/shulman-2016-catlog/" title="Categorical logic from a categorical point of view" uri="https://forest.topos.site/shulman-2016-catlog/" display-uri="https://forest.topos.site/shulman-2016-catlog" type="local">Reference <fr:contextual-number uri="https://forest.topos.site/shulman-2016-catlog/" display-uri="https://forest.topos.site/shulman-2016-catlog" /></fr:link> before reading this.</html:p>
        <html:p>Secondly, while this overview has some pretension at unification, the reader should know that a more unified and precise account of a wider variety of type theories may be found in <fr:link href="/uemura-2023-general/" title="A general framework for the semantics of type theory" uri="https://forest.topos.site/uemura-2023-general/" display-uri="https://forest.topos.site/uemura-2023-general" type="local">Reference <fr:contextual-number uri="https://forest.topos.site/uemura-2023-general/" display-uri="https://forest.topos.site/uemura-2023-general" /></fr:link>. The only thing that the present account has to recommend it over this more general story is that we are more narrowly focused on getting to two-level type theory, and thus pay more attention to the exposition of two-level type theory in particular.</html:p>
        <html:p>Finally, and this is somewhat of a technical point which is likely only to be understood after <fr:link href="/ocl-0073/" title="The 3-theory of two-level dependent type theories (\mathbb {D}^{2})" uri="https://forest.topos.site/ocl-0073/" display-uri="https://forest.topos.site/ocl-0073" type="local">§ <fr:contextual-number uri="https://forest.topos.site/ocl-0073/" display-uri="https://forest.topos.site/ocl-0073" /></fr:link>, what we call two-level type theory should really be known as something like “dependent-dependent type theory”, to emphasize that the type theory is dependent at each level. One might also posit 3-theories of simple-simple type theory (examples would include System F (the two levels are kinds and types) or first-order logic (the two levels are types and propositions)), or dependent-simple type theory (examples would perhaps include the closure-free type theory of <fr:link href="/kovács-2024-closurefree/" title="Closure-Free Functional Programming in a Two-Level Type Theory" uri="https://forest.topos.site/kovács-2024-closurefree/" display-uri="https://forest.topos.site/kovács-2024-closurefree" type="local">Reference <fr:contextual-number uri="https://forest.topos.site/kovács-2024-closurefree/" display-uri="https://forest.topos.site/kovács-2024-closurefree" /></fr:link>, we are less sure of this), and these also deserve the name of two-level type theory. We do not treat these 3-theories here, but they are certainly equally worthy of study.</html:p>
        <fr:tree show-metadata="false">
          <fr:frontmatter>
            <fr:authors>
              <fr:author>
                <fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link>
              </fr:author>
            </fr:authors>
            <fr:date>
              <fr:year>2025</fr:year>
              <fr:month>2</fr:month>
              <fr:day>28</fr:day>
            </fr:date>
            <fr:uri>https://forest.topos.site/ocl-0071/</fr:uri>
            <fr:display-uri>https://forest.topos.site/ocl-0071</fr:display-uri>
            <fr:route>/ocl-0071/</fr:route>
            <fr:title text="The 3-theory of simple type theories (\mathbb {S})">The 3-theory of simple type theories (<fr:tex display="inline"><![CDATA[\mathbb {S}]]></fr:tex>)</fr:title>
          </fr:frontmatter>
          <fr:mainmatter>
            <html:p>In this section, we discuss the syntax and semantics of the 3-theory of simple type theories, which we refer to as <fr:tex display="inline"><![CDATA[\mathbb {S}]]></fr:tex>.</html:p>
            <html:p>The substance of this section is mostly derived from Chapter 2 of <fr:link href="/shulman-2016-catlog/" title="Categorical logic from a categorical point of view" uri="https://forest.topos.site/shulman-2016-catlog/" display-uri="https://forest.topos.site/shulman-2016-catlog" type="local">Reference <fr:contextual-number uri="https://forest.topos.site/shulman-2016-catlog/" display-uri="https://forest.topos.site/shulman-2016-catlog" /></fr:link>, though we treat the type theory in less detail and we take more explicit the perspective of <fr:link href="/shulman-2018-type/" title="Type 2-theories" uri="https://forest.topos.site/shulman-2018-type/" display-uri="https://forest.topos.site/shulman-2018-type" type="local">Reference <fr:contextual-number uri="https://forest.topos.site/shulman-2018-type/" display-uri="https://forest.topos.site/shulman-2018-type" /></fr:link>. Where we have diverged from Shulman, it is for the purpose of establishing notation and conceptualization that harmonizes better with the following sections.</html:p>
            <fr:tree show-metadata="false">
              <fr:frontmatter>
                <fr:authors>
                  <fr:contributor>
                    <fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link>
                  </fr:contributor>
                </fr:authors>
                <fr:date>
                  <fr:year>2025</fr:year>
                  <fr:month>2</fr:month>
                  <fr:day>28</fr:day>
                </fr:date>
                <fr:uri>https://forest.topos.site/ocl-007M/</fr:uri>
                <fr:display-uri>https://forest.topos.site/ocl-007M</fr:display-uri>
                <fr:route>/ocl-007M/</fr:route>
                <fr:title text="Judgment structure of \mathbb {S}">Judgment structure of <fr:tex display="inline"><![CDATA[\mathbb {S}]]></fr:tex></fr:title>
              </fr:frontmatter>
              <fr:mainmatter>
                <html:p>In this section, we review the judgment structure of <fr:tex display="inline"><![CDATA[\mathbb {S}]]></fr:tex>, which might be thought of as the “syntactic 3-theory” of <fr:tex display="inline"><![CDATA[\mathbb {S}]]></fr:tex>.</html:p>
                <html:p>It is typical when presenting a type theory to begin with so-called “judgment formers”. These might be given in the following way.</html:p>
                <fr:tree show-metadata="false">
                  <fr:frontmatter>
                    <fr:authors>
                      <fr:author>
                        <fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link>
                      </fr:author>
                    </fr:authors>
                    <fr:date>
                      <fr:year>2025</fr:year>
                      <fr:month>3</fr:month>
                      <fr:day>11</fr:day>
                    </fr:date>
                    <fr:uri>https://forest.topos.site/ocl-009C/</fr:uri>
                    <fr:display-uri>https://forest.topos.site/ocl-009C</fr:display-uri>
                    <fr:route>/ocl-009C/</fr:route>
                    <fr:title text="Example judgments for \mathbb {S}">Example judgments for <fr:tex display="inline"><![CDATA[\mathbb {S}]]></fr:tex></fr:title>
                    <fr:taxon>table</fr:taxon>
                  </fr:frontmatter>
                  <fr:mainmatter>
                    <html:table>
                      <html:thead>
<html:tr><html:th>Judgment</html:th><html:th>Pronunciation</html:th></html:tr>
</html:thead>
                      <html:tbody>
<html:tr><html:td><fr:tex display="inline"><![CDATA[A \,\,\mathsf {type}]]></fr:tex></html:td><html:td><fr:tex display="inline"><![CDATA[A]]></fr:tex> is a type</html:td></html:tr>
<html:tr><html:td><fr:tex display="inline"><![CDATA[\Gamma  \,\vdash \, b \colon  B]]></fr:tex></html:td><html:td>In context <fr:tex display="inline"><![CDATA[\Gamma ]]></fr:tex>, <fr:tex display="inline"><![CDATA[b]]></fr:tex> is a term of type <fr:tex display="inline"><![CDATA[B]]></fr:tex> (where <fr:tex display="inline"><![CDATA[\Gamma  = x_1 \colon  A_1, \ldots , x_n \colon  A_n]]></fr:tex>)</html:td></html:tr>
<html:tr><html:td><fr:tex display="inline"><![CDATA[\Gamma  \,\vdash \, b = b' \colon  B]]></fr:tex></html:td><html:td>In context <fr:tex display="inline"><![CDATA[\Gamma ]]></fr:tex>, the terms <fr:tex display="inline"><![CDATA[b]]></fr:tex> and <fr:tex display="inline"><![CDATA[b']]></fr:tex> of type <fr:tex display="inline"><![CDATA[B]]></fr:tex> are judgmentally equal</html:td></html:tr>
</html:tbody>
                    </html:table>
                  </fr:mainmatter>
                </fr:tree>
                <html:p>However, what does this actually mean? There is much going on under the surface which is obscured by the notation. First of all, we should make a distinction between judgments and their derivations. Derivations are natural deduction trees whose base is a certain judgment.</html:p>
                <html:p>When we write <fr:tex display="inline"><![CDATA[A \,\,\mathsf {type}]]></fr:tex>, we are are identifying <fr:tex display="inline"><![CDATA[A]]></fr:tex> with some derivation of the judgment <fr:tex display="inline"><![CDATA[\mathsf {type}]]></fr:tex>. Similarly, when we write <fr:tex display="inline"><![CDATA[x \colon  A, y \colon  B \,\vdash \, c \colon  C]]></fr:tex>, we identify <fr:tex display="inline"><![CDATA[c]]></fr:tex> (modulo renaming of <fr:tex display="inline"><![CDATA[x]]></fr:tex> and <fr:tex display="inline"><![CDATA[y]]></fr:tex>) with a derivation of the judgment <fr:tex display="inline"><![CDATA[A,B \,\vdash \, C]]></fr:tex>. The reader is encouraged to read section 1.2.2 of <fr:link href="/shulman-2016-catlog/" title="Categorical logic from a categorical point of view" uri="https://forest.topos.site/shulman-2016-catlog/" display-uri="https://forest.topos.site/shulman-2016-catlog" type="local">Reference <fr:contextual-number uri="https://forest.topos.site/shulman-2016-catlog/" display-uri="https://forest.topos.site/shulman-2016-catlog" /></fr:link> to understand exactly how this shorthand works, and why it is important. It is the job of a machine implementation of type theory to <html:em>elaborate</html:em> term syntax into derivations.</html:p>
                <fr:tree show-metadata="false">
                  <fr:frontmatter>
                    <fr:authors>
                      <fr:author>
                        <fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link>
                      </fr:author>
                    </fr:authors>
                    <fr:date>
                      <fr:year>2025</fr:year>
                      <fr:month>3</fr:month>
                      <fr:day>11</fr:day>
                    </fr:date>
                    <fr:uri>https://forest.topos.site/ocl-009B/</fr:uri>
                    <fr:display-uri>https://forest.topos.site/ocl-009B</fr:display-uri>
                    <fr:route>/ocl-009B/</fr:route>
                    <fr:title text="Judgments in a formal metalanguage">Judgments in a formal metalanguage</fr:title>
                    <fr:taxon>aside</fr:taxon>
                  </fr:frontmatter>
                  <fr:mainmatter>
                    <html:p>In an Agda-like language, we might define judgment and derivations mutually inductively as in the following, where we have left <html:code>Judgment</html:code> empty for now (in general, what goes in <html:code>Judgment</html:code> will depend on the 2-theory and the 1-theory in addition to the 3-theory).</html:p>
                    <html:pre><![CDATA[-- Ty = Type, Tm = Term, Ctx = Context

type Ty = Derivation JTy
type Ctx = List Tp
type Tm (Γ : Ctx) (A : Tp) = Derivation (JTm Γ A)

data Judgment : Set where
  JTy : Judgment,
  JTm : Ctx -> Ty -> Judgment
  JEq : (Γ : Ctx) -> (A : Ty) -> Tm Γ A -> Tm Γ A -> Judgment

data Derivation : Judgment -> Set where
  ...]]></html:pre>
                    <html:p>This may not be the most practical way to implement type theory, but it hopefully does somewhat clarify the structure. Specifically, one can see that <fr:link href="/ocl-0099/" title="The cartesian category of substitutions associated to a cartesian multicategory" uri="https://forest.topos.site/ocl-0099/" display-uri="https://forest.topos.site/ocl-0099" type="local">definition <fr:contextual-number uri="https://forest.topos.site/ocl-0099/" display-uri="https://forest.topos.site/ocl-0099" /></fr:link> is an informal presentation of the <html:code>Judgment</html:code> type.</html:p>
                  </fr:mainmatter>
                </fr:tree>
                <html:p>We now give what are known as “structural rules” for <fr:tex display="inline"><![CDATA[\mathbb {S}]]></fr:tex>. Generally speaking, the structural rules for a 3-theory tell you how you are allowed to use variables. When working type-theoretically, it is important that as much as possible these rules become <html:em>admissible</html:em> rather than being taken as primitive. In general, some of these rules must be primitive, but generally it is desirable for substitution to be admissible (though, see <fr:link href="/ocl-009A/" title="Substitution as a primitive" uri="https://forest.topos.site/ocl-009A/" display-uri="https://forest.topos.site/ocl-009A" type="local">remark <fr:contextual-number uri="https://forest.topos.site/ocl-009A/" display-uri="https://forest.topos.site/ocl-009A" /></fr:link> for a discussion of substitution as a primitive). However, it is essential that these rules <html:em>are true</html:em>, whether or not they are actually taken as primitive, which leads to contraints on how other rules get added to a type theory.</html:p>
                <fr:tree show-metadata="false">
                  <fr:frontmatter>
                    <fr:authors />
                    <fr:date>
                      <fr:year>2025</fr:year>
                      <fr:month>2</fr:month>
                      <fr:day>28</fr:day>
                    </fr:date>
                    <fr:uri>https://forest.topos.site/ocl-0089/</fr:uri>
                    <fr:display-uri>https://forest.topos.site/ocl-0089</fr:display-uri>
                    <fr:route>/ocl-0089/</fr:route>
                    <fr:title text="The variable rule for \mathbb {S}">The variable rule for <fr:tex display="inline"><![CDATA[\mathbb {S}]]></fr:tex></fr:title>
                    <fr:taxon>rule</fr:taxon>
                  </fr:frontmatter>
                  <fr:mainmatter>
<fr:resource hash="42b971f318bd18a1540f663cd905a067"><fr:resource-content><html:img src="https://forest.topos.site/42b971f318bd18a1540f663cd905a067.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[\usepackage {mathpartir, amssymb, amsmath, mathtools}]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[
\begin {mathpar}

\inferrule {\phantom {-}}{x \colon  A \,\vdash \, x \colon  A}

\end {mathpar}
]]></fr:resource-source></fr:resource>
</fr:mainmatter>
                </fr:tree>
                <fr:tree show-metadata="false">
                  <fr:frontmatter>
                    <fr:authors />
                    <fr:date>
                      <fr:year>2025</fr:year>
                      <fr:month>2</fr:month>
                      <fr:day>28</fr:day>
                    </fr:date>
                    <fr:uri>https://forest.topos.site/ocl-008A/</fr:uri>
                    <fr:display-uri>https://forest.topos.site/ocl-008A</fr:display-uri>
                    <fr:route>/ocl-008A/</fr:route>
                    <fr:title text="The weakening rule for \mathbb {S}">The weakening rule for <fr:tex display="inline"><![CDATA[\mathbb {S}]]></fr:tex></fr:title>
                    <fr:taxon>rule</fr:taxon>
                  </fr:frontmatter>
                  <fr:mainmatter><html:p>We use the notation <fr:tex display="inline"><![CDATA[\Delta  \subset  \Gamma ]]></fr:tex> to indicate that <fr:tex display="inline"><![CDATA[\Delta ]]></fr:tex> is a subcontext of <fr:tex display="inline"><![CDATA[\Gamma ]]></fr:tex>, in the sense that every typing judgment <fr:tex display="inline"><![CDATA[x_i \colon  A_i]]></fr:tex> in <fr:tex display="inline"><![CDATA[\Delta ]]></fr:tex> also appears in <fr:tex display="inline"><![CDATA[\Gamma ]]></fr:tex>.</html:p>
<fr:resource hash="6cc1a6c4d87c7c38a199e914e47db9aa"><fr:resource-content><html:img src="https://forest.topos.site/6cc1a6c4d87c7c38a199e914e47db9aa.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[\usepackage {mathpartir, amssymb, amsmath, mathtools}]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[
\begin {mathpar}

\inferrule {\Delta  \subset  \Gamma  \and  \Delta  \,\vdash \, b \colon  B}{\Gamma  \,\vdash \, b \colon  B}

\end {mathpar}
]]></fr:resource-source></fr:resource>
</fr:mainmatter>
                </fr:tree>
                <fr:tree show-metadata="false">
                  <fr:frontmatter>
                    <fr:authors />
                    <fr:date>
                      <fr:year>2025</fr:year>
                      <fr:month>2</fr:month>
                      <fr:day>28</fr:day>
                    </fr:date>
                    <fr:uri>https://forest.topos.site/ocl-008B/</fr:uri>
                    <fr:display-uri>https://forest.topos.site/ocl-008B</fr:display-uri>
                    <fr:route>/ocl-008B/</fr:route>
                    <fr:title text="The substitution rule for \mathbb {S}">The substitution rule for <fr:tex display="inline"><![CDATA[\mathbb {S}]]></fr:tex></fr:title>
                    <fr:taxon>rule</fr:taxon>
                  </fr:frontmatter>
                  <fr:mainmatter>
<fr:resource hash="7e3e63434c2a4980c291872a72fa8e63"><fr:resource-content><html:img src="https://forest.topos.site/7e3e63434c2a4980c291872a72fa8e63.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[\usepackage {mathpartir, amssymb, amsmath, mathtools}]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[
\begin {mathpar}

\inferrule {\Gamma  \,\vdash \, b_1 \colon  B_1 \and  \ldots  \and  \Gamma  \,\vdash \, b_n \colon  B_n \and  \Gamma , x_1 \colon  B_1, \ldots , x_n \colon  B_n \,\vdash \, c \colon  C}{\Gamma  \,\vdash \, c[x_i \backslash  b_i] \colon  C}

\end {mathpar}
]]></fr:resource-source></fr:resource>
</fr:mainmatter>
                </fr:tree>
                <html:p>Note that this particular collection of rules is by no means the only way of presenting the structural rules for simple type theory. For instance, instead of <fr:link href="/ocl-0089/" title="The variable rule for \mathbb {S}" uri="https://forest.topos.site/ocl-0089/" display-uri="https://forest.topos.site/ocl-0089" type="local">rule <fr:contextual-number uri="https://forest.topos.site/ocl-0089/" display-uri="https://forest.topos.site/ocl-0089" /></fr:link>, we could instead use <fr:link href="/ocl-008C/" title="An alternative variable rule for \mathbb {S}" uri="https://forest.topos.site/ocl-008C/" display-uri="https://forest.topos.site/ocl-008C" type="local">rule <fr:contextual-number uri="https://forest.topos.site/ocl-008C/" display-uri="https://forest.topos.site/ocl-008C" /></fr:link> (and in practice, this rule is closer to the actual implementation). But again, we emphasize that such distinctions, while extremely important in practice, are orthogonal to the issue at hand, which is to understand the classification of type theories into different 3-theories.</html:p>
                <fr:tree show-metadata="false">
                  <fr:frontmatter>
                    <fr:authors />
                    <fr:date>
                      <fr:year>2025</fr:year>
                      <fr:month>2</fr:month>
                      <fr:day>28</fr:day>
                    </fr:date>
                    <fr:uri>https://forest.topos.site/ocl-008C/</fr:uri>
                    <fr:display-uri>https://forest.topos.site/ocl-008C</fr:display-uri>
                    <fr:route>/ocl-008C/</fr:route>
                    <fr:title text="An alternative variable rule for \mathbb {S}">An alternative variable rule for <fr:tex display="inline"><![CDATA[\mathbb {S}]]></fr:tex></fr:title>
                    <fr:taxon>rule</fr:taxon>
                  </fr:frontmatter>
                  <fr:mainmatter>
<fr:resource hash="418261ae149dae821752b10a1fa48db4"><fr:resource-content><html:img src="https://forest.topos.site/418261ae149dae821752b10a1fa48db4.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[\usepackage {mathpartir, amssymb, amsmath, mathtools}]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[
\begin {mathpar}

\inferrule {x \colon  A \in  \Gamma }{\Gamma  \,\vdash \, x \colon  A}

\end {mathpar}
]]></fr:resource-source></fr:resource>
</fr:mainmatter>
                </fr:tree>
                <fr:tree show-metadata="false">
                  <fr:frontmatter>
                    <fr:authors>
                      <fr:author>
                        <fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link>
                      </fr:author>
                    </fr:authors>
                    <fr:date>
                      <fr:year>2025</fr:year>
                      <fr:month>3</fr:month>
                      <fr:day>11</fr:day>
                    </fr:date>
                    <fr:uri>https://forest.topos.site/ocl-009A/</fr:uri>
                    <fr:display-uri>https://forest.topos.site/ocl-009A</fr:display-uri>
                    <fr:route>/ocl-009A/</fr:route>
                    <fr:title text="Substitution as a primitive">Substitution as a primitive</fr:title>
                    <fr:taxon>remark</fr:taxon>
                  </fr:frontmatter>
                  <fr:mainmatter><html:p>Almost all languages in fact <html:em>do</html:em> have a substitution primitive, in the form of let bindings. To see this, consider the typing rule for a let binding.</html:p>
<fr:resource hash="b3cd91bbb620a5446745ddb006a7b8c1"><fr:resource-content><html:img src="https://forest.topos.site/b3cd91bbb620a5446745ddb006a7b8c1.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[\usepackage {mathpartir, amssymb, amsmath, mathtools}]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[
\begin {mathpar}

\inferrule {\Gamma  \,\vdash \, a \colon  A \and  \Gamma , x \colon  A \,\vdash \, b \colon  B}{\Gamma  \,\vdash \, (\mathbf {let}\,\, x = a \,\,\mathbf {in}\,\, b) \colon  B}

\end {mathpar}
]]></fr:resource-source></fr:resource>
<html:p>This is more or less precisely the same typing for substitutions, it's just that we have <fr:tex display="inline"><![CDATA[\mathbf {let}\,\, x = a \,\,\mathbf {in}\,\, b]]></fr:tex> rather than <fr:tex display="inline"><![CDATA[b[x \backslash  a]]]></fr:tex>. It is still advantageous for substitution to be admissible, because then the evaluation semantics for let statements can use substitution, but it is worth pointing out that “substitution as a primitive” is actually a useful and commonplace operation.</html:p></fr:mainmatter>
                </fr:tree>
              </fr:mainmatter>
            </fr:tree>
            <fr:tree show-metadata="false">
              <fr:frontmatter>
                <fr:authors />
                <fr:date>
                  <fr:year>2025</fr:year>
                  <fr:month>2</fr:month>
                  <fr:day>28</fr:day>
                </fr:date>
                <fr:uri>https://forest.topos.site/ocl-007N/</fr:uri>
                <fr:display-uri>https://forest.topos.site/ocl-007N</fr:display-uri>
                <fr:route>/ocl-007N/</fr:route>
                <fr:title text="1-theories in the initial 2-theory for \mathbb {S}">1-theories in the initial 2-theory for <fr:tex display="inline"><![CDATA[\mathbb {S}]]></fr:tex></fr:title>
              </fr:frontmatter>
              <fr:mainmatter>
                <html:p>Just as how in finite product theories there was an initial 1-theory whose models were sets, in simple type theory there is an initial 2-theory. We will discuss the models (1-theories) of this initial 2-theory in this section. This is important, because just as in finite product theories, a model can be thought of as a “set with some structure”, a 1-theory of a general 2-theory may be thought of as a “1-theory of the initial 2-theory with some structure”.</html:p>
                <html:p>Informally speaking, a 1-theory is a postulation of primitive derivations of certain judgments. This will be easiest to explain by considering a couple of examples.</html:p>
                <fr:tree show-metadata="false">
                  <fr:frontmatter>
                    <fr:authors />
                    <fr:date>
                      <fr:year>2025</fr:year>
                      <fr:month>2</fr:month>
                      <fr:day>28</fr:day>
                    </fr:date>
                    <fr:uri>https://forest.topos.site/ocl-008E/</fr:uri>
                    <fr:display-uri>https://forest.topos.site/ocl-008E</fr:display-uri>
                    <fr:route>/ocl-008E/</fr:route>
                    <fr:title text="The 1-theory of graphs in \mathbb {S}">The 1-theory of graphs in <fr:tex display="inline"><![CDATA[\mathbb {S}]]></fr:tex></fr:title>
                    <fr:taxon>example</fr:taxon>
                  </fr:frontmatter>
                  <fr:mainmatter><html:p>The 1-theory of graphs is given by taking as primitives the following derivations of judgments.</html:p><fr:tex display="block"><![CDATA[
\begin {aligned}
& V \,\,\mathsf {type} \\
& E \,\,\mathsf {type} \\
e \colon  E \,\vdash \,&\, \mathrm {src}(e) \colon  V \\
e \colon  E \,\vdash \,&\, \mathrm {tgt}(e) \colon  V \\
\end {aligned}
]]></fr:tex><html:p>A perhaps more accurate but less intuitive way of writing these
 “postulations of derivations” would be the following:</html:p>
<fr:resource hash="0d413ae65b1c8085278d20fa42f9fab4"><fr:resource-content><html:img src="https://forest.topos.site/0d413ae65b1c8085278d20fa42f9fab4.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[\usepackage {mathpartir, amssymb, amsmath, mathtools}]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[
\begin {mathpar}

\noindent  \inferrule *[Right=$V$]{\phantom {-}}{\mathsf {type}} \and  \inferrule *[Right=$E$]{\phantom {-}}{\mathsf {type}} \\
\inferrule *[Right=$\mathrm {src}$]{\phantom {-}}{E \,\vdash \, V} \and 
\inferrule *[Right=$\mathrm {tgt}$]{\phantom {-}}{E \,\vdash \, V}

\end {mathpar}
]]></fr:resource-source></fr:resource>
<html:p>And then in order to recover substitution as admissible, we would use <fr:tex display="inline"><![CDATA[\mathrm {src}]]></fr:tex> and <fr:tex display="inline"><![CDATA[\mathrm {tgt}]]></fr:tex> in a slightly different style.</html:p>
<fr:resource hash="4a0eea31e60e527fa77382681cff6b63"><fr:resource-content><html:img src="https://forest.topos.site/4a0eea31e60e527fa77382681cff6b63.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[\usepackage {mathpartir, amssymb, amsmath, mathtools}]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[
\begin {mathpar}

\inferrule *[Right=$\mathrm {src}$]{\Gamma  \,\vdash \, E}{\Gamma  \,\vdash \, V} \and  \inferrule *[Right=$\mathrm {tgt}$]{\Gamma  \,\vdash \, E}{\Gamma  \,\vdash \, V}

\end {mathpar}
]]></fr:resource-source></fr:resource>
<html:p>or, annotated with terms</html:p>
<fr:resource hash="64025b1d6a0ae417f00307ac20129bd9"><fr:resource-content><html:img src="https://forest.topos.site/64025b1d6a0ae417f00307ac20129bd9.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[\usepackage {mathpartir, amssymb, amsmath, mathtools}]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[
\begin {mathpar}

\inferrule *[Right=$\mathrm {src}$]{\Gamma  \,\vdash \, e \colon  E}{\Gamma  \,\vdash \, \mathrm {src}(e) \colon  V} \and  \inferrule *[Right=$\mathrm {tgt}$]{\Gamma  \,\vdash \, e \colon  E}{\Gamma  \,\vdash \, \mathrm {tgt}(e) \colon  V}

\end {mathpar}
]]></fr:resource-source></fr:resource>
<html:p>Although here it looks like we are postulating arbitrary inference rules, it is important to see that these inference rules are equivalent to postulating derivations of <fr:tex display="inline"><![CDATA[E \,\vdash \, V]]></fr:tex> directly and taking substitution as a primitive; the reformulation so that substitution need not be a primitive is a technical detail.</html:p></fr:mainmatter>
                </fr:tree>
                <fr:tree show-metadata="false">
                  <fr:frontmatter>
                    <fr:authors />
                    <fr:date>
                      <fr:year>2025</fr:year>
                      <fr:month>2</fr:month>
                      <fr:day>28</fr:day>
                    </fr:date>
                    <fr:uri>https://forest.topos.site/ocl-008D/</fr:uri>
                    <fr:display-uri>https://forest.topos.site/ocl-008D</fr:display-uri>
                    <fr:route>/ocl-008D/</fr:route>
                    <fr:title text="The 1-theory of monoids in \mathbb {S}">The 1-theory of monoids in <fr:tex display="inline"><![CDATA[\mathbb {S}]]></fr:tex></fr:title>
                    <fr:taxon>example</fr:taxon>
                  </fr:frontmatter>
                  <fr:mainmatter><html:p>The 1-theory of monoids is given by postulating the following primitive derivations of judgments.</html:p><fr:tex display="block"><![CDATA[
\begin {aligned}
&M \,\,\mathsf {type} \\
x \colon  M, y \colon  M \,\vdash \,&\, x \cdot  y \colon  M \\
x \colon  M, y \colon  M, z \colon  M \,\vdash \,&\, (x \cdot  y) \cdot  z = x \cdot  (y \cdot  z) \colon  M \\
\,\vdash \,&\, 1 \colon  M \\
x \colon  M \,\vdash \,&\, 1 \cdot  x = x \colon  M \\
x \colon  M \,\vdash \,&\, x \cdot  1 = x \colon  M
\end {aligned}
]]></fr:tex><html:p>As in <fr:link href="/ocl-008E/" title="The 1-theory of graphs in \mathbb {S}" uri="https://forest.topos.site/ocl-008E/" display-uri="https://forest.topos.site/ocl-008E" type="local">example <fr:contextual-number uri="https://forest.topos.site/ocl-008E/" display-uri="https://forest.topos.site/ocl-008E" /></fr:link>, this is really a notation for something which technically looks more like:</html:p>
<fr:resource hash="049f957b24ba05ee3a6f7ffaa11f3745"><fr:resource-content><html:img src="https://forest.topos.site/049f957b24ba05ee3a6f7ffaa11f3745.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[\usepackage {mathpartir, amssymb, amsmath, mathtools}]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[
\begin {mathpar}

\inferrule *[Right=$M$]{\phantom {-}}{\mathsf {type}} \and 
\inferrule *[Right=Mul]{\Gamma  \,\vdash \, M \and  \Gamma  \,\vdash \, M}{\Gamma  \,\vdash \, M} \\
\inferrule *[Right=Mul]{\inferrule *[Right=Mul]{\Gamma  \,\vdash \, M \\ \Gamma  \,\vdash \, M}{\Gamma  \,\vdash \, M} \\ \Gamma  \,\vdash \, M}{\Gamma  \,\vdash \, M} \quad  \quad  = \quad   \inferrule *[Right=Mul]{\Gamma  \,\vdash \, M \\ \inferrule *[Right=Mul]{\Gamma  \,\vdash \, M \\ \Gamma  \,\vdash \, M}{\Gamma  \,\vdash \, M}}{\Gamma  \,\vdash \, M} \quad  \quad  \\
\vdots 

\end {mathpar}
]]></fr:resource-source></fr:resource>
</fr:mainmatter>
                </fr:tree>
                <html:p>In <fr:link href="/ocl-007O/" title="Cartesian multicategories" uri="https://forest.topos.site/ocl-007O/" display-uri="https://forest.topos.site/ocl-007O" type="local">§ <fr:contextual-number uri="https://forest.topos.site/ocl-007O/" display-uri="https://forest.topos.site/ocl-007O" /></fr:link> we will give a more precise definition of 1-theory.</html:p>
              </fr:mainmatter>
            </fr:tree>
            <fr:tree show-metadata="false">
              <fr:frontmatter>
                <fr:authors>
                  <fr:contributor>
                    <fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link>
                  </fr:contributor>
                </fr:authors>
                <fr:date>
                  <fr:year>2025</fr:year>
                  <fr:month>2</fr:month>
                  <fr:day>28</fr:day>
                </fr:date>
                <fr:uri>https://forest.topos.site/ocl-007O/</fr:uri>
                <fr:display-uri>https://forest.topos.site/ocl-007O</fr:display-uri>
                <fr:route>/ocl-007O/</fr:route>
                <fr:title text="Cartesian multicategories">Cartesian multicategories</fr:title>
              </fr:frontmatter>
              <fr:mainmatter>
                <html:p>The categorical semantics for <fr:tex display="inline"><![CDATA[\mathbb {S}]]></fr:tex> is based around cartesian multicategories, so we start by reviewing some multicategory theory. For the reader who has expected the semantics to be in cartesian categories, we will discuss the difference in <fr:link href="/ocl-008M/" title="Contrasting cartesian multicategories with cartesian categories." uri="https://forest.topos.site/ocl-008M/" display-uri="https://forest.topos.site/ocl-008M" type="local">§ <fr:contextual-number uri="https://forest.topos.site/ocl-008M/" display-uri="https://forest.topos.site/ocl-008M" /></fr:link>, but before we can explain what the difference between the two approaches is we must first explain multicategories.</html:p>
                <fr:tree show-metadata="false">
                  <fr:frontmatter>
                    <fr:authors />
                    <fr:date>
                      <fr:year>2025</fr:year>
                      <fr:month>2</fr:month>
                      <fr:day>28</fr:day>
                    </fr:date>
                    <fr:uri>https://forest.topos.site/ocl-008H/</fr:uri>
                    <fr:display-uri>https://forest.topos.site/ocl-008H</fr:display-uri>
                    <fr:route>/ocl-008H/</fr:route>
                    <fr:title text="Multicategory">Multicategory</fr:title>
                    <fr:taxon>informal definition</fr:taxon>
                  </fr:frontmatter>
                  <fr:mainmatter><html:p>A <html:strong>multicategory</html:strong> is like a category, except the domain of a morphism is a list of objects rather than a single object. To emphasize this, we call such morphisms “multimorphisms”.</html:p><html:p>Notationally, if <fr:tex display="inline"><![CDATA[A_1,\ldots ,A_n,B]]></fr:tex> are objects in a multicategory <fr:tex display="inline"><![CDATA[\mathsf {M}]]></fr:tex>, then we would write the set of multimorphisms from <fr:tex display="inline"><![CDATA[A_1,\ldots ,A_n]]></fr:tex> to <fr:tex display="inline"><![CDATA[B]]></fr:tex> as <fr:tex display="inline"><![CDATA[\mathsf {M}(A_1,\ldots ,A_n; B)]]></fr:tex>. We can visually depict a morphism in the following way:</html:p>



<html:figure><fr:resource hash="3c33b21224287e28bd4aa156a9a29be5"><fr:resource-content><html:img src="https://forest.topos.site/3c33b21224287e28bd4aa156a9a29be5.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[

\usepackage[utf8]{inputenc}
\DeclareFontFamily{U}{min}{}
\DeclareFontShape{U}{min}{m}{n}{<-> udmj30}{}
\newcommand\yo{\!\text{\usefont{U}{min}{m}{n}\symbol{'207}}\!}
\DeclareUnicodeCharacter{3088}{\yo}


\usepackage{tikz, tikz-cd, mathtools, amssymb, stmaryrd,xcolor}
\usetikzlibrary{matrix,arrows}
\usetikzlibrary{backgrounds,fit,positioning,calc,shapes}
\usetikzlibrary{decorations.pathreplacing}
\usetikzlibrary{decorations.pathmorphing}
\usetikzlibrary{decorations.markings}

% `tikz-cd` is necessary to draw commutative diagrams.
\RequirePackage{tikz-cd}
% `amssymb` is necessary for `\lrcorner` and `\ulcorner`.
\RequirePackage{amssymb}
% `calc` is necessary to draw curved arrows.
\usetikzlibrary{calc}
% `pathmorphing` is necessary to draw squiggly arrows.
\usetikzlibrary{decorations.pathmorphing}
% `spath3` is necessary to draw shortened edges.
\usetikzlibrary{spath3}

% A TikZ style for curved arrows of a fixed height, due to AndréC.
\tikzset{curve/.style={settings={#1},to path={(\tikztostart)
    .. controls ($(\tikztostart)!\pv{pos}!(\tikztotarget)!\pv{height}!270:(\tikztotarget)$)
    and ($(\tikztostart)!1-\pv{pos}!(\tikztotarget)!\pv{height}!270:(\tikztotarget)$)
    .. (\tikztotarget)\tikztonodes}},
    settings/.code={\tikzset{quiver/.cd,#1}
        \def\pv##1{\pgfkeysvalueof{/tikz/quiver/##1}}},
    quiver/.cd,pos/.initial=0.35,height/.initial=0}

% A TikZ style for shortening paths without the poor behaviour of `shorten <' and `shorten >'.
\tikzset{between/.style n args={2}{/tikz/spath/at end path construction={
    \tikzset{spath/split at keep middle={current}{#1}{#2}}
}}}

% TikZ arrowhead/tail styles.
\tikzset{tail reversed/.code={\pgfsetarrowsstart{tikzcd to}}}
\tikzset{2tail/.code={\pgfsetarrowsstart{Implies[reversed]}}}
\tikzset{2tail reversed/.code={\pgfsetarrowsstart{Implies}}}
% TikZ arrow styles.
\tikzset{no body/.style={/tikz/dash pattern=on 0 off 1mm}}


\newcommand{\triplecolon}{%
  \mathrel{\vbox{\baselineskip=2pt \hbox{.}\hbox{.}\hbox{.}}}%
}

\DeclareUnicodeCharacter{2AF6}{\triplecolon}
\usepackage{mathpartir}

]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[
\begin {tikzpicture}[grow'=up]
  \node  (root) {} child {
    node[draw, circle] (f) {$f$}
      child { node {} edge from parent node[midway, left] {$A_1$} }
      child { node {} edge from parent[draw=none] node[midway] {$\ldots $} }
      child { node {} edge from parent node[midway, right] {$A_n$} }
  };
\end {tikzpicture}
]]></fr:resource-source></fr:resource></html:figure>

<html:p>Composition in multicategories is slightly annoying to write down, but fairly intuitive once visualized. Suppose that we have multimorphisms <fr:tex display="inline"><![CDATA[f_1 \in  \mathsf {M}(A_{1,1},\ldots ,A_{1,n_1}; B_1), \ldots , f_m \in  \mathsf {M}(A_{m,1},\ldots ,A_{m,n_m}; B_m), g \in  \mathsf {M}(B_1,\ldots ,B_m; C)]]></fr:tex>. Then they have a composite <fr:tex display="inline"><![CDATA[g \circ  (f_1,\ldots ,f_m) \in  \mathsf {M}(A_{1,1},\ldots ,A_{m,n_m}; C)]]></fr:tex>, which can be visualized as the following:</html:p>



<html:figure><fr:resource hash="78b9820656e9e16ea39fdcfb4490308d"><fr:resource-content><html:img src="https://forest.topos.site/78b9820656e9e16ea39fdcfb4490308d.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[

\usepackage[utf8]{inputenc}
\DeclareFontFamily{U}{min}{}
\DeclareFontShape{U}{min}{m}{n}{<-> udmj30}{}
\newcommand\yo{\!\text{\usefont{U}{min}{m}{n}\symbol{'207}}\!}
\DeclareUnicodeCharacter{3088}{\yo}


\usepackage{tikz, tikz-cd, mathtools, amssymb, stmaryrd,xcolor}
\usetikzlibrary{matrix,arrows}
\usetikzlibrary{backgrounds,fit,positioning,calc,shapes}
\usetikzlibrary{decorations.pathreplacing}
\usetikzlibrary{decorations.pathmorphing}
\usetikzlibrary{decorations.markings}

% `tikz-cd` is necessary to draw commutative diagrams.
\RequirePackage{tikz-cd}
% `amssymb` is necessary for `\lrcorner` and `\ulcorner`.
\RequirePackage{amssymb}
% `calc` is necessary to draw curved arrows.
\usetikzlibrary{calc}
% `pathmorphing` is necessary to draw squiggly arrows.
\usetikzlibrary{decorations.pathmorphing}
% `spath3` is necessary to draw shortened edges.
\usetikzlibrary{spath3}

% A TikZ style for curved arrows of a fixed height, due to AndréC.
\tikzset{curve/.style={settings={#1},to path={(\tikztostart)
    .. controls ($(\tikztostart)!\pv{pos}!(\tikztotarget)!\pv{height}!270:(\tikztotarget)$)
    and ($(\tikztostart)!1-\pv{pos}!(\tikztotarget)!\pv{height}!270:(\tikztotarget)$)
    .. (\tikztotarget)\tikztonodes}},
    settings/.code={\tikzset{quiver/.cd,#1}
        \def\pv##1{\pgfkeysvalueof{/tikz/quiver/##1}}},
    quiver/.cd,pos/.initial=0.35,height/.initial=0}

% A TikZ style for shortening paths without the poor behaviour of `shorten <' and `shorten >'.
\tikzset{between/.style n args={2}{/tikz/spath/at end path construction={
    \tikzset{spath/split at keep middle={current}{#1}{#2}}
}}}

% TikZ arrowhead/tail styles.
\tikzset{tail reversed/.code={\pgfsetarrowsstart{tikzcd to}}}
\tikzset{2tail/.code={\pgfsetarrowsstart{Implies[reversed]}}}
\tikzset{2tail reversed/.code={\pgfsetarrowsstart{Implies}}}
% TikZ arrow styles.
\tikzset{no body/.style={/tikz/dash pattern=on 0 off 1mm}}


\newcommand{\triplecolon}{%
  \mathrel{\vbox{\baselineskip=2pt \hbox{.}\hbox{.}\hbox{.}}}%
}

\DeclareUnicodeCharacter{2AF6}{\triplecolon}
\usepackage{mathpartir}

]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[
\begin {tikzpicture}[grow'=up]
  \node  (root) {} child {
    node[draw, circle] (g) {$g$}
      child { node[draw, circle] (f1) {$f_1$}
        child { node {} edge from parent node[midway, left] {$A_{1,1}$} }
        child { node {} edge from parent[draw=none] node[midway] {$\ldots $} }
        child { node {} edge from parent node[midway, right] {$A_{1,n_1}$} }
        child { node {} edge from parent[draw=none] }
        edge from parent node[midway, left] {$B_1$}
      }
      child { node {} edge from parent[draw=none] node[midway] {$\ldots $} }
      child { node[draw, circle] (fm) {$f_m$}
        child { node {} edge from parent[draw=none] }
        child { node {} edge from parent node[midway, left] {$A_{m,1}$} }
        child { node {} edge from parent[draw=none] node[midway] {$\ldots $} }
        child { node {} edge from parent node[midway, right] {$A_{m,n_m}$} }
        edge from parent node[midway, right] {$B_m$}
      }
      edge from parent node[midway, left] {$C$}
  };
\end {tikzpicture}
]]></fr:resource-source></fr:resource></html:figure>

<html:p>Identities are just as in categories; there is an identity <fr:tex display="inline"><![CDATA[\mathrm {id}_A \in  \mathsf {M}(A;A)]]></fr:tex> for every object <fr:tex display="inline"><![CDATA[A]]></fr:tex>.</html:p><html:p>There are also associative and unital conditions, but these are more annoying to write down in the current style because they would involve many indices. The interested reader can derive these conditions from the formal definition in <fr:link href="/ocl-008I/" title="Multicategory" uri="https://forest.topos.site/ocl-008I/" display-uri="https://forest.topos.site/ocl-008I" type="local">definition <fr:contextual-number uri="https://forest.topos.site/ocl-008I/" display-uri="https://forest.topos.site/ocl-008I" /></fr:link>.</html:p></fr:mainmatter>
                </fr:tree>
                <html:p>The reader eager to see how multicategories are connected to simple type theory may skip ahead to <fr:link href="/ocl-008K/" title="A correspondence between \mathbb {S} and multicategory theory" uri="https://forest.topos.site/ocl-008K/" display-uri="https://forest.topos.site/ocl-008K" type="local">§ <fr:contextual-number uri="https://forest.topos.site/ocl-008K/" display-uri="https://forest.topos.site/ocl-008K" /></fr:link>, and the reader skeptical of informal definitions may continue on to <fr:link href="/ocl-008I/" title="Multicategory" uri="https://forest.topos.site/ocl-008I/" display-uri="https://forest.topos.site/ocl-008I" type="local">definition <fr:contextual-number uri="https://forest.topos.site/ocl-008I/" display-uri="https://forest.topos.site/ocl-008I" /></fr:link>.</html:p>
                <fr:tree show-metadata="false">
                  <fr:frontmatter>
                    <fr:authors />
                    <fr:date>
                      <fr:year>2025</fr:year>
                      <fr:month>2</fr:month>
                      <fr:day>28</fr:day>
                    </fr:date>
                    <fr:uri>https://forest.topos.site/ocl-008I/</fr:uri>
                    <fr:display-uri>https://forest.topos.site/ocl-008I</fr:display-uri>
                    <fr:route>/ocl-008I/</fr:route>
                    <fr:title text="Multicategory">Multicategory</fr:title>
                    <fr:taxon>definition</fr:taxon>
                  </fr:frontmatter>
                  <fr:mainmatter><html:p>This is the definition of multicategory which may be found in <fr:link href="/leinster-2004-higher/" title="Higher Operads, Higher Categories" uri="https://forest.topos.site/leinster-2004-higher/" display-uri="https://forest.topos.site/leinster-2004-higher" type="local">Reference <fr:contextual-number uri="https://forest.topos.site/leinster-2004-higher/" display-uri="https://forest.topos.site/leinster-2004-higher" /></fr:link>.</html:p><html:p>Let <fr:tex display="inline"><![CDATA[\mathbf {List} \colon  \mathsf {Set} \to  \mathsf {Set}]]></fr:tex> be the list monad on <fr:tex display="inline"><![CDATA[\mathsf {Set}]]></fr:tex>, defined by</html:p><fr:tex display="block"><![CDATA[\mathbf {List}(A) = \sum _{n \colon  \mathbb {N}} A^n]]></fr:tex><html:p>A <html:strong>multicategory</html:strong> is a monad in the double category of <fr:tex display="inline"><![CDATA[\mathbf {List}]]></fr:tex>-spans, where a loose morphism is a diagram</html:p>



<html:figure><fr:resource hash="99c1d77fc5c28b3dee9e61575cbe559e"><fr:resource-content><html:img src="https://forest.topos.site/99c1d77fc5c28b3dee9e61575cbe559e.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[

\usepackage[utf8]{inputenc}
\DeclareFontFamily{U}{min}{}
\DeclareFontShape{U}{min}{m}{n}{<-> udmj30}{}
\newcommand\yo{\!\text{\usefont{U}{min}{m}{n}\symbol{'207}}\!}
\DeclareUnicodeCharacter{3088}{\yo}


\usepackage{tikz, tikz-cd, mathtools, amssymb, stmaryrd,xcolor}
\usetikzlibrary{matrix,arrows}
\usetikzlibrary{backgrounds,fit,positioning,calc,shapes}
\usetikzlibrary{decorations.pathreplacing}
\usetikzlibrary{decorations.pathmorphing}
\usetikzlibrary{decorations.markings}

% `tikz-cd` is necessary to draw commutative diagrams.
\RequirePackage{tikz-cd}
% `amssymb` is necessary for `\lrcorner` and `\ulcorner`.
\RequirePackage{amssymb}
% `calc` is necessary to draw curved arrows.
\usetikzlibrary{calc}
% `pathmorphing` is necessary to draw squiggly arrows.
\usetikzlibrary{decorations.pathmorphing}
% `spath3` is necessary to draw shortened edges.
\usetikzlibrary{spath3}

% A TikZ style for curved arrows of a fixed height, due to AndréC.
\tikzset{curve/.style={settings={#1},to path={(\tikztostart)
    .. controls ($(\tikztostart)!\pv{pos}!(\tikztotarget)!\pv{height}!270:(\tikztotarget)$)
    and ($(\tikztostart)!1-\pv{pos}!(\tikztotarget)!\pv{height}!270:(\tikztotarget)$)
    .. (\tikztotarget)\tikztonodes}},
    settings/.code={\tikzset{quiver/.cd,#1}
        \def\pv##1{\pgfkeysvalueof{/tikz/quiver/##1}}},
    quiver/.cd,pos/.initial=0.35,height/.initial=0}

% A TikZ style for shortening paths without the poor behaviour of `shorten <' and `shorten >'.
\tikzset{between/.style n args={2}{/tikz/spath/at end path construction={
    \tikzset{spath/split at keep middle={current}{#1}{#2}}
}}}

% TikZ arrowhead/tail styles.
\tikzset{tail reversed/.code={\pgfsetarrowsstart{tikzcd to}}}
\tikzset{2tail/.code={\pgfsetarrowsstart{Implies[reversed]}}}
\tikzset{2tail reversed/.code={\pgfsetarrowsstart{Implies}}}
% TikZ arrow styles.
\tikzset{no body/.style={/tikz/dash pattern=on 0 off 1mm}}


\newcommand{\triplecolon}{%
  \mathrel{\vbox{\baselineskip=2pt \hbox{.}\hbox{.}\hbox{.}}}%
}

\DeclareUnicodeCharacter{2AF6}{\triplecolon}
\usepackage{mathpartir}

]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[
\begin {tikzcd}
	& X \\
	{\mathbf {List}(A)} && B
	\arrow [from=1-2, to=2-1]
	\arrow [from=1-2, to=2-3]
\end {tikzcd}
]]></fr:resource-source></fr:resource></html:figure>

</fr:mainmatter>
                </fr:tree>
                <fr:tree show-metadata="false">
                  <fr:frontmatter>
                    <fr:authors />
                    <fr:date>
                      <fr:year>2025</fr:year>
                      <fr:month>3</fr:month>
                      <fr:day>1</fr:day>
                    </fr:date>
                    <fr:uri>https://forest.topos.site/ocl-008J/</fr:uri>
                    <fr:display-uri>https://forest.topos.site/ocl-008J</fr:display-uri>
                    <fr:route>/ocl-008J/</fr:route>
                    <fr:title text="Comparing definition [https://forest.topos.site/ocl-008I/] and informal definition [https://forest.topos.site/ocl-008H/]">Comparing <fr:link href="/ocl-008I/" title="Multicategory" uri="https://forest.topos.site/ocl-008I/" display-uri="https://forest.topos.site/ocl-008I" type="local">definition <fr:contextual-number uri="https://forest.topos.site/ocl-008I/" display-uri="https://forest.topos.site/ocl-008I" /></fr:link> and <fr:link href="/ocl-008H/" title="Multicategory" uri="https://forest.topos.site/ocl-008H/" display-uri="https://forest.topos.site/ocl-008H" type="local">informal definition <fr:contextual-number uri="https://forest.topos.site/ocl-008H/" display-uri="https://forest.topos.site/ocl-008H" /></fr:link></fr:title>
                    <fr:taxon>remark</fr:taxon>
                  </fr:frontmatter>
                  <fr:mainmatter><html:p>In this remark, we aim to make the connection between <fr:link href="/ocl-008H/" title="Multicategory" uri="https://forest.topos.site/ocl-008H/" display-uri="https://forest.topos.site/ocl-008H" type="local">informal definition <fr:contextual-number uri="https://forest.topos.site/ocl-008H/" display-uri="https://forest.topos.site/ocl-008H" /></fr:link> and <fr:link href="/ocl-008I/" title="Multicategory" uri="https://forest.topos.site/ocl-008I/" display-uri="https://forest.topos.site/ocl-008I" type="local">definition <fr:contextual-number uri="https://forest.topos.site/ocl-008I/" display-uri="https://forest.topos.site/ocl-008I" /></fr:link> explicit.</html:p><html:p>A monad in the double category of <fr:tex display="inline"><![CDATA[\mathbf {List}]]></fr:tex>-spans consists of a endo-<fr:tex display="inline"><![CDATA[\mathbf {List}]]></fr:tex>-span</html:p>



<html:figure><fr:resource hash="b41fb3553960799ebbffd917a24e13d0"><fr:resource-content><html:img src="https://forest.topos.site/b41fb3553960799ebbffd917a24e13d0.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[

\usepackage[utf8]{inputenc}
\DeclareFontFamily{U}{min}{}
\DeclareFontShape{U}{min}{m}{n}{<-> udmj30}{}
\newcommand\yo{\!\text{\usefont{U}{min}{m}{n}\symbol{'207}}\!}
\DeclareUnicodeCharacter{3088}{\yo}


\usepackage{tikz, tikz-cd, mathtools, amssymb, stmaryrd,xcolor}
\usetikzlibrary{matrix,arrows}
\usetikzlibrary{backgrounds,fit,positioning,calc,shapes}
\usetikzlibrary{decorations.pathreplacing}
\usetikzlibrary{decorations.pathmorphing}
\usetikzlibrary{decorations.markings}

% `tikz-cd` is necessary to draw commutative diagrams.
\RequirePackage{tikz-cd}
% `amssymb` is necessary for `\lrcorner` and `\ulcorner`.
\RequirePackage{amssymb}
% `calc` is necessary to draw curved arrows.
\usetikzlibrary{calc}
% `pathmorphing` is necessary to draw squiggly arrows.
\usetikzlibrary{decorations.pathmorphing}
% `spath3` is necessary to draw shortened edges.
\usetikzlibrary{spath3}

% A TikZ style for curved arrows of a fixed height, due to AndréC.
\tikzset{curve/.style={settings={#1},to path={(\tikztostart)
    .. controls ($(\tikztostart)!\pv{pos}!(\tikztotarget)!\pv{height}!270:(\tikztotarget)$)
    and ($(\tikztostart)!1-\pv{pos}!(\tikztotarget)!\pv{height}!270:(\tikztotarget)$)
    .. (\tikztotarget)\tikztonodes}},
    settings/.code={\tikzset{quiver/.cd,#1}
        \def\pv##1{\pgfkeysvalueof{/tikz/quiver/##1}}},
    quiver/.cd,pos/.initial=0.35,height/.initial=0}

% A TikZ style for shortening paths without the poor behaviour of `shorten <' and `shorten >'.
\tikzset{between/.style n args={2}{/tikz/spath/at end path construction={
    \tikzset{spath/split at keep middle={current}{#1}{#2}}
}}}

% TikZ arrowhead/tail styles.
\tikzset{tail reversed/.code={\pgfsetarrowsstart{tikzcd to}}}
\tikzset{2tail/.code={\pgfsetarrowsstart{Implies[reversed]}}}
\tikzset{2tail reversed/.code={\pgfsetarrowsstart{Implies}}}
% TikZ arrow styles.
\tikzset{no body/.style={/tikz/dash pattern=on 0 off 1mm}}


\newcommand{\triplecolon}{%
  \mathrel{\vbox{\baselineskip=2pt \hbox{.}\hbox{.}\hbox{.}}}%
}

\DeclareUnicodeCharacter{2AF6}{\triplecolon}
\usepackage{mathpartir}

]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[
\begin {tikzcd}
	& {\mathsf {M}_1} \\
	{\mathbf {List}(\mathsf {M}_0)} && {\mathsf {M}_0}
	\arrow ["{\partial _0}"', from=1-2, to=2-1]
	\arrow ["{\partial _1}", from=1-2, to=2-3]
\end {tikzcd}
]]></fr:resource-source></fr:resource></html:figure>

<html:p>with a unit, multiplication, and some conditions. Before we discus the other stuff, we first interpret this endo-<fr:tex display="inline"><![CDATA[\mathbf {List}]]></fr:tex>-span. The apex <fr:tex display="inline"><![CDATA[\mathsf {M}_1]]></fr:tex> consists of all of the multimorphisms in the multicategory. The domain <fr:tex display="inline"><![CDATA[\partial _0]]></fr:tex> map assigns to a multimorphism its list of objects that form its domain, and the codomain map <fr:tex display="inline"><![CDATA[\partial _1]]></fr:tex> assigns to a multimorphism its single object that is its codomain. So, specifically, we can translate the notation <fr:tex display="inline"><![CDATA[\mathsf {M}(A_1,\ldots ,A_n; B)]]></fr:tex> into <fr:tex display="inline"><![CDATA[(\partial _0 \times  \partial _1)^{-1}([A_1,\ldots ,A_n], B)]]></fr:tex>.</html:p><html:p>The unit for <fr:tex display="inline"><![CDATA[\mathsf {M}]]></fr:tex> consists of a 2-cell from the identity <fr:tex display="inline"><![CDATA[\mathbf {List}]]></fr:tex>-span to <fr:tex display="inline"><![CDATA[\mathsf {M}_1]]></fr:tex> which picks out the identity multimorphism at each object. As a 2-cell in a double category, this looks like</html:p>



<html:figure><fr:resource hash="7806b0c11d16fdb15a972909fd12487a"><fr:resource-content><html:img src="https://forest.topos.site/7806b0c11d16fdb15a972909fd12487a.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[

\usepackage[utf8]{inputenc}
\DeclareFontFamily{U}{min}{}
\DeclareFontShape{U}{min}{m}{n}{<-> udmj30}{}
\newcommand\yo{\!\text{\usefont{U}{min}{m}{n}\symbol{'207}}\!}
\DeclareUnicodeCharacter{3088}{\yo}


\usepackage{tikz, tikz-cd, mathtools, amssymb, stmaryrd,xcolor}
\usetikzlibrary{matrix,arrows}
\usetikzlibrary{backgrounds,fit,positioning,calc,shapes}
\usetikzlibrary{decorations.pathreplacing}
\usetikzlibrary{decorations.pathmorphing}
\usetikzlibrary{decorations.markings}

% `tikz-cd` is necessary to draw commutative diagrams.
\RequirePackage{tikz-cd}
% `amssymb` is necessary for `\lrcorner` and `\ulcorner`.
\RequirePackage{amssymb}
% `calc` is necessary to draw curved arrows.
\usetikzlibrary{calc}
% `pathmorphing` is necessary to draw squiggly arrows.
\usetikzlibrary{decorations.pathmorphing}
% `spath3` is necessary to draw shortened edges.
\usetikzlibrary{spath3}

% A TikZ style for curved arrows of a fixed height, due to AndréC.
\tikzset{curve/.style={settings={#1},to path={(\tikztostart)
    .. controls ($(\tikztostart)!\pv{pos}!(\tikztotarget)!\pv{height}!270:(\tikztotarget)$)
    and ($(\tikztostart)!1-\pv{pos}!(\tikztotarget)!\pv{height}!270:(\tikztotarget)$)
    .. (\tikztotarget)\tikztonodes}},
    settings/.code={\tikzset{quiver/.cd,#1}
        \def\pv##1{\pgfkeysvalueof{/tikz/quiver/##1}}},
    quiver/.cd,pos/.initial=0.35,height/.initial=0}

% A TikZ style for shortening paths without the poor behaviour of `shorten <' and `shorten >'.
\tikzset{between/.style n args={2}{/tikz/spath/at end path construction={
    \tikzset{spath/split at keep middle={current}{#1}{#2}}
}}}

% TikZ arrowhead/tail styles.
\tikzset{tail reversed/.code={\pgfsetarrowsstart{tikzcd to}}}
\tikzset{2tail/.code={\pgfsetarrowsstart{Implies[reversed]}}}
\tikzset{2tail reversed/.code={\pgfsetarrowsstart{Implies}}}
% TikZ arrow styles.
\tikzset{no body/.style={/tikz/dash pattern=on 0 off 1mm}}


\newcommand{\triplecolon}{%
  \mathrel{\vbox{\baselineskip=2pt \hbox{.}\hbox{.}\hbox{.}}}%
}

\DeclareUnicodeCharacter{2AF6}{\triplecolon}
\usepackage{mathpartir}

]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[
\begin {tikzcd}
	{\mathsf {M}_0} & {\mathsf {M}_0} \\
	{\mathsf {M}_0} & {\mathsf {M}_0}
	\arrow [""{name=0, anchor=center, inner sep=0}, "\shortmid "{marking}, equals, from=1-1, to=1-2]
	\arrow [equals, from=1-1, to=2-1]
	\arrow [equals, from=1-2, to=2-2]
	\arrow [""{name=1, anchor=center, inner sep=0}, "{\mathsf {M}_1}"', "\shortmid "{marking}, from=2-1, to=2-2]
	\arrow ["{\mathrm {id}}", shorten <=4pt, shorten >=4pt, Rightarrow, from=0, to=1]
\end {tikzcd}
]]></fr:resource-source></fr:resource></html:figure>

<html:p>In terms of actual <fr:tex display="inline"><![CDATA[\mathbf {List}]]></fr:tex>-spans, this becomes.</html:p>



<html:figure><fr:resource hash="232748c1564b35d73de19d2dbe36014f"><fr:resource-content><html:img src="https://forest.topos.site/232748c1564b35d73de19d2dbe36014f.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[

\usepackage[utf8]{inputenc}
\DeclareFontFamily{U}{min}{}
\DeclareFontShape{U}{min}{m}{n}{<-> udmj30}{}
\newcommand\yo{\!\text{\usefont{U}{min}{m}{n}\symbol{'207}}\!}
\DeclareUnicodeCharacter{3088}{\yo}


\usepackage{tikz, tikz-cd, mathtools, amssymb, stmaryrd,xcolor}
\usetikzlibrary{matrix,arrows}
\usetikzlibrary{backgrounds,fit,positioning,calc,shapes}
\usetikzlibrary{decorations.pathreplacing}
\usetikzlibrary{decorations.pathmorphing}
\usetikzlibrary{decorations.markings}

% `tikz-cd` is necessary to draw commutative diagrams.
\RequirePackage{tikz-cd}
% `amssymb` is necessary for `\lrcorner` and `\ulcorner`.
\RequirePackage{amssymb}
% `calc` is necessary to draw curved arrows.
\usetikzlibrary{calc}
% `pathmorphing` is necessary to draw squiggly arrows.
\usetikzlibrary{decorations.pathmorphing}
% `spath3` is necessary to draw shortened edges.
\usetikzlibrary{spath3}

% A TikZ style for curved arrows of a fixed height, due to AndréC.
\tikzset{curve/.style={settings={#1},to path={(\tikztostart)
    .. controls ($(\tikztostart)!\pv{pos}!(\tikztotarget)!\pv{height}!270:(\tikztotarget)$)
    and ($(\tikztostart)!1-\pv{pos}!(\tikztotarget)!\pv{height}!270:(\tikztotarget)$)
    .. (\tikztotarget)\tikztonodes}},
    settings/.code={\tikzset{quiver/.cd,#1}
        \def\pv##1{\pgfkeysvalueof{/tikz/quiver/##1}}},
    quiver/.cd,pos/.initial=0.35,height/.initial=0}

% A TikZ style for shortening paths without the poor behaviour of `shorten <' and `shorten >'.
\tikzset{between/.style n args={2}{/tikz/spath/at end path construction={
    \tikzset{spath/split at keep middle={current}{#1}{#2}}
}}}

% TikZ arrowhead/tail styles.
\tikzset{tail reversed/.code={\pgfsetarrowsstart{tikzcd to}}}
\tikzset{2tail/.code={\pgfsetarrowsstart{Implies[reversed]}}}
\tikzset{2tail reversed/.code={\pgfsetarrowsstart{Implies}}}
% TikZ arrow styles.
\tikzset{no body/.style={/tikz/dash pattern=on 0 off 1mm}}


\newcommand{\triplecolon}{%
  \mathrel{\vbox{\baselineskip=2pt \hbox{.}\hbox{.}\hbox{.}}}%
}

\DeclareUnicodeCharacter{2AF6}{\triplecolon}
\usepackage{mathpartir}

]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[
\begin {tikzcd}
	{\mathbf {List}(\mathsf {M}_0)} & {\mathsf {M}_0} & {\mathsf {M}_0} \\
	{\mathbf {List}(\mathsf {M}_0)} & {\mathsf {C_1}} & {\mathsf {M}_0}
	\arrow [equals, from=1-1, to=2-1]
	\arrow ["{\eta _{\mathbf {List}}}"', from=1-2, to=1-1]
	\arrow [equals, from=1-2, to=1-3]
	\arrow ["{\mathrm {id}}", from=1-2, to=2-2]
	\arrow [equals, from=1-3, to=2-3]
	\arrow ["{\partial _0}", from=2-2, to=2-1]
	\arrow ["{\partial _1}"', from=2-2, to=2-3]
\end {tikzcd}
]]></fr:resource-source></fr:resource></html:figure>

<html:p>The multiplication for <fr:tex display="inline"><![CDATA[\mathsf {M}]]></fr:tex> implements the composition of multimorphisms. Double categorically, this looks like:</html:p>



<html:figure><fr:resource hash="01fa5b5ab6bc93ff73eea09b99a918ab"><fr:resource-content><html:img src="https://forest.topos.site/01fa5b5ab6bc93ff73eea09b99a918ab.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[

\usepackage[utf8]{inputenc}
\DeclareFontFamily{U}{min}{}
\DeclareFontShape{U}{min}{m}{n}{<-> udmj30}{}
\newcommand\yo{\!\text{\usefont{U}{min}{m}{n}\symbol{'207}}\!}
\DeclareUnicodeCharacter{3088}{\yo}


\usepackage{tikz, tikz-cd, mathtools, amssymb, stmaryrd,xcolor}
\usetikzlibrary{matrix,arrows}
\usetikzlibrary{backgrounds,fit,positioning,calc,shapes}
\usetikzlibrary{decorations.pathreplacing}
\usetikzlibrary{decorations.pathmorphing}
\usetikzlibrary{decorations.markings}

% `tikz-cd` is necessary to draw commutative diagrams.
\RequirePackage{tikz-cd}
% `amssymb` is necessary for `\lrcorner` and `\ulcorner`.
\RequirePackage{amssymb}
% `calc` is necessary to draw curved arrows.
\usetikzlibrary{calc}
% `pathmorphing` is necessary to draw squiggly arrows.
\usetikzlibrary{decorations.pathmorphing}
% `spath3` is necessary to draw shortened edges.
\usetikzlibrary{spath3}

% A TikZ style for curved arrows of a fixed height, due to AndréC.
\tikzset{curve/.style={settings={#1},to path={(\tikztostart)
    .. controls ($(\tikztostart)!\pv{pos}!(\tikztotarget)!\pv{height}!270:(\tikztotarget)$)
    and ($(\tikztostart)!1-\pv{pos}!(\tikztotarget)!\pv{height}!270:(\tikztotarget)$)
    .. (\tikztotarget)\tikztonodes}},
    settings/.code={\tikzset{quiver/.cd,#1}
        \def\pv##1{\pgfkeysvalueof{/tikz/quiver/##1}}},
    quiver/.cd,pos/.initial=0.35,height/.initial=0}

% A TikZ style for shortening paths without the poor behaviour of `shorten <' and `shorten >'.
\tikzset{between/.style n args={2}{/tikz/spath/at end path construction={
    \tikzset{spath/split at keep middle={current}{#1}{#2}}
}}}

% TikZ arrowhead/tail styles.
\tikzset{tail reversed/.code={\pgfsetarrowsstart{tikzcd to}}}
\tikzset{2tail/.code={\pgfsetarrowsstart{Implies[reversed]}}}
\tikzset{2tail reversed/.code={\pgfsetarrowsstart{Implies}}}
% TikZ arrow styles.
\tikzset{no body/.style={/tikz/dash pattern=on 0 off 1mm}}


\newcommand{\triplecolon}{%
  \mathrel{\vbox{\baselineskip=2pt \hbox{.}\hbox{.}\hbox{.}}}%
}

\DeclareUnicodeCharacter{2AF6}{\triplecolon}
\usepackage{mathpartir}

]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[
\begin {tikzcd}
	{\mathsf {M}_0} & {\mathsf {M}_0} & {\mathsf {M}_0} \\
	{\mathsf {M}_0} & \bullet  & {\mathsf {M}_0}
	\arrow ["{\mathsf {M}_1}", "\shortmid "{marking}, from=1-1, to=1-2]
	\arrow [equals, from=1-1, to=2-1]
	\arrow ["{\mathsf {M}_1}", "\shortmid "{marking}, from=1-2, to=1-3]
	\arrow ["{\mathrm {compose}}", Rightarrow, from=1-2, to=2-2]
	\arrow [equals, from=1-3, to=2-3]
	\arrow ["{\mathsf {M}_1}"', "\shortmid "{marking}, from=2-1, to=2-3]
\end {tikzcd}
]]></fr:resource-source></fr:resource></html:figure>

<html:p>If we work this out in terms of actual <fr:tex display="inline"><![CDATA[\mathbf {List}]]></fr:tex> spans, it looks like the following:</html:p>



<html:figure><fr:resource hash="441fdd19a84c9efb1418a35a4d522af7"><fr:resource-content><html:img src="https://forest.topos.site/441fdd19a84c9efb1418a35a4d522af7.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[

\usepackage[utf8]{inputenc}
\DeclareFontFamily{U}{min}{}
\DeclareFontShape{U}{min}{m}{n}{<-> udmj30}{}
\newcommand\yo{\!\text{\usefont{U}{min}{m}{n}\symbol{'207}}\!}
\DeclareUnicodeCharacter{3088}{\yo}


\usepackage{tikz, tikz-cd, mathtools, amssymb, stmaryrd,xcolor}
\usetikzlibrary{matrix,arrows}
\usetikzlibrary{backgrounds,fit,positioning,calc,shapes}
\usetikzlibrary{decorations.pathreplacing}
\usetikzlibrary{decorations.pathmorphing}
\usetikzlibrary{decorations.markings}

% `tikz-cd` is necessary to draw commutative diagrams.
\RequirePackage{tikz-cd}
% `amssymb` is necessary for `\lrcorner` and `\ulcorner`.
\RequirePackage{amssymb}
% `calc` is necessary to draw curved arrows.
\usetikzlibrary{calc}
% `pathmorphing` is necessary to draw squiggly arrows.
\usetikzlibrary{decorations.pathmorphing}
% `spath3` is necessary to draw shortened edges.
\usetikzlibrary{spath3}

% A TikZ style for curved arrows of a fixed height, due to AndréC.
\tikzset{curve/.style={settings={#1},to path={(\tikztostart)
    .. controls ($(\tikztostart)!\pv{pos}!(\tikztotarget)!\pv{height}!270:(\tikztotarget)$)
    and ($(\tikztostart)!1-\pv{pos}!(\tikztotarget)!\pv{height}!270:(\tikztotarget)$)
    .. (\tikztotarget)\tikztonodes}},
    settings/.code={\tikzset{quiver/.cd,#1}
        \def\pv##1{\pgfkeysvalueof{/tikz/quiver/##1}}},
    quiver/.cd,pos/.initial=0.35,height/.initial=0}

% A TikZ style for shortening paths without the poor behaviour of `shorten <' and `shorten >'.
\tikzset{between/.style n args={2}{/tikz/spath/at end path construction={
    \tikzset{spath/split at keep middle={current}{#1}{#2}}
}}}

% TikZ arrowhead/tail styles.
\tikzset{tail reversed/.code={\pgfsetarrowsstart{tikzcd to}}}
\tikzset{2tail/.code={\pgfsetarrowsstart{Implies[reversed]}}}
\tikzset{2tail reversed/.code={\pgfsetarrowsstart{Implies}}}
% TikZ arrow styles.
\tikzset{no body/.style={/tikz/dash pattern=on 0 off 1mm}}


\newcommand{\triplecolon}{%
  \mathrel{\vbox{\baselineskip=2pt \hbox{.}\hbox{.}\hbox{.}}}%
}

\DeclareUnicodeCharacter{2AF6}{\triplecolon}
\usepackage{mathpartir}

]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[
\begin {tikzcd}
	&&& {\mathbf {List}(\mathsf {M}_0)} \\
	&& {\mathbf {List}(\mathsf {M}_1)} && {\mathsf {M}_1} \\
	{\mathbf {List}(\mathsf {M}_0)} & {\mathbf {List}(\mathbf {List}(\mathsf {M}_0))} && {} && {\mathsf {M}_0} \\
	{\mathbf {List}(\mathsf {M}_0)} &&& {\mathsf {C_1}} && {\mathsf {M}_0}
	\arrow ["{\mathbf {List}(\partial _1)}", from=2-3, to=1-4]
	\arrow ["{\mathbf {List}(\partial _0)}"', from=2-3, to=3-2]
	\arrow ["{\partial _0}"', from=2-5, to=1-4]
	\arrow ["{\partial _1}", from=2-5, to=3-6]
	\arrow [equals, from=3-1, to=4-1]
	\arrow ["{\mu _{\mathbf {List}}}"', from=3-2, to=3-1]
	\arrow ["\lrcorner "{anchor=center, pos=0.125, rotate=135}, draw=none, from=3-4, to=1-4]
	\arrow [from=3-4, to=2-3]
	\arrow [from=3-4, to=2-5]
	\arrow ["{\mathrm {compose}}", from=3-4, to=4-4]
	\arrow [equals, from=3-6, to=4-6]
	\arrow ["{\partial _0}", from=4-4, to=4-1]
	\arrow ["{\partial _1}"', from=4-4, to=4-6]
\end {tikzcd}
]]></fr:resource-source></fr:resource></html:figure>

<html:p>It is a little hard to parse, but with some thought the reader can work out that the apex of the span composition consists of the set of pairs <fr:tex display="inline"><![CDATA[([g_1,\ldots ,g_n], f)]]></fr:tex> with <fr:tex display="inline"><![CDATA[[\partial _1(g_1),\ldots ,\partial _1(g_n)] = \partial _0(f)]]></fr:tex>, which is precisely the setup for multimorphism composition in <fr:link href="/ocl-008H/" title="Multicategory" uri="https://forest.topos.site/ocl-008H/" display-uri="https://forest.topos.site/ocl-008H" type="local">informal definition <fr:contextual-number uri="https://forest.topos.site/ocl-008H/" display-uri="https://forest.topos.site/ocl-008H" /></fr:link>.</html:p></fr:mainmatter>
                </fr:tree>
                <html:p>We now give a hint as to how the semantics of <fr:tex display="inline"><![CDATA[\mathbb {S}]]></fr:tex> will work. We cannot give the full semantics yet, because the full semantics are in <html:em>cartesian</html:em> multicategories and we have not yet defined cartesian multicategories, but we can start to give the correspondence between multicategories and type theory that will eventually turn into a proper semantics, and this will help motivate why we care about cartesian multicategories.</html:p>
                <fr:tree show-metadata="false">
                  <fr:frontmatter>
                    <fr:authors>
                      <fr:author>
                        <fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link>
                      </fr:author>
                    </fr:authors>
                    <fr:date>
                      <fr:year>2025</fr:year>
                      <fr:month>3</fr:month>
                      <fr:day>2</fr:day>
                    </fr:date>
                    <fr:uri>https://forest.topos.site/ocl-008K/</fr:uri>
                    <fr:display-uri>https://forest.topos.site/ocl-008K</fr:display-uri>
                    <fr:route>/ocl-008K/</fr:route>
                    <fr:title text="A correspondence between \mathbb {S} and multicategory theory">A correspondence between <fr:tex display="inline"><![CDATA[\mathbb {S}]]></fr:tex> and multicategory theory</fr:title>
                  </fr:frontmatter>
                  <fr:mainmatter>
                    <html:p>We present the correspondence via a translation table. In the type theory column we give judgments, and in the multicategory theory column we say how they translate into the setting of multicategories.</html:p>
                    <fr:tree show-metadata="false">
                      <fr:frontmatter>
                        <fr:authors>
                          <fr:author>
                            <fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link>
                          </fr:author>
                        </fr:authors>
                        <fr:date>
                          <fr:year>2025</fr:year>
                          <fr:month>3</fr:month>
                          <fr:day>2</fr:day>
                        </fr:date>
                        <fr:title text="Judgments in simple type theory and their semantics">Judgments in simple type theory and their semantics</fr:title>
                        <fr:taxon>table</fr:taxon>
                      </fr:frontmatter>
                      <fr:mainmatter>
                        <html:table>
                          <html:thead>
<html:tr><html:th>Simple type theory</html:th><html:th>Multicategory theory</html:th></html:tr>
</html:thead>
                          <html:tbody>
<html:tr><html:td><fr:tex display="inline"><![CDATA[A \,\,\mathsf {type}]]></fr:tex></html:td><html:td><fr:tex display="inline"><![CDATA[A]]></fr:tex> is an object</html:td></html:tr>
<html:tr><html:td><fr:tex display="inline"><![CDATA[x_1 \colon  A_1,\ldots ,x_n \colon  A_n \,\vdash \, b \colon  B]]></fr:tex></html:td><html:td><fr:tex display="inline"><![CDATA[b]]></fr:tex> is a multimorphism from <fr:tex display="inline"><![CDATA[[A_1,\ldots ,A_n]]]></fr:tex> to <fr:tex display="inline"><![CDATA[B]]></fr:tex></html:td></html:tr>
<html:tr><html:td><fr:tex display="inline"><![CDATA[x_1 \colon  A_1,\ldots ,x_n \colon  A_n \,\vdash \, b = b' \colon  B]]></fr:tex></html:td><html:td><fr:tex display="inline"><![CDATA[b]]></fr:tex> and <fr:tex display="inline"><![CDATA[b']]></fr:tex> are equal multimorphisms.</html:td></html:tr>
<html:tr><html:td><fr:tex display="inline"><![CDATA[x \colon  A \,\vdash \, x \colon  A]]></fr:tex></html:td><html:td>The identity multimorphism on <fr:tex display="inline"><![CDATA[A]]></fr:tex></html:td></html:tr>
</html:tbody>
                        </html:table>
                      </fr:mainmatter>
                    </fr:tree>
                    <html:p>We can now say why we use multicategories rather than just categories: multicategories more faithfully reflect the fact that a context consists of a list of varaibles.</html:p>
                    <html:p>We cannot yet interpret <fr:link href="/ocl-008A/" title="The weakening rule for \mathbb {S}" uri="https://forest.topos.site/ocl-008A/" display-uri="https://forest.topos.site/ocl-008A" type="local">rule <fr:contextual-number uri="https://forest.topos.site/ocl-008A/" display-uri="https://forest.topos.site/ocl-008A" /></fr:link> or <fr:link href="/ocl-008B/" title="The substitution rule for \mathbb {S}" uri="https://forest.topos.site/ocl-008B/" display-uri="https://forest.topos.site/ocl-008B" type="local">rule <fr:contextual-number uri="https://forest.topos.site/ocl-008B/" display-uri="https://forest.topos.site/ocl-008B" /></fr:link>; to do that we need to first introduce <html:em>cartesian</html:em> multicategories.</html:p>
                  </fr:mainmatter>
                </fr:tree>
                <html:p>Intuitively, a cartesian multicategory is the multicategory version of a cartesian monoidal category. The following definition is somewhat dense, but we follow it with explication that makes the connection clearer.</html:p>
                <fr:tree show-metadata="false">
                  <fr:frontmatter>
                    <fr:authors />
                    <fr:date>
                      <fr:year>2025</fr:year>
                      <fr:month>2</fr:month>
                      <fr:day>12</fr:day>
                    </fr:date>
                    <fr:uri>https://forest.topos.site/ocl-006C/</fr:uri>
                    <fr:display-uri>https://forest.topos.site/ocl-006C</fr:display-uri>
                    <fr:route>/ocl-006C/</fr:route>
                    <fr:title text="Cartesian multicategory">Cartesian multicategory</fr:title>
                    <fr:taxon>definition</fr:taxon>
                  </fr:frontmatter>
                  <fr:mainmatter>
                    <html:p>The following is distilled from <fr:link href="/shulman-2016-catlog/" title="Categorical logic from a categorical point of view" uri="https://forest.topos.site/shulman-2016-catlog/" display-uri="https://forest.topos.site/shulman-2016-catlog" type="local">Categorical logic from a categorical point of view</fr:link>, page 116.</html:p>
                    <html:p>A <html:strong>cartesian multicategory</html:strong> is a multicategory <fr:tex display="inline"><![CDATA[\mathsf {M}]]></fr:tex> equipped with operations</html:p>
                    <fr:tex display="block"><![CDATA[\mathsf {M}(A_{\sigma  1}, \ldots , A_{\sigma  m}; B) \to  \mathsf {M}(A_1,\ldots , A_n; B)]]></fr:tex>
                    <fr:tex display="block"><![CDATA[f \mapsto  f\sigma ^\ast ]]></fr:tex>
                    <html:p>for all functions <fr:tex display="inline"><![CDATA[\sigma  \colon  \{1,\ldots ,m\} \to  \{1,\ldots ,n\}]]></fr:tex>, satisfying the following axioms</html:p>
                    <html:ul><html:li><fr:tex display="inline"><![CDATA[f\sigma ^\ast \tau ^\ast  = f(\tau  \sigma )^\ast ]]></fr:tex></html:li>
<html:li><fr:tex display="inline"><![CDATA[f(\mathrm {id}_n^\ast ) = f]]></fr:tex></html:li>
<html:li><fr:tex display="inline"><![CDATA[g \circ  (f_1\sigma ^\ast ,\ldots ,f_n\sigma ^\ast ) = (g \circ  (f_1,\ldots ,f_n))(\sigma _1 \sqcup  \cdots  \sqcup  \sigma _n)^\ast ]]></fr:tex></html:li>
<html:li><fr:tex display="inline"><![CDATA[g\sigma ^\ast  \circ  (f_1,\ldots ,f_n) = (g \circ  (f_{\sigma  1},\ldots ,f_{\sigma  m}))(\sigma  \wr  (k_1,\ldots ,k_n))^\ast ]]></fr:tex>, where <fr:tex display="inline"><![CDATA[k_i]]></fr:tex> is the arity of <fr:tex display="inline"><![CDATA[f_i]]></fr:tex> and <fr:tex display="inline"><![CDATA[\sigma  \wr  (k_1,\ldots ,k_n)]]></fr:tex> is <fr:tex display="inline"><![CDATA[\sigma ]]></fr:tex> lifted in the natural way to be a function <fr:tex display="inline"><![CDATA[\{1,\ldots , k_1\} \sqcup  \cdots  \sqcup  \{1,\ldots ,k_m\} \to  \{1,\ldots ,k_{\sigma  1}\} \sqcup  \cdots  \sqcup  \{1,\ldots ,k_{\sigma  n}\}]]></fr:tex> which is “block-wise the identity”.</html:li></html:ul>
                  </fr:mainmatter>
                </fr:tree>
                <fr:tree show-metadata="false">
                  <fr:frontmatter>
                    <fr:authors />
                    <fr:date>
                      <fr:year>2025</fr:year>
                      <fr:month>2</fr:month>
                      <fr:day>12</fr:day>
                    </fr:date>
                    <fr:uri>https://forest.topos.site/ocl-006D/</fr:uri>
                    <fr:display-uri>https://forest.topos.site/ocl-006D</fr:display-uri>
                    <fr:route>/ocl-006D/</fr:route>
                    <fr:title text="Unpacking the definition of Cartesian multicategory">Unpacking the definition of <fr:link href="/ocl-006C/" title="Cartesian multicategory" uri="https://forest.topos.site/ocl-006C/" display-uri="https://forest.topos.site/ocl-006C" type="local">Cartesian multicategory</fr:link></fr:title>
                  </fr:frontmatter>
                  <fr:mainmatter>
                    <html:p>We can understand the meaning of <fr:link href="/ocl-006C/" title="Cartesian multicategory" uri="https://forest.topos.site/ocl-006C/" display-uri="https://forest.topos.site/ocl-006C" type="local">Cartesian multicategory</fr:link> by considering certain special classes of <fr:tex display="inline"><![CDATA[\sigma ]]></fr:tex>.</html:p>
                    <html:ul><html:li>In the special case where <fr:tex display="inline"><![CDATA[\sigma ]]></fr:tex> is a bijection, we can see that the operation <fr:tex display="inline"><![CDATA[f \mapsto  f \sigma ^\ast ]]></fr:tex> makes <fr:tex display="inline"><![CDATA[M]]></fr:tex> into a symmetric multicategory.</html:li>
<html:li>In the special case where <fr:tex display="inline"><![CDATA[\sigma  \colon  \{1\} \to  \{1,\ldots ,n\}]]></fr:tex>, we get the projections <fr:tex display="inline"><![CDATA[\mathrm {id}_{A_{\sigma  1}} \sigma ^\ast  \colon  M(A_1,\ldots ,A_n; A_{\sigma _1})]]></fr:tex>. These interpret the extended variable rule <fr:link href="/ocl-008C/" title="An alternative variable rule for \mathbb {S}" uri="https://forest.topos.site/ocl-008C/" display-uri="https://forest.topos.site/ocl-008C" type="local">rule <fr:contextual-number uri="https://forest.topos.site/ocl-008C/" display-uri="https://forest.topos.site/ocl-008C" /></fr:link>.</html:li>
<html:li>In the special case where <fr:tex display="inline"><![CDATA[\sigma ]]></fr:tex> is an injection, we get weakening (<fr:link href="/ocl-008A/" title="The weakening rule for \mathbb {S}" uri="https://forest.topos.site/ocl-008A/" display-uri="https://forest.topos.site/ocl-008A" type="local">rule <fr:contextual-number uri="https://forest.topos.site/ocl-008A/" display-uri="https://forest.topos.site/ocl-008A" /></fr:link>).</html:li>
<html:li>Combining a special surjective <fr:tex display="inline"><![CDATA[\sigma ]]></fr:tex> with multimorphism composition, we may derive <fr:link href="/ocl-008B/" title="The substitution rule for \mathbb {S}" uri="https://forest.topos.site/ocl-008B/" display-uri="https://forest.topos.site/ocl-008B" type="local">rule <fr:contextual-number uri="https://forest.topos.site/ocl-008B/" display-uri="https://forest.topos.site/ocl-008B" /></fr:link>.</html:li></html:ul>
                    <html:p>In general, the action of various <fr:tex display="inline"><![CDATA[\sigma ]]></fr:tex> means that when we form terms in a simple type theory, we may use each variable as many times as we like in any order that we like.</html:p>
                  </fr:mainmatter>
                </fr:tree>
                <fr:tree show-metadata="false">
                  <fr:frontmatter>
                    <fr:authors>
                      <fr:author>
                        <fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link>
                      </fr:author>
                    </fr:authors>
                    <fr:date>
                      <fr:year>2025</fr:year>
                      <fr:month>3</fr:month>
                      <fr:day>3</fr:day>
                    </fr:date>
                    <fr:uri>https://forest.topos.site/ocl-008M/</fr:uri>
                    <fr:display-uri>https://forest.topos.site/ocl-008M</fr:display-uri>
                    <fr:route>/ocl-008M/</fr:route>
                    <fr:title text="Contrasting cartesian multicategories with cartesian categories.">Contrasting cartesian multicategories with cartesian categories.</fr:title>
                  </fr:frontmatter>
                  <fr:mainmatter>
                    <html:p>With the following two definitions, we can go back and forth between cartesian multicategories and cartesian categories.</html:p>
                    <fr:tree show-metadata="false">
                      <fr:frontmatter>
                        <fr:authors>
                          <fr:author>
                            <fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link>
                          </fr:author>
                        </fr:authors>
                        <fr:date>
                          <fr:year>2025</fr:year>
                          <fr:month>3</fr:month>
                          <fr:day>8</fr:day>
                        </fr:date>
                        <fr:uri>https://forest.topos.site/ocl-0098/</fr:uri>
                        <fr:display-uri>https://forest.topos.site/ocl-0098</fr:display-uri>
                        <fr:route>/ocl-0098/</fr:route>
                        <fr:title text="The multicategory of tuple-argument morphisms associated to a cartesian category">The multicategory of tuple-argument morphisms associated to a cartesian category</fr:title>
                        <fr:taxon>definition</fr:taxon>
                      </fr:frontmatter>
                      <fr:mainmatter>
                        <html:p>Given a cartesian category <fr:tex display="inline"><![CDATA[\mathsf {C}]]></fr:tex> we may associate to it a multicategory <fr:tex display="inline"><![CDATA[\mathsf {TA}(\mathsf {C})]]></fr:tex> of <html:strong>tuple-argument morphisms</html:strong>, where the objects of <fr:tex display="inline"><![CDATA[\mathsf {TA}(\mathsf {C})]]></fr:tex> are the objects of <fr:tex display="inline"><![CDATA[\mathsf {C}]]></fr:tex> and the multimorphisms of <fr:tex display="inline"><![CDATA[\mathsf {TA}(\mathsf {C})]]></fr:tex> from <fr:tex display="inline"><![CDATA[[A_1,\ldots ,A_n]]]></fr:tex> to <fr:tex display="inline"><![CDATA[B]]></fr:tex> are the morphisms <fr:tex display="inline"><![CDATA[A_1 \times  \cdots  \times  A_n \to  B]]></fr:tex> in <fr:tex display="inline"><![CDATA[\mathsf {C}]]></fr:tex>.</html:p>
                        <html:p>This category is so named because it reflects the fact that in a programming language with no multi-argument functions but with tuple types, one can simulate a multi-argument function via a function out of a tuple type.</html:p>
                      </fr:mainmatter>
                    </fr:tree>
                    <fr:tree show-metadata="false">
                      <fr:frontmatter>
                        <fr:authors>
                          <fr:author>
                            <fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link>
                          </fr:author>
                        </fr:authors>
                        <fr:date>
                          <fr:year>2025</fr:year>
                          <fr:month>3</fr:month>
                          <fr:day>8</fr:day>
                        </fr:date>
                        <fr:uri>https://forest.topos.site/ocl-0099/</fr:uri>
                        <fr:display-uri>https://forest.topos.site/ocl-0099</fr:display-uri>
                        <fr:route>/ocl-0099/</fr:route>
                        <fr:title text="The cartesian category of substitutions associated to a cartesian multicategory">The cartesian category of substitutions associated to a cartesian multicategory</fr:title>
                        <fr:taxon>definition</fr:taxon>
                      </fr:frontmatter>
                      <fr:mainmatter>
                        <html:p>Given a cartesian multicategory <fr:tex display="inline"><![CDATA[\mathsf {M}]]></fr:tex>, we may form a cartesian category
<fr:tex display="inline"><![CDATA[\mathsf {Subst}(\mathsf {M})]]></fr:tex>. The objects of <fr:tex display="inline"><![CDATA[\mathsf {Subst}(\mathsf {M})]]></fr:tex>
are lists of objects in <fr:tex display="inline"><![CDATA[\mathsf {M}]]></fr:tex> and a morphism from <fr:tex display="inline"><![CDATA[[A_1,\ldots ,A_n] \to 
[B_1,\ldots ,B_m]]]></fr:tex> is a list <fr:tex display="inline"><![CDATA[[f_1,\ldots ,f_m]]]></fr:tex> of multimorphisms where <fr:tex display="inline"><![CDATA[f_i
\colon  [A_1,\ldots ,A_n] \to  B_i]]></fr:tex>. The cartesian product is then given by list
appending. We call this the <html:strong>category of substitutions</html:strong> for <fr:tex display="inline"><![CDATA[\mathsf {M}]]></fr:tex>,
in reference to the fact that if <fr:tex display="inline"><![CDATA[\mathsf {M}]]></fr:tex> is modeling a simple type theory
then a morphism in <fr:tex display="inline"><![CDATA[F(\mathsf {M})]]></fr:tex> is precisely a substitution between contexts. That is, each “variable” in <fr:tex display="inline"><![CDATA[y_1 \colon  B_1, \ldots , y_n \colon  B_m]]></fr:tex> is assigned a “term” <fr:tex display="inline"><![CDATA[f_i(x_1,\ldots ,x_n)]]></fr:tex> in <fr:tex display="inline"><![CDATA[x_1 \colon  A_1, \ldots , x_n \colon  A_n]]></fr:tex>.</html:p>
                      </fr:mainmatter>
                    </fr:tree>
                    <html:p>For those who like 2-category theory, <fr:tex display="inline"><![CDATA[\mathsf {TA}]]></fr:tex> and <fr:tex display="inline"><![CDATA[\mathsf {Subst}]]></fr:tex> form a 2-adjunction between the 2-category of cartesian categories and the 2-category of cartesian multicategories. The core of this 2-adjunction is given by the 2-category of cartesian categories, which is identified with the 2-category of representable cartesian multicategories as we will see in <fr:link href="/ocl-0092/" title="Representable cartesian multicategory" uri="https://forest.topos.site/ocl-0092/" display-uri="https://forest.topos.site/ocl-0092" type="local">definition <fr:contextual-number uri="https://forest.topos.site/ocl-0092/" display-uri="https://forest.topos.site/ocl-0092" /></fr:link>.</html:p>
                    <html:p>So there is a close connection between cartesian categories and cartesian multicategories. Why then do we use cartesian multicategories as opposed to cartesian categories to model simple type theory? There are several reasons.</html:p>
                    <html:ol><html:li>As we noted before in <fr:link href="/ocl-008K/" title="A correspondence between \mathbb {S} and multicategory theory" uri="https://forest.topos.site/ocl-008K/" display-uri="https://forest.topos.site/ocl-008K" type="local">§ <fr:contextual-number uri="https://forest.topos.site/ocl-008K/" display-uri="https://forest.topos.site/ocl-008K" /></fr:link>, multicategories more faithfully reflect the fact that a context consists of a list of variables.</html:li>
<html:li>Given a category where products exist, one must equip it with a choice of products in order to talk about multimorphisms, and this choice of products is non-canonical. However, to define a cartesian multicategory, one need not make any non-canonical choices.</html:li></html:ol>
                  </fr:mainmatter>
                </fr:tree>
              </fr:mainmatter>
            </fr:tree>
            <fr:tree show-metadata="false">
              <fr:frontmatter>
                <fr:authors>
                  <fr:author>
                    <fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link>
                  </fr:author>
                </fr:authors>
                <fr:date>
                  <fr:year>2025</fr:year>
                  <fr:month>3</fr:month>
                  <fr:day>3</fr:day>
                </fr:date>
                <fr:uri>https://forest.topos.site/ocl-008N/</fr:uri>
                <fr:display-uri>https://forest.topos.site/ocl-008N</fr:display-uri>
                <fr:route>/ocl-008N/</fr:route>
                <fr:title text="Model theory of free simple type 1-theories">Model theory of free simple type 1-theories</fr:title>
              </fr:frontmatter>
              <fr:mainmatter>
                <html:p>In general, the formal relationship between type theory and category theory is that the syntax of a specific type theory forms the initial object of a corresponding category of models.</html:p>
                <html:p>In this section, we discuss how this works in the special case of free simple type 1-theories.</html:p>
                <html:p>In <fr:link href="/ocl-008E/" title="The 1-theory of graphs in \mathbb {S}" uri="https://forest.topos.site/ocl-008E/" display-uri="https://forest.topos.site/ocl-008E" type="local">example <fr:contextual-number uri="https://forest.topos.site/ocl-008E/" display-uri="https://forest.topos.site/ocl-008E" /></fr:link> and <fr:link href="/ocl-008D/" title="The 1-theory of monoids in \mathbb {S}" uri="https://forest.topos.site/ocl-008D/" display-uri="https://forest.topos.site/ocl-008D" type="local">example <fr:contextual-number uri="https://forest.topos.site/ocl-008D/" display-uri="https://forest.topos.site/ocl-008D" /></fr:link> we gave some examples of simple type 1-theories. In general, a simple type 1-theory involves types, terms, and equations. A free simple type 1-theory only involves types and terms, and it can be presented by a <html:em>multigraph</html:em>.</html:p>
                <fr:tree show-metadata="false">
                  <fr:frontmatter>
                    <fr:authors>
                      <fr:author>
                        <fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link>
                      </fr:author>
                    </fr:authors>
                    <fr:date>
                      <fr:year>2025</fr:year>
                      <fr:month>3</fr:month>
                      <fr:day>6</fr:day>
                    </fr:date>
                    <fr:uri>https://forest.topos.site/ocl-008P/</fr:uri>
                    <fr:display-uri>https://forest.topos.site/ocl-008P</fr:display-uri>
                    <fr:route>/ocl-008P/</fr:route>
                    <fr:title text="Multigraphs">Multigraphs</fr:title>
                    <fr:taxon>definition</fr:taxon>
                  </fr:frontmatter>
                  <fr:mainmatter><html:p>A <html:strong>multigraph</html:strong> is an endomorphism in the category of <fr:tex display="inline"><![CDATA[\mathbf {List}]]></fr:tex>-spans.</html:p><html:p>More concretely, a <html:strong>multigraph</html:strong> consists of a set <fr:tex display="inline"><![CDATA[V]]></fr:tex> of vertices, a set <fr:tex display="inline"><![CDATA[E]]></fr:tex> of edges, and a <fr:tex display="inline"><![CDATA[\mathbf {List}]]></fr:tex>-span</html:p>



<html:figure><fr:resource hash="1397d2db3b9018908effc7e32caf9eef"><fr:resource-content><html:img src="https://forest.topos.site/1397d2db3b9018908effc7e32caf9eef.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[

\usepackage[utf8]{inputenc}
\DeclareFontFamily{U}{min}{}
\DeclareFontShape{U}{min}{m}{n}{<-> udmj30}{}
\newcommand\yo{\!\text{\usefont{U}{min}{m}{n}\symbol{'207}}\!}
\DeclareUnicodeCharacter{3088}{\yo}


\usepackage{tikz, tikz-cd, mathtools, amssymb, stmaryrd,xcolor}
\usetikzlibrary{matrix,arrows}
\usetikzlibrary{backgrounds,fit,positioning,calc,shapes}
\usetikzlibrary{decorations.pathreplacing}
\usetikzlibrary{decorations.pathmorphing}
\usetikzlibrary{decorations.markings}

% `tikz-cd` is necessary to draw commutative diagrams.
\RequirePackage{tikz-cd}
% `amssymb` is necessary for `\lrcorner` and `\ulcorner`.
\RequirePackage{amssymb}
% `calc` is necessary to draw curved arrows.
\usetikzlibrary{calc}
% `pathmorphing` is necessary to draw squiggly arrows.
\usetikzlibrary{decorations.pathmorphing}
% `spath3` is necessary to draw shortened edges.
\usetikzlibrary{spath3}

% A TikZ style for curved arrows of a fixed height, due to AndréC.
\tikzset{curve/.style={settings={#1},to path={(\tikztostart)
    .. controls ($(\tikztostart)!\pv{pos}!(\tikztotarget)!\pv{height}!270:(\tikztotarget)$)
    and ($(\tikztostart)!1-\pv{pos}!(\tikztotarget)!\pv{height}!270:(\tikztotarget)$)
    .. (\tikztotarget)\tikztonodes}},
    settings/.code={\tikzset{quiver/.cd,#1}
        \def\pv##1{\pgfkeysvalueof{/tikz/quiver/##1}}},
    quiver/.cd,pos/.initial=0.35,height/.initial=0}

% A TikZ style for shortening paths without the poor behaviour of `shorten <' and `shorten >'.
\tikzset{between/.style n args={2}{/tikz/spath/at end path construction={
    \tikzset{spath/split at keep middle={current}{#1}{#2}}
}}}

% TikZ arrowhead/tail styles.
\tikzset{tail reversed/.code={\pgfsetarrowsstart{tikzcd to}}}
\tikzset{2tail/.code={\pgfsetarrowsstart{Implies[reversed]}}}
\tikzset{2tail reversed/.code={\pgfsetarrowsstart{Implies}}}
% TikZ arrow styles.
\tikzset{no body/.style={/tikz/dash pattern=on 0 off 1mm}}


\newcommand{\triplecolon}{%
  \mathrel{\vbox{\baselineskip=2pt \hbox{.}\hbox{.}\hbox{.}}}%
}

\DeclareUnicodeCharacter{2AF6}{\triplecolon}
\usepackage{mathpartir}

]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[
\begin {tikzcd}
	& E \\
	{\mathbf {List}(V)} && V
	\arrow ["{\mathrm {src}}"', from=1-2, to=2-1]
	\arrow ["{\mathrm {tgt}}", from=1-2, to=2-3]
\end {tikzcd}
]]></fr:resource-source></fr:resource></html:figure>

<html:p>There is a category of multigraphs, where a morphism is of the form</html:p>



<html:figure><fr:resource hash="3d872310dfe80f6e91a6253faa249afe"><fr:resource-content><html:img src="https://forest.topos.site/3d872310dfe80f6e91a6253faa249afe.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[

\usepackage[utf8]{inputenc}
\DeclareFontFamily{U}{min}{}
\DeclareFontShape{U}{min}{m}{n}{<-> udmj30}{}
\newcommand\yo{\!\text{\usefont{U}{min}{m}{n}\symbol{'207}}\!}
\DeclareUnicodeCharacter{3088}{\yo}


\usepackage{tikz, tikz-cd, mathtools, amssymb, stmaryrd,xcolor}
\usetikzlibrary{matrix,arrows}
\usetikzlibrary{backgrounds,fit,positioning,calc,shapes}
\usetikzlibrary{decorations.pathreplacing}
\usetikzlibrary{decorations.pathmorphing}
\usetikzlibrary{decorations.markings}

% `tikz-cd` is necessary to draw commutative diagrams.
\RequirePackage{tikz-cd}
% `amssymb` is necessary for `\lrcorner` and `\ulcorner`.
\RequirePackage{amssymb}
% `calc` is necessary to draw curved arrows.
\usetikzlibrary{calc}
% `pathmorphing` is necessary to draw squiggly arrows.
\usetikzlibrary{decorations.pathmorphing}
% `spath3` is necessary to draw shortened edges.
\usetikzlibrary{spath3}

% A TikZ style for curved arrows of a fixed height, due to AndréC.
\tikzset{curve/.style={settings={#1},to path={(\tikztostart)
    .. controls ($(\tikztostart)!\pv{pos}!(\tikztotarget)!\pv{height}!270:(\tikztotarget)$)
    and ($(\tikztostart)!1-\pv{pos}!(\tikztotarget)!\pv{height}!270:(\tikztotarget)$)
    .. (\tikztotarget)\tikztonodes}},
    settings/.code={\tikzset{quiver/.cd,#1}
        \def\pv##1{\pgfkeysvalueof{/tikz/quiver/##1}}},
    quiver/.cd,pos/.initial=0.35,height/.initial=0}

% A TikZ style for shortening paths without the poor behaviour of `shorten <' and `shorten >'.
\tikzset{between/.style n args={2}{/tikz/spath/at end path construction={
    \tikzset{spath/split at keep middle={current}{#1}{#2}}
}}}

% TikZ arrowhead/tail styles.
\tikzset{tail reversed/.code={\pgfsetarrowsstart{tikzcd to}}}
\tikzset{2tail/.code={\pgfsetarrowsstart{Implies[reversed]}}}
\tikzset{2tail reversed/.code={\pgfsetarrowsstart{Implies}}}
% TikZ arrow styles.
\tikzset{no body/.style={/tikz/dash pattern=on 0 off 1mm}}


\newcommand{\triplecolon}{%
  \mathrel{\vbox{\baselineskip=2pt \hbox{.}\hbox{.}\hbox{.}}}%
}

\DeclareUnicodeCharacter{2AF6}{\triplecolon}
\usepackage{mathpartir}

]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[
				\begin {tikzcd}
	{\mathbf {List}(V_1)} & {E_1} & {V_1} \\
	{\mathbf {List}(V_2)} & {E_2} & {V_2}
	\arrow ["{\mathbf {List}(v)}"', from=1-1, to=2-1]
	\arrow ["{\mathrm {src}_1}"', from=1-2, to=1-1]
	\arrow ["{\mathrm {tgt}_1}", from=1-2, to=1-3]
	\arrow ["e"', from=1-2, to=2-2]
	\arrow ["v", from=1-3, to=2-3]
	\arrow ["{\mathrm {src}_2}", from=2-2, to=2-1]
	\arrow ["{\mathrm {tgt}_2}"', from=2-2, to=2-3]
\end {tikzcd}
]]></fr:resource-source></fr:resource></html:figure>

</fr:mainmatter>
                </fr:tree>
                <html:p>We can identify free simple type 1-theories with finite multigraphs. Each vertex in the multigraph represents a primitive type, and each edge represents a primitive operation.</html:p>
                <fr:tree show-metadata="false">
                  <fr:frontmatter>
                    <fr:authors>
                      <fr:author>
                        <fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link>
                      </fr:author>
                    </fr:authors>
                    <fr:date>
                      <fr:year>2025</fr:year>
                      <fr:month>3</fr:month>
                      <fr:day>6</fr:day>
                    </fr:date>
                    <fr:uri>https://forest.topos.site/ocl-008Q/</fr:uri>
                    <fr:display-uri>https://forest.topos.site/ocl-008Q</fr:display-uri>
                    <fr:route>/ocl-008Q/</fr:route>
                    <fr:title text="Underlying multigraph of a multicategory">Underlying multigraph of a multicategory</fr:title>
                    <fr:taxon>definition</fr:taxon>
                  </fr:frontmatter>
                  <fr:mainmatter>
                    <html:p>By the <fr:link href="/ocl-008I/" title="Multicategory" uri="https://forest.topos.site/ocl-008I/" display-uri="https://forest.topos.site/ocl-008I" type="local">definition of multicategory</fr:link>, every multicategory <fr:tex display="inline"><![CDATA[M]]></fr:tex> has an underlying multigraph <fr:tex display="inline"><![CDATA[|M|]]></fr:tex> where the vertices are the objects of the multicategory and the edges are multimorphisms. Moreover, the assignment <fr:tex display="inline"><![CDATA[M \mapsto  |M|]]></fr:tex> is functorial.</html:p>
                  </fr:mainmatter>
                </fr:tree>
                <fr:tree show-metadata="false">
                  <fr:frontmatter>
                    <fr:authors>
                      <fr:author>
                        <fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link>
                      </fr:author>
                    </fr:authors>
                    <fr:date>
                      <fr:year>2025</fr:year>
                      <fr:month>3</fr:month>
                      <fr:day>6</fr:day>
                    </fr:date>
                    <fr:uri>https://forest.topos.site/ocl-008R/</fr:uri>
                    <fr:display-uri>https://forest.topos.site/ocl-008R</fr:display-uri>
                    <fr:route>/ocl-008R/</fr:route>
                    <fr:title text="Models of a free simple type 1-theory">Models of a free simple type 1-theory</fr:title>
                    <fr:taxon>definition</fr:taxon>
                  </fr:frontmatter>
                  <fr:mainmatter>
                    <html:p>Given a free simple type 1-theory <fr:tex display="inline"><![CDATA[T]]></fr:tex>, represented as a <fr:link href="/ocl-008P/" title="Multigraphs" uri="https://forest.topos.site/ocl-008P/" display-uri="https://forest.topos.site/ocl-008P" type="local">multigraph</fr:link>, a <html:strong>model</html:strong> of it consists of a cartesian multicategory <fr:tex display="inline"><![CDATA[M]]></fr:tex> with a multigraph homomorphism <fr:tex display="inline"><![CDATA[T \to  |M|]]></fr:tex>.</html:p>
                    <html:p>There is a category <fr:tex display="inline"><![CDATA[\mathsf {Mod}(T)]]></fr:tex> of such models, which is simply the slice category <fr:tex display="inline"><![CDATA[T \downarrow  |{-}|]]></fr:tex>.</html:p>
                  </fr:mainmatter>
                </fr:tree>
                <html:p>Arguably the entire point of type theory is to be able to prove analogues of following.</html:p>
                <fr:tree show-metadata="false">
                  <fr:frontmatter>
                    <fr:authors>
                      <fr:author>
                        <fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link>
                      </fr:author>
                    </fr:authors>
                    <fr:date>
                      <fr:year>2025</fr:year>
                      <fr:month>3</fr:month>
                      <fr:day>6</fr:day>
                    </fr:date>
                    <fr:uri>https://forest.topos.site/ocl-008V/</fr:uri>
                    <fr:display-uri>https://forest.topos.site/ocl-008V</fr:display-uri>
                    <fr:route>/ocl-008V/</fr:route>
                    <fr:title text="Initial model of a theory">Initial model of a theory</fr:title>
                    <fr:taxon>proposition</fr:taxon>
                  </fr:frontmatter>
                  <fr:mainmatter>
                    <html:p>Given a multigraph <fr:tex display="inline"><![CDATA[T]]></fr:tex>, extend the type theory of <fr:link href="/ocl-007M/" title="Judgment structure of \mathbb {S}" uri="https://forest.topos.site/ocl-007M/" display-uri="https://forest.topos.site/ocl-007M" type="local">§ <fr:contextual-number uri="https://forest.topos.site/ocl-007M/" display-uri="https://forest.topos.site/ocl-007M" /></fr:link> with the following rules.</html:p>
                    <fr:tree show-metadata="false">
                      <fr:frontmatter>
                        <fr:authors>
                          <fr:author>
                            <fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link>
                          </fr:author>
                        </fr:authors>
                        <fr:date>
                          <fr:year>2025</fr:year>
                          <fr:month>3</fr:month>
                          <fr:day>6</fr:day>
                        </fr:date>
                        <fr:uri>https://forest.topos.site/ocl-008W/</fr:uri>
                        <fr:display-uri>https://forest.topos.site/ocl-008W</fr:display-uri>
                        <fr:route>/ocl-008W/</fr:route>
                        <fr:title text="Primitive types">Primitive types</fr:title>
                        <fr:taxon>rule</fr:taxon>
                      </fr:frontmatter>
                      <fr:mainmatter>
<fr:resource hash="d57864ff378e25a5bd95aea2b0529737"><fr:resource-content><html:img src="https://forest.topos.site/d57864ff378e25a5bd95aea2b0529737.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[\usepackage {mathpartir, amssymb, amsmath, mathtools}]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[
\begin {mathpar}

\inferrule {\text {$A$ is a vertex in $T$}}{A \,\,\mathsf {type}}

\end {mathpar}
]]></fr:resource-source></fr:resource>
</fr:mainmatter>
                    </fr:tree>
                    <fr:tree show-metadata="false">
                      <fr:frontmatter>
                        <fr:authors>
                          <fr:author>
                            <fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link>
                          </fr:author>
                        </fr:authors>
                        <fr:date>
                          <fr:year>2025</fr:year>
                          <fr:month>3</fr:month>
                          <fr:day>6</fr:day>
                        </fr:date>
                        <fr:uri>https://forest.topos.site/ocl-008X/</fr:uri>
                        <fr:display-uri>https://forest.topos.site/ocl-008X</fr:display-uri>
                        <fr:route>/ocl-008X/</fr:route>
                        <fr:title text="Primitive functions">Primitive functions</fr:title>
                        <fr:taxon>rule</fr:taxon>
                      </fr:frontmatter>
                      <fr:mainmatter>
<fr:resource hash="2238224b42a0726df467f786cfbc048c"><fr:resource-content><html:img src="https://forest.topos.site/2238224b42a0726df467f786cfbc048c.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[\usepackage {mathpartir, amssymb, amsmath, mathtools}]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[
\begin {mathpar}

\inferrule {\text {$f$ is an edge in $T$ from $[A_1,\ldots ,A_n]$ to $B$} \and  \Gamma  \,\vdash \, t_1 \colon  A_1 \and  \ldots  \and  \Gamma  \,\vdash \, t_n \colon  A_n}{\Gamma  \,\vdash \, f(t_1,\ldots ,t_n) \colon  B}

\end {mathpar}
]]></fr:resource-source></fr:resource>
</fr:mainmatter>
                    </fr:tree>
                    <html:p>There is then a multicategory for that type theory described in the following way.</html:p>
                    <html:ul><html:li>The objects are derivations of <fr:tex display="inline"><![CDATA[\mathsf {type}]]></fr:tex></html:li>
  <html:li>A multimorphism from <fr:tex display="inline"><![CDATA[[A_1,\ldots ,A_n]]]></fr:tex> to <fr:tex display="inline"><![CDATA[B]]></fr:tex> are derivation of the judgment <fr:tex display="inline"><![CDATA[A_1,\ldots ,A_n \,\vdash \, B]]></fr:tex>.</html:li>
  <html:li>Composition is given by substitution (which is admissible).</html:li>
  <html:li>Identities are given by the identity structural rule.</html:li></html:ul>
                    <html:p>This multicategory is the initial <fr:link href="/ocl-008R/" title="Models of a free simple type 1-theory" uri="https://forest.topos.site/ocl-008R/" display-uri="https://forest.topos.site/ocl-008R" type="local">model</fr:link> for <fr:tex display="inline"><![CDATA[T]]></fr:tex>.</html:p>
                  </fr:mainmatter>
                </fr:tree>
                <html:p>A similar theorem can be proven about simple type 1-theories which involve equations, but the definition of such a simple type 1-theory is slightly more complicated.</html:p>
              </fr:mainmatter>
            </fr:tree>
            <fr:tree show-metadata="false">
              <fr:frontmatter>
                <fr:authors>
                  <fr:contributor>
                    <fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link>
                  </fr:contributor>
                </fr:authors>
                <fr:date>
                  <fr:year>2025</fr:year>
                  <fr:month>2</fr:month>
                  <fr:day>28</fr:day>
                </fr:date>
                <fr:uri>https://forest.topos.site/ocl-007P/</fr:uri>
                <fr:display-uri>https://forest.topos.site/ocl-007P</fr:display-uri>
                <fr:route>/ocl-007P/</fr:route>
                <fr:title text="2-theories in \mathbb {S} and their semantics">2-theories in <fr:tex display="inline"><![CDATA[\mathbb {S}]]></fr:tex> and their semantics</fr:title>
              </fr:frontmatter>
              <fr:mainmatter>
                <html:p>Up to now, the only rules in simple type theory have been the structural rules and “primitive rules”. In this section, we discuss how to add additional rules to type theory which go beyond this. In general, these rules will tell us how to form new types, and then determine the elements of those new types via universal properties. We call these “rules of inference”.</html:p>
                <html:p>We will see that postulating certain rules of inference is equivalent to considering cartesian multicategories with 2-algebraic structure determined by universal properties. That is, when we think about, for instance “simple type theory with product types”, its model theory will consist of cartesian multicategories with some extra structure, where that structure is determined via universal properties.</html:p>
                <html:p>Correspondingly, we term rules of inference “type 2-theories” (this of course again follows Shulman's use of the term).</html:p>
                <html:p>This will probably make the most sense after considering some examples.</html:p>
                <fr:tree show-metadata="false">
                  <fr:frontmatter>
                    <fr:authors>
                      <fr:author>
                        <fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link>
                      </fr:author>
                    </fr:authors>
                    <fr:date>
                      <fr:year>2025</fr:year>
                      <fr:month>2</fr:month>
                      <fr:day>28</fr:day>
                    </fr:date>
                    <fr:uri>https://forest.topos.site/ocl-007Q/</fr:uri>
                    <fr:display-uri>https://forest.topos.site/ocl-007Q</fr:display-uri>
                    <fr:route>/ocl-007Q/</fr:route>
                    <fr:title text="Product types">Product types</fr:title>
                  </fr:frontmatter>
                  <fr:mainmatter>
                    <html:p>Product types are determined type-theoretically by the following rules.</html:p>
                    <fr:tree show-metadata="false">
                      <fr:frontmatter>
                        <fr:authors>
                          <fr:author>
                            <fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link>
                          </fr:author>
                        </fr:authors>
                        <fr:date>
                          <fr:year>2025</fr:year>
                          <fr:month>3</fr:month>
                          <fr:day>6</fr:day>
                        </fr:date>
                        <fr:uri>https://forest.topos.site/ocl-008Z/</fr:uri>
                        <fr:display-uri>https://forest.topos.site/ocl-008Z</fr:display-uri>
                        <fr:route>/ocl-008Z/</fr:route>
                        <fr:title text="Product formation">Product formation</fr:title>
                        <fr:taxon>rule</fr:taxon>
                      </fr:frontmatter>
                      <fr:mainmatter>
<fr:resource hash="22dce50bbed39d115c7e70c9252b1bf4"><fr:resource-content><html:img src="https://forest.topos.site/22dce50bbed39d115c7e70c9252b1bf4.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[\usepackage {mathpartir, amssymb, amsmath, mathtools}]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[
\begin {mathpar}

\inferrule *{A \,\,\mathsf {type} \and  B \,\,\mathsf {type}}{A \times  B \,\,\mathsf {type}}

\end {mathpar}
]]></fr:resource-source></fr:resource>
</fr:mainmatter>
                    </fr:tree>
                    <fr:tree show-metadata="false">
                      <fr:frontmatter>
                        <fr:authors>
                          <fr:author>
                            <fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link>
                          </fr:author>
                        </fr:authors>
                        <fr:date>
                          <fr:year>2025</fr:year>
                          <fr:month>3</fr:month>
                          <fr:day>6</fr:day>
                        </fr:date>
                        <fr:uri>https://forest.topos.site/ocl-0090/</fr:uri>
                        <fr:display-uri>https://forest.topos.site/ocl-0090</fr:display-uri>
                        <fr:route>/ocl-0090/</fr:route>
                        <fr:title text="Product introduction and elimination">Product introduction and elimination</fr:title>
                        <fr:taxon>rule</fr:taxon>
                      </fr:frontmatter>
                      <fr:mainmatter>
<fr:resource hash="59973d407feaf62f4b9dcfabd5782b9b"><fr:resource-content><html:img src="https://forest.topos.site/59973d407feaf62f4b9dcfabd5782b9b.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[\usepackage {mathpartir, amssymb, amsmath, mathtools}]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[
\begin {mathpar}

\inferrule *{\Gamma  \,\vdash \, a \colon  A \and  \Gamma  \,\vdash \, b \colon  B}{\Gamma  \,\vdash \, (a,b) \colon  A \times  B} \and 
\inferrule *{\Gamma  \,\vdash \, p \colon  A \times  B \and  \Gamma , x \colon  A, y \colon  B \,\vdash \, c \colon  C}{\Gamma  \,\vdash \, (\mathbf {let}\,\, (x,y) = p \,\,\mathbf {in}\,\, c) \colon  C}

\end {mathpar}
]]></fr:resource-source></fr:resource>
</fr:mainmatter>
                    </fr:tree>
                    <fr:tree show-metadata="false">
                      <fr:frontmatter>
                        <fr:authors>
                          <fr:author>
                            <fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link>
                          </fr:author>
                        </fr:authors>
                        <fr:date>
                          <fr:year>2025</fr:year>
                          <fr:month>3</fr:month>
                          <fr:day>6</fr:day>
                        </fr:date>
                        <fr:uri>https://forest.topos.site/ocl-0091/</fr:uri>
                        <fr:display-uri>https://forest.topos.site/ocl-0091</fr:display-uri>
                        <fr:route>/ocl-0091/</fr:route>
                        <fr:title text="Product beta and eta">Product beta and eta</fr:title>
                        <fr:taxon>rule</fr:taxon>
                      </fr:frontmatter>
                      <fr:mainmatter>
<fr:resource hash="28ab375911080d3df13a3653432b9e6b"><fr:resource-content><html:img src="https://forest.topos.site/28ab375911080d3df13a3653432b9e6b.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[\usepackage {mathpartir, amssymb, amsmath, mathtools}]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[
\begin {mathpar}

\inferrule {\Gamma  \,\vdash \, a \colon  A \and  \Gamma  \,\vdash \, b \colon  B \and  \Gamma , x \colon  A, y \colon  B \,\vdash \, c \colon  C}{\Gamma  \,\vdash \, (\mathbf {let}\,\, (x, y) = (a,b) \,\,\mathbf {in}\,\, c) = c[x \backslash  a, y \backslash  b] \colon  C} \and 
\inferrule {\Gamma  \,\vdash \, p \colon  A \times  B}{\Gamma  \,\vdash \, p = (\mathbf {let}\,\, (x, y) = p \,\,\mathbf {in}\,\, (x, y)) \colon  A \times  B}

\end {mathpar}
]]></fr:resource-source></fr:resource>
</fr:mainmatter>
                    </fr:tree>
                    <html:p>This corresponds to the structure of a <html:em>representable</html:em> cartesian multicategory. To define representable cartesian multicategory, we first make use of an auxilary definition.</html:p>
                    <fr:tree show-metadata="false">
                      <fr:frontmatter>
                        <fr:authors>
                          <fr:author>
                            <fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link>
                          </fr:author>
                        </fr:authors>
                        <fr:date>
                          <fr:year>2025</fr:year>
                          <fr:month>3</fr:month>
                          <fr:day>6</fr:day>
                        </fr:date>
                        <fr:uri>https://forest.topos.site/ocl-0093/</fr:uri>
                        <fr:display-uri>https://forest.topos.site/ocl-0093</fr:display-uri>
                        <fr:route>/ocl-0093/</fr:route>
                        <fr:title text="The context construction for cartesian multicategories">The context construction for cartesian multicategories</fr:title>
                        <fr:taxon>definition</fr:taxon>
                      </fr:frontmatter>
                      <fr:mainmatter>
                        <html:p>In this definition, we explore a structure on cartesian multicategories which more directly interprets the <fr:link href="/ocl-008B/" title="The substitution rule for \mathbb {S}" uri="https://forest.topos.site/ocl-008B/" display-uri="https://forest.topos.site/ocl-008B" type="local">substitution rule</fr:link> for simple type theory.</html:p>
                        <html:p>Given a cartesian muliticategory <fr:tex display="inline"><![CDATA[M]]></fr:tex> and a list <fr:tex display="inline"><![CDATA[\Gamma ]]></fr:tex> of objects in <fr:tex display="inline"><![CDATA[M]]></fr:tex>, then let <fr:tex display="inline"><![CDATA[M_\Gamma ]]></fr:tex> be the cartesian multicategory with the same objects as <fr:tex display="inline"><![CDATA[M]]></fr:tex>, but where a multimorphism from <fr:tex display="inline"><![CDATA[[A_1,\ldots ,A_n]]]></fr:tex> to <fr:tex display="inline"><![CDATA[B]]></fr:tex> is a multimorphism in <fr:tex display="inline"><![CDATA[M]]></fr:tex> from <fr:tex display="inline"><![CDATA[[\Gamma \ldots ,A_1,\ldots ,A_n]]]></fr:tex> to <fr:tex display="inline"><![CDATA[B]]></fr:tex>.</html:p>
                        <html:p>Composition in <fr:tex display="inline"><![CDATA[M_\Gamma ]]></fr:tex> critically relies on being able to duplicate contexts, and thus on the cartesian multicategory structure.</html:p>
                        <html:p>We can now see that the <fr:link href="/ocl-008B/" title="The substitution rule for \mathbb {S}" uri="https://forest.topos.site/ocl-008B/" display-uri="https://forest.topos.site/ocl-008B" type="local">substitution rule</fr:link> interprets multimorphism composition in <fr:tex display="inline"><![CDATA[M_\Gamma ]]></fr:tex> with “constants” in <fr:tex display="inline"><![CDATA[M_\Gamma ]]></fr:tex> (which are multimorphisms out of <fr:tex display="inline"><![CDATA[\Gamma ]]></fr:tex> in <fr:tex display="inline"><![CDATA[M]]></fr:tex>).</html:p>
                      </fr:mainmatter>
                    </fr:tree>
                    <fr:tree show-metadata="false">
                      <fr:frontmatter>
                        <fr:authors>
                          <fr:author>
                            <fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link>
                          </fr:author>
                        </fr:authors>
                        <fr:date>
                          <fr:year>2025</fr:year>
                          <fr:month>3</fr:month>
                          <fr:day>6</fr:day>
                        </fr:date>
                        <fr:uri>https://forest.topos.site/ocl-0092/</fr:uri>
                        <fr:display-uri>https://forest.topos.site/ocl-0092</fr:display-uri>
                        <fr:route>/ocl-0092/</fr:route>
                        <fr:title text="Representable cartesian multicategory">Representable cartesian multicategory</fr:title>
                        <fr:taxon>definition</fr:taxon>
                      </fr:frontmatter>
                      <fr:mainmatter>
                        <html:p>We say that cartesian multicategory <fr:tex display="inline"><![CDATA[M]]></fr:tex> is <html:strong>representable</html:strong> if we have an operation on objects <fr:tex display="inline"><![CDATA[A, B \mapsto  A \times  B]]></fr:tex> such that for every list of objects <fr:tex display="inline"><![CDATA[\Gamma ]]></fr:tex>, the functor <fr:tex display="inline"><![CDATA[M_\Gamma  \to  \mathsf {Set}]]></fr:tex> given by <fr:tex display="inline"><![CDATA[X \mapsto  M_\Gamma (A,B;X)]]></fr:tex> is represented by <fr:tex display="inline"><![CDATA[A \times  B]]></fr:tex>, that is we have a natural isomorphism <fr:tex display="inline"><![CDATA[M_\Gamma (A,B;X) \cong  M_\Gamma (A \times  B; X)]]></fr:tex>.</html:p>
                      </fr:mainmatter>
                    </fr:tree>
                    <html:p>It is a good exercise to show that the introduction, elimination, beta and eta rules are jointly sufficient and necessary to deduce the natural isomorphism. It is no coincidence that an isomorphism has 4 parts: a function in either direction and a proofs that both composites are each equal to the identity.</html:p>
                    <html:p>It is also a good exercise to show that if a <fr:tex display="inline"><![CDATA[M]]></fr:tex> is the multicategory associated to a cartesian monoidal category, then <fr:tex display="inline"><![CDATA[M]]></fr:tex> is a representable cartesian multicategory.</html:p>
                    <html:p>Because in most cases, we are in fact working with the multicategory associated to some cartesian monoidal category, adding product types is a quite mild assumption that does not restrict our semantics too much; many categories have finite products.</html:p>
                  </fr:mainmatter>
                </fr:tree>
                <fr:tree show-metadata="false">
                  <fr:frontmatter>
                    <fr:authors>
                      <fr:author>
                        <fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link>
                      </fr:author>
                    </fr:authors>
                    <fr:date>
                      <fr:year>2025</fr:year>
                      <fr:month>2</fr:month>
                      <fr:day>28</fr:day>
                    </fr:date>
                    <fr:uri>https://forest.topos.site/ocl-007R/</fr:uri>
                    <fr:display-uri>https://forest.topos.site/ocl-007R</fr:display-uri>
                    <fr:route>/ocl-007R/</fr:route>
                    <fr:title text="Function types">Function types</fr:title>
                  </fr:frontmatter>
                  <fr:mainmatter>
                    <html:p>Function types are determined type-theoretically by the following rules.</html:p>
                    <fr:tree show-metadata="false">
                      <fr:frontmatter>
                        <fr:authors>
                          <fr:author>
                            <fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link>
                          </fr:author>
                        </fr:authors>
                        <fr:date>
                          <fr:year>2025</fr:year>
                          <fr:month>3</fr:month>
                          <fr:day>6</fr:day>
                        </fr:date>
                        <fr:uri>https://forest.topos.site/ocl-0094/</fr:uri>
                        <fr:display-uri>https://forest.topos.site/ocl-0094</fr:display-uri>
                        <fr:route>/ocl-0094/</fr:route>
                        <fr:title text="Function formation">Function formation</fr:title>
                        <fr:taxon>rule</fr:taxon>
                      </fr:frontmatter>
                      <fr:mainmatter>
<fr:resource hash="7c0d171f3f469df49a0025371800e4c4"><fr:resource-content><html:img src="https://forest.topos.site/7c0d171f3f469df49a0025371800e4c4.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[\usepackage {mathpartir, amssymb, amsmath, mathtools}]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[
\begin {mathpar}

\inferrule {A \,\,\mathsf {type} \and  B \,\,\mathsf {type}}{A \to  B \,\,\mathsf {type}}

\end {mathpar}
]]></fr:resource-source></fr:resource>
</fr:mainmatter>
                    </fr:tree>
                    <fr:tree show-metadata="false">
                      <fr:frontmatter>
                        <fr:authors>
                          <fr:author>
                            <fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link>
                          </fr:author>
                        </fr:authors>
                        <fr:date>
                          <fr:year>2025</fr:year>
                          <fr:month>3</fr:month>
                          <fr:day>6</fr:day>
                        </fr:date>
                        <fr:uri>https://forest.topos.site/ocl-0095/</fr:uri>
                        <fr:display-uri>https://forest.topos.site/ocl-0095</fr:display-uri>
                        <fr:route>/ocl-0095/</fr:route>
                        <fr:title text="Function introduction and elimination">Function introduction and elimination</fr:title>
                        <fr:taxon>rule</fr:taxon>
                      </fr:frontmatter>
                      <fr:mainmatter>
<fr:resource hash="d4776fd24d441d5179092a802b5bc831"><fr:resource-content><html:img src="https://forest.topos.site/d4776fd24d441d5179092a802b5bc831.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[\usepackage {mathpartir, amssymb, amsmath, mathtools}]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[
\begin {mathpar}

\inferrule {\Gamma , x \colon  A \,\vdash \, b \colon  B}{\Gamma  \,\vdash \, (x \mapsto  b) \colon  A \to  B} \and 
\inferrule {\Gamma  \,\vdash \, f \colon  A \to  B \and  \Gamma  \,\vdash \, a \colon  A}{\Gamma  \,\vdash \, f(a) \colon  B}

\end {mathpar}
]]></fr:resource-source></fr:resource>
</fr:mainmatter>
                    </fr:tree>
                    <fr:tree show-metadata="false">
                      <fr:frontmatter>
                        <fr:authors>
                          <fr:author>
                            <fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link>
                          </fr:author>
                        </fr:authors>
                        <fr:date>
                          <fr:year>2025</fr:year>
                          <fr:month>3</fr:month>
                          <fr:day>6</fr:day>
                        </fr:date>
                        <fr:uri>https://forest.topos.site/ocl-0096/</fr:uri>
                        <fr:display-uri>https://forest.topos.site/ocl-0096</fr:display-uri>
                        <fr:route>/ocl-0096/</fr:route>
                        <fr:title text="Function beta and eta">Function beta and eta</fr:title>
                        <fr:taxon>rule</fr:taxon>
                      </fr:frontmatter>
                      <fr:mainmatter>
<fr:resource hash="fa0c660c86adee6ae224dec48534bdc7"><fr:resource-content><html:img src="https://forest.topos.site/fa0c660c86adee6ae224dec48534bdc7.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[\usepackage {mathpartir, amssymb, amsmath, mathtools}]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[
\begin {mathpar}

\inferrule {\Gamma , x \colon  A \,\vdash \, b \colon  B \and  \Gamma  \,\vdash \, a \colon  A}{\Gamma  \,\vdash \, (x \mapsto  b)(a) = b[x \backslash  a] \colon  B} \and  \inferrule {\Gamma  \,\vdash \, f \colon  A \to  B}{\Gamma  \,\vdash \, f = (x \mapsto  f(x)) \colon  A \to  B}

\end {mathpar}
]]></fr:resource-source></fr:resource>
</fr:mainmatter>
                    </fr:tree>
                    <html:p>Function types correspond categorically to being a closed cartesian multicategory, which we shall now define.</html:p>
                    <fr:tree show-metadata="false">
                      <fr:frontmatter>
                        <fr:authors>
                          <fr:author>
                            <fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link>
                          </fr:author>
                        </fr:authors>
                        <fr:date>
                          <fr:year>2025</fr:year>
                          <fr:month>3</fr:month>
                          <fr:day>6</fr:day>
                        </fr:date>
                        <fr:uri>https://forest.topos.site/ocl-0097/</fr:uri>
                        <fr:display-uri>https://forest.topos.site/ocl-0097</fr:display-uri>
                        <fr:route>/ocl-0097/</fr:route>
                        <fr:title text="Closed cartesian multicategory">Closed cartesian multicategory</fr:title>
                        <fr:taxon>definition</fr:taxon>
                      </fr:frontmatter>
                      <fr:mainmatter>
                        <html:p>Just like for <fr:link href="/ocl-0092/" title="Representable cartesian multicategory" uri="https://forest.topos.site/ocl-0092/" display-uri="https://forest.topos.site/ocl-0092" type="local">representable cartesian multicategories</fr:link>, a closed cartesian multicategory is defined by an operation on objects <fr:tex display="inline"><![CDATA[(A, B) \mapsto  (A \to  B)]]></fr:tex>, along with a characterization of <fr:tex display="inline"><![CDATA[A \to  B]]></fr:tex> in terms of the representability of a certain functor.</html:p>
                        <html:p>Specifically, for a cartesian multicategory <fr:tex display="inline"><![CDATA[\mathsf {M}]]></fr:tex>, consider the contravariant functor <fr:tex display="inline"><![CDATA[\mathsf {M}_{A;B} \colon  \mathsf {Subst}(M)^{\mathsf {op}} \to  \mathsf {Set}]]></fr:tex> sending <fr:tex display="inline"><![CDATA[\Gamma ]]></fr:tex> to <fr:tex display="inline"><![CDATA[\mathsf {M}(\Gamma ,A; B)]]></fr:tex>, where <fr:tex display="inline"><![CDATA[\mathsf {Subst}(M)]]></fr:tex> is the category of substitutions for <fr:tex display="inline"><![CDATA[\mathsf {M}]]></fr:tex>. Then a cartesian multicategory is <html:strong>closed</html:strong> if <fr:tex display="inline"><![CDATA[\mathsf {M}_{A;B}]]></fr:tex> is represented by <fr:tex display="inline"><![CDATA[A \to  B]]></fr:tex>. That is, multimorphisms <fr:tex display="inline"><![CDATA[\mathsf {M}(\Gamma ,A; B)]]></fr:tex> are in natural bijection with multimorphisms <fr:tex display="inline"><![CDATA[\mathsf {M}(\Gamma ; A \to  B)]]></fr:tex>.</html:p>
                        <html:p>An equivalent definition of closed cartesian multicategory may be found in <fr:link href="/manzyuk-2009-closed/" title="Closed categories vs. closed multicategories" uri="https://forest.topos.site/manzyuk-2009-closed/" display-uri="https://forest.topos.site/manzyuk-2009-closed" type="local">Reference <fr:contextual-number uri="https://forest.topos.site/manzyuk-2009-closed/" display-uri="https://forest.topos.site/manzyuk-2009-closed" /></fr:link>.</html:p>
                      </fr:mainmatter>
                    </fr:tree>
                    <html:p>In contrast to <fr:link href="/ocl-007Q/" title="Product types" uri="https://forest.topos.site/ocl-007Q/" display-uri="https://forest.topos.site/ocl-007Q" type="local">product types</fr:link>, the existence of function types is a strong assumption for a type theory, as there are many cartesian multicategories which are not closed.</html:p>
                    <html:p>The intuition for why this is the case is that, in general, function types might be too “large”. For instance, the category of finite-dimensional manifolds with smooth maps between them is a cartesian category (and thus has a cartesian multicategory of tuple-argument functions), but it is certainly not closed, as function spaces of smooth maps between manifolds are in general infinite dimensional.</html:p>
                    <html:p>Similarly, in a programming language, function types necessarily have no bound in terms of the amount of memory that they take up, because a lambda may close over arbitrary many variables. In general runtime techniques like garbage collection and dynamic dispatch must be used to support the elements of such function types, which imposes a performance penalty that compilers spend significant amounts of complexity trying to work around via static analysis.</html:p>
                  </fr:mainmatter>
                </fr:tree>
                <html:p>In general, the syntactic component of type 2-theories will be the postulation of certain inference rules, and the semantic component will be the representability of certain functors, or in other words, the postulation of objects satisfying some universal properties. It is somewhat of an art to pick inference rules such that the derivations with respect to those inference rules admit substitution and have other good properties, but often taking the isomorphism that characterizes a representability result and adding rules for both directions (introduction and elimination) along with how each is a section of the other (beta and eta), works fairly well.</html:p>
                <html:p>One might also postulate structure which is not uniquely-up-to-isomorphism characterized by universal properties. This might correspond to postulating that your model is an algebra of an arbitraty 2-monad on the 2-category of multicategories. However, generally this is ill-advised. The beauty of structure characterized by universal properties is that 2-theories become trivially composable, so one may postulate product types and function types without needing any rules to say how the product types and function types interact. In contrast, structure not characterized by universal properties might need additional rules to say how it interacts with other structure, and in a type theory with many constructions this may scale badly.</html:p>
              </fr:mainmatter>
            </fr:tree>
          </fr:mainmatter>
        </fr:tree>
        <fr:tree show-metadata="false">
          <fr:frontmatter>
            <fr:authors>
              <fr:contributor>
                <fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link>
              </fr:contributor>
            </fr:authors>
            <fr:date>
              <fr:year>2025</fr:year>
              <fr:month>2</fr:month>
              <fr:day>28</fr:day>
            </fr:date>
            <fr:uri>https://forest.topos.site/ocl-0072/</fr:uri>
            <fr:display-uri>https://forest.topos.site/ocl-0072</fr:display-uri>
            <fr:route>/ocl-0072/</fr:route>
            <fr:title text="The 3-theory of dependent type theories (\mathbb {D})">The 3-theory of dependent type theories (<fr:tex display="inline"><![CDATA[\mathbb {D}]]></fr:tex>)</fr:title>
          </fr:frontmatter>
          <fr:mainmatter>
            <fr:tree show-metadata="false">
              <fr:frontmatter>
                <fr:authors>
                  <fr:author>
                    <fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link>
                  </fr:author>
                </fr:authors>
                <fr:date>
                  <fr:year>2025</fr:year>
                  <fr:month>2</fr:month>
                  <fr:day>28</fr:day>
                </fr:date>
                <fr:uri>https://forest.topos.site/ocl-007T/</fr:uri>
                <fr:display-uri>https://forest.topos.site/ocl-007T</fr:display-uri>
                <fr:route>/ocl-007T/</fr:route>
                <fr:title text="Judgment structure of \mathbb {D}">Judgment structure of <fr:tex display="inline"><![CDATA[\mathbb {D}]]></fr:tex></fr:title>
              </fr:frontmatter>
              <fr:mainmatter>
                <html:p>Just as we did for simple type theory, we begin by reviewing the judgment structure of dependent type theory. The important difference between simple type theory and dependent type theory is that in simple type theory “contexts” were a derived notion; a context was merely a list of types. In dependent type theory, context is a primitive notion. It will turn out that there is still some sense in which a context is a list of types, but it will take a bit of time for us to see why that is.</html:p>
                <fr:tree show-metadata="false">
                  <fr:frontmatter>
                    <fr:authors>
                      <fr:author>
                        <fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link>
                      </fr:author>
                    </fr:authors>
                    <fr:date>
                      <fr:year>2025</fr:year>
                      <fr:month>3</fr:month>
                      <fr:day>11</fr:day>
                    </fr:date>
                    <fr:uri>https://forest.topos.site/ocl-009D/</fr:uri>
                    <fr:display-uri>https://forest.topos.site/ocl-009D</fr:display-uri>
                    <fr:route>/ocl-009D/</fr:route>
                    <fr:title text="Example judgments for \mathbb {D}">Example judgments for <fr:tex display="inline"><![CDATA[\mathbb {D}]]></fr:tex></fr:title>
                    <fr:taxon>table</fr:taxon>
                  </fr:frontmatter>
                  <fr:mainmatter>
                    <html:table>
                      <html:thead>
<html:tr><html:th>Judgment</html:th><html:th>Pronunciation</html:th></html:tr>
</html:thead>
                      <html:tbody>
<html:tr><html:td><fr:tex display="inline"><![CDATA[\Gamma  \,\,\mathsf {ctx}]]></fr:tex></html:td><html:td><fr:tex display="inline"><![CDATA[\Gamma ]]></fr:tex> is a context</html:td></html:tr>
<html:tr><html:td><fr:tex display="inline"><![CDATA[\Gamma  \,\vdash \, A \,\,\mathsf {type}]]></fr:tex></html:td><html:td>In context <fr:tex display="inline"><![CDATA[\Gamma ]]></fr:tex>, <fr:tex display="inline"><![CDATA[A]]></fr:tex> is a type</html:td></html:tr>
<html:tr><html:td><fr:tex display="inline"><![CDATA[\Gamma  \,\vdash \, A = A' \,\,\mathsf {type}]]></fr:tex></html:td><html:td>In context <fr:tex display="inline"><![CDATA[\Gamma ]]></fr:tex>, <fr:tex display="inline"><![CDATA[A]]></fr:tex> and <fr:tex display="inline"><![CDATA[A']]></fr:tex> are judgmentally equal types</html:td></html:tr>
<html:tr><html:td><fr:tex display="inline"><![CDATA[\Gamma  \,\vdash \, a \colon  A]]></fr:tex></html:td><html:td>In context <fr:tex display="inline"><![CDATA[\Gamma ]]></fr:tex>, <fr:tex display="inline"><![CDATA[a]]></fr:tex> is a term of type <fr:tex display="inline"><![CDATA[A]]></fr:tex></html:td></html:tr>
<html:tr><html:td><fr:tex display="inline"><![CDATA[\Gamma  \,\vdash \, a = a' \colon  A]]></fr:tex></html:td><html:td>In context <fr:tex display="inline"><![CDATA[\Gamma ]]></fr:tex>, <fr:tex display="inline"><![CDATA[a]]></fr:tex> and <fr:tex display="inline"><![CDATA[a']]></fr:tex> are judgmentally equal terms of type <fr:tex display="inline"><![CDATA[A]]></fr:tex></html:td></html:tr>
</html:tbody>
                    </html:table>
                  </fr:mainmatter>
                </fr:tree>
                <html:p>We then have some structural rules. First of all, we have rules which allow us to produce contexts in the first place.</html:p>
                <fr:tree show-metadata="false">
                  <fr:frontmatter>
                    <fr:authors>
                      <fr:author>
                        <fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link>
                      </fr:author>
                    </fr:authors>
                    <fr:date>
                      <fr:year>2025</fr:year>
                      <fr:month>3</fr:month>
                      <fr:day>11</fr:day>
                    </fr:date>
                    <fr:uri>https://forest.topos.site/ocl-009E/</fr:uri>
                    <fr:display-uri>https://forest.topos.site/ocl-009E</fr:display-uri>
                    <fr:route>/ocl-009E/</fr:route>
                    <fr:title text="Context formation">Context formation</fr:title>
                    <fr:taxon>rule</fr:taxon>
                  </fr:frontmatter>
                  <fr:mainmatter>
<fr:resource hash="20e379f15b67ab76d70a15b402281e14"><fr:resource-content><html:img src="https://forest.topos.site/20e379f15b67ab76d70a15b402281e14.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[\usepackage {mathpartir, amssymb, amsmath, mathtools}]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[
\begin {mathpar}

\inferrule {\phantom {-}}{\cdot  \,\,\mathsf {ctx}} \and 
\inferrule {\Gamma  \,\vdash \, A \,\,\mathsf {type}}{\Gamma , x \colon  A \,\,\mathsf {ctx}}

\end {mathpar}
]]></fr:resource-source></fr:resource>
</fr:mainmatter>
                </fr:tree>
                <html:p><fr:link href="/ocl-009E/" title="Context formation" uri="https://forest.topos.site/ocl-009E/" display-uri="https://forest.topos.site/ocl-009E" type="local">rule <fr:contextual-number uri="https://forest.topos.site/ocl-009E/" display-uri="https://forest.topos.site/ocl-009E" /></fr:link> says that there is an empty context, and that given a type judgment in a context, we may extend that context by a free variable in that type.</html:p>
                <html:p>But how can we use this extended context? First off, we have the variable rule.</html:p>
                <fr:tree show-metadata="false">
                  <fr:frontmatter>
                    <fr:authors>
                      <fr:author>
                        <fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link>
                      </fr:author>
                    </fr:authors>
                    <fr:date>
                      <fr:year>2025</fr:year>
                      <fr:month>3</fr:month>
                      <fr:day>11</fr:day>
                    </fr:date>
                    <fr:uri>https://forest.topos.site/ocl-009F/</fr:uri>
                    <fr:display-uri>https://forest.topos.site/ocl-009F</fr:display-uri>
                    <fr:route>/ocl-009F/</fr:route>
                    <fr:title text="The variable rule for \mathbb {D}">The variable rule for <fr:tex display="inline"><![CDATA[\mathbb {D}]]></fr:tex></fr:title>
                    <fr:taxon>rule</fr:taxon>
                  </fr:frontmatter>
                  <fr:mainmatter>
<fr:resource hash="a723647f4aad79405ab5d9cb2d91bf86"><fr:resource-content><html:img src="https://forest.topos.site/a723647f4aad79405ab5d9cb2d91bf86.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[\usepackage {mathpartir, amssymb, amsmath, mathtools}]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[
\begin {mathpar}

\inferrule {\Gamma  \,\vdash \, A \,\,\mathsf {type}}{\Gamma , x \colon  A \,\vdash \, x \colon  A}

\end {mathpar}
]]></fr:resource-source></fr:resource>
</fr:mainmatter>
                </fr:tree>
                <html:p>The variable rule simple says that we can <html:em>use</html:em> this postulated element of <fr:tex display="inline"><![CDATA[A]]></fr:tex>. We then have weakening.</html:p>
                <fr:tree show-metadata="false">
                  <fr:frontmatter>
                    <fr:authors>
                      <fr:author>
                        <fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link>
                      </fr:author>
                    </fr:authors>
                    <fr:date>
                      <fr:year>2025</fr:year>
                      <fr:month>3</fr:month>
                      <fr:day>11</fr:day>
                    </fr:date>
                    <fr:uri>https://forest.topos.site/ocl-009H/</fr:uri>
                    <fr:display-uri>https://forest.topos.site/ocl-009H</fr:display-uri>
                    <fr:route>/ocl-009H/</fr:route>
                    <fr:title text="Weakening for \mathbb {D}">Weakening for <fr:tex display="inline"><![CDATA[\mathbb {D}]]></fr:tex></fr:title>
                    <fr:taxon>rule</fr:taxon>
                  </fr:frontmatter>
                  <fr:mainmatter>
<fr:resource hash="b0667b72dbd91ccd85416a6b7b99854c"><fr:resource-content><html:img src="https://forest.topos.site/b0667b72dbd91ccd85416a6b7b99854c.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[\usepackage {mathpartir, amssymb, amsmath, mathtools}]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[
\begin {mathpar}

\inferrule {\Gamma  \,\vdash \, A \,\,\mathsf {type} \and  \Gamma  \,\vdash \, B \,\,\mathsf {type}}{\Gamma , x \colon  A \,\vdash \, B \,\,\mathsf {type}} \and 
\inferrule {\Gamma  \,\vdash \, A \,\,\mathsf {type} \and  \Gamma  \,\vdash \, b \colon  B}{\Gamma , x \colon  A \,\vdash \, b \colon  B}

\end {mathpar}
]]></fr:resource-source></fr:resource>
</fr:mainmatter>
                </fr:tree>
                <html:p>Weakening says that anything we could derive in <fr:tex display="inline"><![CDATA[\Gamma ]]></fr:tex>, we can still derive in <fr:tex display="inline"><![CDATA[\Gamma ,x \colon  A]]></fr:tex>.</html:p>
                <html:p>We then have substitution. Substitutions in dependent type theory are similar to the substitutions in <fr:link href="/ocl-0099/" title="The cartesian category of substitutions associated to a cartesian multicategory" uri="https://forest.topos.site/ocl-0099/" display-uri="https://forest.topos.site/ocl-0099" type="local">definition <fr:contextual-number uri="https://forest.topos.site/ocl-0099/" display-uri="https://forest.topos.site/ocl-0099" /></fr:link>, but trickier because substituting into terms can change types. In order to handle this, we inductively define substitutions in the following way.</html:p>
                <fr:tree show-metadata="false">
                  <fr:frontmatter>
                    <fr:authors>
                      <fr:author>
                        <fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link>
                      </fr:author>
                    </fr:authors>
                    <fr:date>
                      <fr:year>2025</fr:year>
                      <fr:month>3</fr:month>
                      <fr:day>11</fr:day>
                    </fr:date>
                    <fr:uri>https://forest.topos.site/ocl-009G/</fr:uri>
                    <fr:display-uri>https://forest.topos.site/ocl-009G</fr:display-uri>
                    <fr:route>/ocl-009G/</fr:route>
                    <fr:title text="Dependent substitution">Dependent substitution</fr:title>
                    <fr:taxon>definition</fr:taxon>
                  </fr:frontmatter>
                  <fr:mainmatter>
                    <html:p>A <html:strong>substitution</html:strong> from a context <fr:tex display="inline"><![CDATA[\Gamma ]]></fr:tex> to a context <fr:tex display="inline"><![CDATA[\Delta ]]></fr:tex> is defined by considering the ways in which <fr:tex display="inline"><![CDATA[\Delta ]]></fr:tex> could be formed.</html:p>
                    <html:p>In the case that <fr:tex display="inline"><![CDATA[\Delta  = \cdot ]]></fr:tex>, the empty context, then there is precisely one substitution into <fr:tex display="inline"><![CDATA[\Delta ]]></fr:tex>. Note that this makes <fr:tex display="inline"><![CDATA[\cdot ]]></fr:tex> into the terminal object of the category of contexts and substitutions.</html:p>
                    <html:p>In the case that <fr:tex display="inline"><![CDATA[\Delta  = \Delta ', x \colon  A]]></fr:tex>, then a substitution from <fr:tex display="inline"><![CDATA[\Gamma ]]></fr:tex> to <fr:tex display="inline"><![CDATA[\Delta ]]></fr:tex> consists of a pair of a substitution <fr:tex display="inline"><![CDATA[\phi  \colon  \Gamma  \to  \Delta ']]></fr:tex>, along with a term <fr:tex display="inline"><![CDATA[\Gamma  \,\vdash \, a \colon  A[\phi ]]]></fr:tex>, where <fr:tex display="inline"><![CDATA[A[\phi ]]]></fr:tex> refers to the action of <fr:tex display="inline"><![CDATA[\phi ]]></fr:tex> on the type <fr:tex display="inline"><![CDATA[A]]></fr:tex> in context <fr:tex display="inline"><![CDATA[\Delta ']]></fr:tex> to product a type in context <fr:tex display="inline"><![CDATA[\Gamma ]]></fr:tex>. Of course, this operation <fr:tex display="inline"><![CDATA[A[\phi ]]]></fr:tex> must also be defined. This is generally done mutually recursively with the definition of substitution, but in order to do this we must know all the type formers, which we won't know until we fix a 1-theory and a 2-theory.</html:p>
                    <html:p>Thus, in general, if <fr:tex display="inline"><![CDATA[\Delta ]]></fr:tex> is a context with <fr:tex display="inline"><![CDATA[n]]></fr:tex> free variables, a substitution into <fr:tex display="inline"><![CDATA[\Delta ]]></fr:tex> will consist of <fr:tex display="inline"><![CDATA[n]]></fr:tex> terms in context <fr:tex display="inline"><![CDATA[\Gamma ]]></fr:tex>, of appropriate types.</html:p>
                  </fr:mainmatter>
                </fr:tree>
                <html:p>Substitutions act on both terms and types, so if we have <fr:tex display="inline"><![CDATA[\phi  \colon  \Gamma  \Rightarrow  \Delta ]]></fr:tex>, and <fr:tex display="inline"><![CDATA[\Delta  \,\vdash \, a \colon  A]]></fr:tex>, then <fr:tex display="inline"><![CDATA[\Gamma  \,\vdash \, a[\phi ] \colon  A[\phi ]]]></fr:tex>.</html:p>
              </fr:mainmatter>
            </fr:tree>
            <fr:tree show-metadata="false">
              <fr:frontmatter>
                <fr:authors>
                  <fr:author>
                    <fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link>
                  </fr:author>
                </fr:authors>
                <fr:date>
                  <fr:year>2025</fr:year>
                  <fr:month>2</fr:month>
                  <fr:day>28</fr:day>
                </fr:date>
                <fr:uri>https://forest.topos.site/ocl-007U/</fr:uri>
                <fr:display-uri>https://forest.topos.site/ocl-007U</fr:display-uri>
                <fr:route>/ocl-007U/</fr:route>
                <fr:title text="1-theories in \mathbb {D}">1-theories in <fr:tex display="inline"><![CDATA[\mathbb {D}]]></fr:tex></fr:title>
              </fr:frontmatter>
              <fr:mainmatter>
                <html:p>There is a surprising amount of power in just the basic setup for dependent type theory as given in <fr:link href="/ocl-007T/" title="Judgment structure of \mathbb {D}" uri="https://forest.topos.site/ocl-007T/" display-uri="https://forest.topos.site/ocl-007T" type="local">§ <fr:contextual-number uri="https://forest.topos.site/ocl-007T/" display-uri="https://forest.topos.site/ocl-007T" /></fr:link>. That is, without adding any type formers for dependent records, dependent functions, etc. (e.g., 2-theories) we can still do many non-trivial things with 1-theories, analogous to how the basic setup for simple type theory afforded algebraic theories as its 1-theories.</html:p>
                <html:p>The classical name for 1-theories in <fr:tex display="inline"><![CDATA[\mathbb {D}]]></fr:tex> is generalized algebraic theories <fr:link href="/cartmell-1986-generalised/" title="Generalised algebraic theories and contextual categories" uri="https://forest.topos.site/cartmell-1986-generalised/" display-uri="https://forest.topos.site/cartmell-1986-generalised" type="local">Reference <fr:contextual-number uri="https://forest.topos.site/cartmell-1986-generalised/" display-uri="https://forest.topos.site/cartmell-1986-generalised" /></fr:link>. All algebraic theories are also generalized algebraic theories; the canonical example of a generalized algebraic theory that is <html:em>not</html:em> an algebraic theory is the generalized algebraic theory of categories.</html:p>
                <fr:tree show-metadata="false">
                  <fr:frontmatter>
                    <fr:authors />
                    <fr:date>
                      <fr:year>2025</fr:year>
                      <fr:month>2</fr:month>
                      <fr:day>13</fr:day>
                    </fr:date>
                    <fr:uri>https://forest.topos.site/ocl-006L/</fr:uri>
                    <fr:display-uri>https://forest.topos.site/ocl-006L</fr:display-uri>
                    <fr:route>/ocl-006L/</fr:route>
                    <fr:title text="Categories as a generalized algebraic theory">Categories as a generalized algebraic theory</fr:title>
                    <fr:taxon>example</fr:taxon>
                  </fr:frontmatter>
                  <fr:mainmatter>
                    <html:p>The theory of categories is given by postulating the following judgments in dependent type theory; as discussed in <fr:link href="/ocl-007U/" title="1-theories in \mathbb {D}" uri="https://forest.topos.site/ocl-007U/" display-uri="https://forest.topos.site/ocl-007U" type="local">§ <fr:contextual-number uri="https://forest.topos.site/ocl-007U/" display-uri="https://forest.topos.site/ocl-007U" /></fr:link> such a postulation is equivalently a generalized algebraic theory.</html:p>
                    <html:ul><html:li><fr:tex display="inline"><![CDATA[\,\vdash \, \mathrm {Ob} \,\,\mathsf {type}]]></fr:tex></html:li>
<html:li><fr:tex display="inline"><![CDATA[x \colon  \mathrm {Ob}, y \colon  \mathrm {Ob} \,\vdash \, \mathrm {Hom}(x,y) \,\,\mathsf {type}]]></fr:tex></html:li>
<html:li><fr:tex display="inline"><![CDATA[x \colon  \mathrm {Ob} \,\vdash \, \mathrm {id}(x) \colon  \mathrm {Hom}(x,x)]]></fr:tex></html:li>
<html:li><fr:tex display="inline"><![CDATA[x \colon  \mathrm {Ob}, y \colon  \mathrm {Ob}, z \colon  \mathrm {Ob}, f \colon  \mathrm {Hom}(x,y), g \colon  \mathrm {Hom}(y,z) \,\vdash \, \mathrm {compose}(x,y,z,f,g) \colon  \mathrm {Hom}(x,z)]]></fr:tex></html:li>
<html:li><fr:tex display="inline"><![CDATA[x \colon  \mathrm {Ob}, y \colon  \mathrm {Ob}, f \colon  \mathrm {Hom}(x,y) \,\vdash \, \mathrm {compose}(x, y, y, f, \mathrm {id}(y)) = f \colon  \mathrm {Hom}(x,y)]]></fr:tex></html:li>
<html:li><fr:tex display="inline"><![CDATA[x \colon  \mathrm {Ob}, y \colon  \mathrm {Ob}, f \colon  \mathrm {Hom}(x,y) \,\vdash \, \mathrm {compose}(x, x, y, \mathrm {id}(x), f) = f \colon  \mathrm {Hom}(x,y)]]></fr:tex></html:li>
<html:li><fr:tex display="inline"><![CDATA[x \colon  \mathrm {Ob}, y \colon  \mathrm {Ob}, z \colon  \mathrm {Ob}, w \colon  \mathrm {Ob}, f \colon  \mathrm {Hom}(x,y), g \colon  \mathrm {Hom}(y,z), h \colon  \mathrm {Hom}(z,w) \,\vdash \, \mathrm {compose}(x, y, w, f, \mathrm {compose}(y,z,w, g, h)) = \mathrm {compose}(x, z, w, \mathrm {compose}(x,y,z,f,g), h) \colon  \mathrm {Hom}(x,w)]]></fr:tex></html:li></html:ul>
                  </fr:mainmatter>
                </fr:tree>
              </fr:mainmatter>
            </fr:tree>
            <fr:tree show-metadata="false">
              <fr:frontmatter>
                <fr:authors>
                  <fr:author>
                    <fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link>
                  </fr:author>
                </fr:authors>
                <fr:date>
                  <fr:year>2025</fr:year>
                  <fr:month>2</fr:month>
                  <fr:day>28</fr:day>
                </fr:date>
                <fr:uri>https://forest.topos.site/ocl-007V/</fr:uri>
                <fr:display-uri>https://forest.topos.site/ocl-007V</fr:display-uri>
                <fr:route>/ocl-007V/</fr:route>
                <fr:title text="Categorical semantics for \mathbb {D}">Categorical semantics for <fr:tex display="inline"><![CDATA[\mathbb {D}]]></fr:tex></fr:title>
              </fr:frontmatter>
              <fr:mainmatter><html:p>One popular categorical semantics for <fr:tex display="inline"><![CDATA[\mathbb {D}]]></fr:tex> is given by <html:em>natural models</html:em>, as introduced in <fr:link href="/awodey-2016-natural/" title="Natural models of homotopy type theory" uri="https://forest.topos.site/awodey-2016-natural/" display-uri="https://forest.topos.site/awodey-2016-natural" type="local">Reference <fr:contextual-number uri="https://forest.topos.site/awodey-2016-natural/" display-uri="https://forest.topos.site/awodey-2016-natural" /></fr:link> or <fr:link href="/newstead-2021-algebraic/" title="Algebraic models of dependent type theory" uri="https://forest.topos.site/newstead-2021-algebraic/" display-uri="https://forest.topos.site/newstead-2021-algebraic" type="local">Reference <fr:contextual-number uri="https://forest.topos.site/newstead-2021-algebraic/" display-uri="https://forest.topos.site/newstead-2021-algebraic" /></fr:link>.</html:p><html:p>Unfortunately, <fr:link href="/shulman-2016-catlog/" title="Categorical logic from a categorical point of view" uri="https://forest.topos.site/shulman-2016-catlog/" display-uri="https://forest.topos.site/shulman-2016-catlog" type="local">Reference <fr:contextual-number uri="https://forest.topos.site/shulman-2016-catlog/" display-uri="https://forest.topos.site/shulman-2016-catlog" /></fr:link> ends at hyperdoctrines and does not go on to dependent type theory, but a similarly rigorous account of the semantics of dependent type theory may be found in <fr:link href="/uemura-2023-general/" title="A general framework for the semantics of type theory" uri="https://forest.topos.site/uemura-2023-general/" display-uri="https://forest.topos.site/uemura-2023-general" type="local">Reference <fr:contextual-number uri="https://forest.topos.site/uemura-2023-general/" display-uri="https://forest.topos.site/uemura-2023-general" /></fr:link>.</html:p><html:p>We define natural model in the following definition, but note that the definition of natural model contains a concept (representable natural transformation) which we have not yet defined; we will define it after starting to give the correspondence between type theory and natural models so that the motivation for the definition is clear.</html:p><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link></fr:author></fr:authors><fr:date><fr:year>2025</fr:year><fr:month>3</fr:month><fr:day>11</fr:day></fr:date><fr:uri>https://forest.topos.site/ocl-009I/</fr:uri><fr:display-uri>https://forest.topos.site/ocl-009I</fr:display-uri><fr:route>/ocl-009I/</fr:route><fr:title text="Natural model">Natural model</fr:title><fr:taxon>definition</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>A <html:strong>natural model</html:strong> consists of a category <fr:tex display="inline"><![CDATA[\mathsf {Ctx}]]></fr:tex>, two presheaves <fr:tex display="inline"><![CDATA[\mathsf {Tm}, \mathsf {Ty} \colon  \mathsf {Ctx}^{\mathsf {op}} \to  \mathsf {Set}]]></fr:tex>, and a <fr:link href="/ocl-006J/" title="Representable natural transformation" uri="https://forest.topos.site/ocl-006J/" display-uri="https://forest.topos.site/ocl-006J" type="local">representable natural transformation</fr:link> <fr:tex display="inline"><![CDATA[\mathsf {u} \colon  \mathsf {Tm} \Rightarrow  \mathsf {Ty}]]></fr:tex>.</html:p></fr:mainmatter></fr:tree><html:p>The connection between natural models and dependent type theory can be summarized in the following table.</html:p><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link></fr:author></fr:authors><fr:date><fr:year>2025</fr:year><fr:month>3</fr:month><fr:day>11</fr:day></fr:date><fr:uri>https://forest.topos.site/ocl-009J/</fr:uri><fr:display-uri>https://forest.topos.site/ocl-009J</fr:display-uri><fr:route>/ocl-009J/</fr:route><fr:title text="Correspondence between type theory and natural models">Correspondence between type theory and natural models</fr:title><fr:taxon>table</fr:taxon></fr:frontmatter><fr:mainmatter><html:table><html:thead>
<html:tr><html:th>Type theory</html:th><html:th>Natural model</html:th></html:tr>
</html:thead><html:tbody>
<html:tr><html:td><fr:tex display="inline"><![CDATA[\Gamma  \,\,\mathsf {ctx}]]></fr:tex></html:td><html:td><fr:tex display="inline"><![CDATA[\Gamma ]]></fr:tex> is an object of <fr:tex display="inline"><![CDATA[\mathsf {Ctx}]]></fr:tex></html:td></html:tr>
<html:tr><html:td><fr:tex display="inline"><![CDATA[\phi ]]></fr:tex> is a substitution <fr:tex display="inline"><![CDATA[\Delta  \to  \Gamma ]]></fr:tex></html:td><html:td><fr:tex display="inline"><![CDATA[\phi ]]></fr:tex> is a morphism in <fr:tex display="inline"><![CDATA[\mathsf {Ctx}]]></fr:tex></html:td></html:tr>
<html:tr><html:td><fr:tex display="inline"><![CDATA[\Gamma  \,\vdash \, A \,\,\mathsf {type}]]></fr:tex></html:td><html:td><fr:tex display="inline"><![CDATA[A \in  \mathsf {Ty}(\Gamma )]]></fr:tex></html:td></html:tr>
<html:tr><html:td><fr:tex display="inline"><![CDATA[\Delta  \,\vdash \, A[\phi ] \,\,\mathsf {type}]]></fr:tex></html:td><html:td><fr:tex display="inline"><![CDATA[\mathsf {Ty}(\phi )(A) \in  \mathsf {Ty}(\Delta )]]></fr:tex></html:td></html:tr>
<html:tr><html:td><fr:tex display="inline"><![CDATA[\Gamma  \,\vdash \, A = A' \,\,\mathsf {type}]]></fr:tex></html:td><html:td><fr:tex display="inline"><![CDATA[A = A' \in  \mathsf {Ty}(\Gamma )]]></fr:tex></html:td></html:tr>
<html:tr><html:td><fr:tex display="inline"><![CDATA[\Gamma  \,\vdash \, a \colon  A]]></fr:tex></html:td><html:td><fr:tex display="inline"><![CDATA[a \in  \mathsf {Tm}(\Gamma )]]></fr:tex> and <fr:tex display="inline"><![CDATA[\mathsf {u}(a) = A]]></fr:tex></html:td></html:tr>
<html:tr><html:td><fr:tex display="inline"><![CDATA[\Delta  \,\vdash \, a[\phi ] \colon  A[\phi ]]]></fr:tex></html:td><html:td><fr:tex display="inline"><![CDATA[\mathsf {Tm}(\phi )(a) \in  \mathsf {Tm}(\Gamma )]]></fr:tex> + naturality of <fr:tex display="inline"><![CDATA[\mathsf {u}]]></fr:tex></html:td></html:tr>
<html:tr><html:td><fr:tex display="inline"><![CDATA[\Gamma  \,\vdash \, a = a' \colon  A]]></fr:tex></html:td><html:td><fr:tex display="inline"><![CDATA[a = a' \in  \mathsf {Tm}(\Gamma )]]></fr:tex></html:td></html:tr>
</html:tbody></html:table></fr:mainmatter></fr:tree><html:p>Notice that the big thing missing from <fr:link href="/ocl-009J/" title="Correspondence between type theory and natural models" uri="https://forest.topos.site/ocl-009J/" display-uri="https://forest.topos.site/ocl-009J" type="local">table <fr:contextual-number uri="https://forest.topos.site/ocl-009J/" display-uri="https://forest.topos.site/ocl-009J" /></fr:link> is context formation, as in <fr:link href="/ocl-009E/" title="Context formation" uri="https://forest.topos.site/ocl-009E/" display-uri="https://forest.topos.site/ocl-009E" type="local">rule <fr:contextual-number uri="https://forest.topos.site/ocl-009E/" display-uri="https://forest.topos.site/ocl-009E" /></fr:link>. This is addressed by the representability condition on <fr:tex display="inline"><![CDATA[\mathsf {u}]]></fr:tex>, as defined in <fr:link href="/ocl-006J/" title="Representable natural transformation" uri="https://forest.topos.site/ocl-006J/" display-uri="https://forest.topos.site/ocl-006J" type="local">definition <fr:contextual-number uri="https://forest.topos.site/ocl-006J/" display-uri="https://forest.topos.site/ocl-006J" /></fr:link>.</html:p><fr:tree show-metadata="false"><fr:frontmatter><fr:authors /><fr:date><fr:year>2025</fr:year><fr:month>2</fr:month><fr:day>13</fr:day></fr:date><fr:uri>https://forest.topos.site/ocl-006J/</fr:uri><fr:display-uri>https://forest.topos.site/ocl-006J</fr:display-uri><fr:route>/ocl-006J/</fr:route><fr:title text="Representable natural transformation">Representable natural transformation</fr:title><fr:taxon>definition</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>Let <fr:tex display="inline"><![CDATA[\mathsf {C}]]></fr:tex> be a category, with <fr:tex display="inline"><![CDATA[F, G \colon  \mathsf {Psh}(\mathsf {C})]]></fr:tex> and <fr:tex display="inline"><![CDATA[\alpha  \colon  F \to  G]]></fr:tex>. Then <fr:tex display="inline"><![CDATA[\alpha ]]></fr:tex> is <html:strong>representable</html:strong> if for any object <fr:tex display="inline"><![CDATA[X \colon  \mathsf {C}]]></fr:tex> and any element <fr:tex display="inline"><![CDATA[t \in  G(X)]]></fr:tex>, the pullback of the following diagram is a representable presheaf (recall that we identify <fr:tex display="inline"><![CDATA[t \in  G(X)]]></fr:tex> with <fr:tex display="inline"><![CDATA[t \colon  よ X \to  G]]></fr:tex>).</html:p>



<html:figure><fr:resource hash="5643635a89f9c1bcb21eada57d5630a2"><fr:resource-content><html:img src="https://forest.topos.site/5643635a89f9c1bcb21eada57d5630a2.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[

\usepackage[utf8]{inputenc}
\DeclareFontFamily{U}{min}{}
\DeclareFontShape{U}{min}{m}{n}{<-> udmj30}{}
\newcommand\yo{\!\text{\usefont{U}{min}{m}{n}\symbol{'207}}\!}
\DeclareUnicodeCharacter{3088}{\yo}


\usepackage{tikz, tikz-cd, mathtools, amssymb, stmaryrd,xcolor}
\usetikzlibrary{matrix,arrows}
\usetikzlibrary{backgrounds,fit,positioning,calc,shapes}
\usetikzlibrary{decorations.pathreplacing}
\usetikzlibrary{decorations.pathmorphing}
\usetikzlibrary{decorations.markings}

% `tikz-cd` is necessary to draw commutative diagrams.
\RequirePackage{tikz-cd}
% `amssymb` is necessary for `\lrcorner` and `\ulcorner`.
\RequirePackage{amssymb}
% `calc` is necessary to draw curved arrows.
\usetikzlibrary{calc}
% `pathmorphing` is necessary to draw squiggly arrows.
\usetikzlibrary{decorations.pathmorphing}
% `spath3` is necessary to draw shortened edges.
\usetikzlibrary{spath3}

% A TikZ style for curved arrows of a fixed height, due to AndréC.
\tikzset{curve/.style={settings={#1},to path={(\tikztostart)
    .. controls ($(\tikztostart)!\pv{pos}!(\tikztotarget)!\pv{height}!270:(\tikztotarget)$)
    and ($(\tikztostart)!1-\pv{pos}!(\tikztotarget)!\pv{height}!270:(\tikztotarget)$)
    .. (\tikztotarget)\tikztonodes}},
    settings/.code={\tikzset{quiver/.cd,#1}
        \def\pv##1{\pgfkeysvalueof{/tikz/quiver/##1}}},
    quiver/.cd,pos/.initial=0.35,height/.initial=0}

% A TikZ style for shortening paths without the poor behaviour of `shorten <' and `shorten >'.
\tikzset{between/.style n args={2}{/tikz/spath/at end path construction={
    \tikzset{spath/split at keep middle={current}{#1}{#2}}
}}}

% TikZ arrowhead/tail styles.
\tikzset{tail reversed/.code={\pgfsetarrowsstart{tikzcd to}}}
\tikzset{2tail/.code={\pgfsetarrowsstart{Implies[reversed]}}}
\tikzset{2tail reversed/.code={\pgfsetarrowsstart{Implies}}}
% TikZ arrow styles.
\tikzset{no body/.style={/tikz/dash pattern=on 0 off 1mm}}


\newcommand{\triplecolon}{%
  \mathrel{\vbox{\baselineskip=2pt \hbox{.}\hbox{.}\hbox{.}}}%
}

\DeclareUnicodeCharacter{2AF6}{\triplecolon}
\usepackage{mathpartir}

]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[
\begin {tikzcd}
	\bullet  & F \\
	{よ X} & G
	\arrow [from=1-1, to=1-2]
	\arrow [from=1-1, to=2-1]
	\arrow ["\lrcorner "{anchor=center, pos=0.125}, draw=none, from=1-1, to=2-2]
	\arrow ["\alpha ", from=1-2, to=2-2]
	\arrow ["t"', from=2-1, to=2-2]
\end {tikzcd}
]]></fr:resource-source></fr:resource></html:figure>

</fr:mainmatter></fr:tree><html:p>To interpret representability in the context of natural models, let <fr:tex display="inline"><![CDATA[\Gamma ]]></fr:tex> be a context with <fr:tex display="inline"><![CDATA[\Gamma  \,\vdash \, A \,\,\mathsf {type}]]></fr:tex>, and consider a diagram of the form:</html:p>



<html:figure><fr:resource hash="bc78dd70ddfd41d252d3be0c45830608"><fr:resource-content><html:img src="https://forest.topos.site/bc78dd70ddfd41d252d3be0c45830608.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[

\usepackage[utf8]{inputenc}
\DeclareFontFamily{U}{min}{}
\DeclareFontShape{U}{min}{m}{n}{<-> udmj30}{}
\newcommand\yo{\!\text{\usefont{U}{min}{m}{n}\symbol{'207}}\!}
\DeclareUnicodeCharacter{3088}{\yo}


\usepackage{tikz, tikz-cd, mathtools, amssymb, stmaryrd,xcolor}
\usetikzlibrary{matrix,arrows}
\usetikzlibrary{backgrounds,fit,positioning,calc,shapes}
\usetikzlibrary{decorations.pathreplacing}
\usetikzlibrary{decorations.pathmorphing}
\usetikzlibrary{decorations.markings}

% `tikz-cd` is necessary to draw commutative diagrams.
\RequirePackage{tikz-cd}
% `amssymb` is necessary for `\lrcorner` and `\ulcorner`.
\RequirePackage{amssymb}
% `calc` is necessary to draw curved arrows.
\usetikzlibrary{calc}
% `pathmorphing` is necessary to draw squiggly arrows.
\usetikzlibrary{decorations.pathmorphing}
% `spath3` is necessary to draw shortened edges.
\usetikzlibrary{spath3}

% A TikZ style for curved arrows of a fixed height, due to AndréC.
\tikzset{curve/.style={settings={#1},to path={(\tikztostart)
    .. controls ($(\tikztostart)!\pv{pos}!(\tikztotarget)!\pv{height}!270:(\tikztotarget)$)
    and ($(\tikztostart)!1-\pv{pos}!(\tikztotarget)!\pv{height}!270:(\tikztotarget)$)
    .. (\tikztotarget)\tikztonodes}},
    settings/.code={\tikzset{quiver/.cd,#1}
        \def\pv##1{\pgfkeysvalueof{/tikz/quiver/##1}}},
    quiver/.cd,pos/.initial=0.35,height/.initial=0}

% A TikZ style for shortening paths without the poor behaviour of `shorten <' and `shorten >'.
\tikzset{between/.style n args={2}{/tikz/spath/at end path construction={
    \tikzset{spath/split at keep middle={current}{#1}{#2}}
}}}

% TikZ arrowhead/tail styles.
\tikzset{tail reversed/.code={\pgfsetarrowsstart{tikzcd to}}}
\tikzset{2tail/.code={\pgfsetarrowsstart{Implies[reversed]}}}
\tikzset{2tail reversed/.code={\pgfsetarrowsstart{Implies}}}
% TikZ arrow styles.
\tikzset{no body/.style={/tikz/dash pattern=on 0 off 1mm}}


\newcommand{\triplecolon}{%
  \mathrel{\vbox{\baselineskip=2pt \hbox{.}\hbox{.}\hbox{.}}}%
}

\DeclareUnicodeCharacter{2AF6}{\triplecolon}
\usepackage{mathpartir}

]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[
\begin {tikzcd}
	& \mathsf {Tm} \\
	{よ\Gamma } & \mathsf {Ty}
	\arrow ["\mathsf {u}", from=1-2, to=2-2]
	\arrow ["A"', from=2-1, to=2-2]
\end {tikzcd}
]]></fr:resource-source></fr:resource></html:figure>

<html:p>Note that <fr:tex display="inline"><![CDATA[A \in  \mathsf {Ty}(\Gamma )]]></fr:tex> is, by the yoneda lemma, identified with a natural transformation out of <fr:tex display="inline"><![CDATA[よ \Gamma ]]></fr:tex>. Then representability says that the apex of the pullback is representable by another object of <fr:tex display="inline"><![CDATA[\mathsf {Ctx}]]></fr:tex>, which we name <fr:tex display="inline"><![CDATA[\Gamma , x \colon  A]]></fr:tex>.</html:p>



<html:figure><fr:resource hash="b4e803a36e6bb10448b13da59b62aef7"><fr:resource-content><html:img src="https://forest.topos.site/b4e803a36e6bb10448b13da59b62aef7.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[

\usepackage[utf8]{inputenc}
\DeclareFontFamily{U}{min}{}
\DeclareFontShape{U}{min}{m}{n}{<-> udmj30}{}
\newcommand\yo{\!\text{\usefont{U}{min}{m}{n}\symbol{'207}}\!}
\DeclareUnicodeCharacter{3088}{\yo}


\usepackage{tikz, tikz-cd, mathtools, amssymb, stmaryrd,xcolor}
\usetikzlibrary{matrix,arrows}
\usetikzlibrary{backgrounds,fit,positioning,calc,shapes}
\usetikzlibrary{decorations.pathreplacing}
\usetikzlibrary{decorations.pathmorphing}
\usetikzlibrary{decorations.markings}

% `tikz-cd` is necessary to draw commutative diagrams.
\RequirePackage{tikz-cd}
% `amssymb` is necessary for `\lrcorner` and `\ulcorner`.
\RequirePackage{amssymb}
% `calc` is necessary to draw curved arrows.
\usetikzlibrary{calc}
% `pathmorphing` is necessary to draw squiggly arrows.
\usetikzlibrary{decorations.pathmorphing}
% `spath3` is necessary to draw shortened edges.
\usetikzlibrary{spath3}

% A TikZ style for curved arrows of a fixed height, due to AndréC.
\tikzset{curve/.style={settings={#1},to path={(\tikztostart)
    .. controls ($(\tikztostart)!\pv{pos}!(\tikztotarget)!\pv{height}!270:(\tikztotarget)$)
    and ($(\tikztostart)!1-\pv{pos}!(\tikztotarget)!\pv{height}!270:(\tikztotarget)$)
    .. (\tikztotarget)\tikztonodes}},
    settings/.code={\tikzset{quiver/.cd,#1}
        \def\pv##1{\pgfkeysvalueof{/tikz/quiver/##1}}},
    quiver/.cd,pos/.initial=0.35,height/.initial=0}

% A TikZ style for shortening paths without the poor behaviour of `shorten <' and `shorten >'.
\tikzset{between/.style n args={2}{/tikz/spath/at end path construction={
    \tikzset{spath/split at keep middle={current}{#1}{#2}}
}}}

% TikZ arrowhead/tail styles.
\tikzset{tail reversed/.code={\pgfsetarrowsstart{tikzcd to}}}
\tikzset{2tail/.code={\pgfsetarrowsstart{Implies[reversed]}}}
\tikzset{2tail reversed/.code={\pgfsetarrowsstart{Implies}}}
% TikZ arrow styles.
\tikzset{no body/.style={/tikz/dash pattern=on 0 off 1mm}}


\newcommand{\triplecolon}{%
  \mathrel{\vbox{\baselineskip=2pt \hbox{.}\hbox{.}\hbox{.}}}%
}

\DeclareUnicodeCharacter{2AF6}{\triplecolon}
\usepackage{mathpartir}

]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[
\begin {tikzcd}
	{よ(\Gamma , x \colon  A)} & \mathsf {Tm} \\
	{よ\Gamma } & \mathsf {Ty}
	\arrow ["x", from=1-1, to=1-2]
	\arrow [from=1-1, to=2-1]
	\arrow ["\lrcorner "{anchor=center, pos=0.125}, draw=none, from=1-1, to=2-2]
	\arrow ["\mathsf {u}", from=1-2, to=2-2]
	\arrow ["A"', from=2-1, to=2-2]
\end {tikzcd}
]]></fr:resource-source></fr:resource></html:figure>

<html:p>This pullback diagram ingeniously interprets several type-theoretic rules at once.</html:p><html:ul><html:li>The object <fr:tex display="inline"><![CDATA[\Gamma , x\colon  A]]></fr:tex> represents the context extension of <fr:tex display="inline"><![CDATA[\Gamma ]]></fr:tex> by <fr:tex display="inline"><![CDATA[A]]></fr:tex>.</html:li>
<html:li>The action of <fr:tex display="inline"><![CDATA[(\Gamma , x: A) \to  \Gamma ]]></fr:tex> on types and terms gives us weakening.</html:li>
<html:li>The morphism <fr:tex display="inline"><![CDATA[x]]></fr:tex> represents the variable rule; we have a term <fr:tex display="inline"><![CDATA[x]]></fr:tex> of type <fr:tex display="inline"><![CDATA[A]]></fr:tex> in context <fr:tex display="inline"><![CDATA[\Gamma , x \colon  A]]></fr:tex></html:li></html:ul><html:p>Additionally, if we consider the universal property of pullback, it will tell us the unique way to form a substitution into <fr:tex display="inline"><![CDATA[\Gamma ]]></fr:tex>.</html:p>



<html:figure><fr:resource hash="22d4fbf2fc22e7bf7917e7b6605f3310"><fr:resource-content><html:img src="https://forest.topos.site/22d4fbf2fc22e7bf7917e7b6605f3310.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[

\usepackage[utf8]{inputenc}
\DeclareFontFamily{U}{min}{}
\DeclareFontShape{U}{min}{m}{n}{<-> udmj30}{}
\newcommand\yo{\!\text{\usefont{U}{min}{m}{n}\symbol{'207}}\!}
\DeclareUnicodeCharacter{3088}{\yo}


\usepackage{tikz, tikz-cd, mathtools, amssymb, stmaryrd,xcolor}
\usetikzlibrary{matrix,arrows}
\usetikzlibrary{backgrounds,fit,positioning,calc,shapes}
\usetikzlibrary{decorations.pathreplacing}
\usetikzlibrary{decorations.pathmorphing}
\usetikzlibrary{decorations.markings}

% `tikz-cd` is necessary to draw commutative diagrams.
\RequirePackage{tikz-cd}
% `amssymb` is necessary for `\lrcorner` and `\ulcorner`.
\RequirePackage{amssymb}
% `calc` is necessary to draw curved arrows.
\usetikzlibrary{calc}
% `pathmorphing` is necessary to draw squiggly arrows.
\usetikzlibrary{decorations.pathmorphing}
% `spath3` is necessary to draw shortened edges.
\usetikzlibrary{spath3}

% A TikZ style for curved arrows of a fixed height, due to AndréC.
\tikzset{curve/.style={settings={#1},to path={(\tikztostart)
    .. controls ($(\tikztostart)!\pv{pos}!(\tikztotarget)!\pv{height}!270:(\tikztotarget)$)
    and ($(\tikztostart)!1-\pv{pos}!(\tikztotarget)!\pv{height}!270:(\tikztotarget)$)
    .. (\tikztotarget)\tikztonodes}},
    settings/.code={\tikzset{quiver/.cd,#1}
        \def\pv##1{\pgfkeysvalueof{/tikz/quiver/##1}}},
    quiver/.cd,pos/.initial=0.35,height/.initial=0}

% A TikZ style for shortening paths without the poor behaviour of `shorten <' and `shorten >'.
\tikzset{between/.style n args={2}{/tikz/spath/at end path construction={
    \tikzset{spath/split at keep middle={current}{#1}{#2}}
}}}

% TikZ arrowhead/tail styles.
\tikzset{tail reversed/.code={\pgfsetarrowsstart{tikzcd to}}}
\tikzset{2tail/.code={\pgfsetarrowsstart{Implies[reversed]}}}
\tikzset{2tail reversed/.code={\pgfsetarrowsstart{Implies}}}
% TikZ arrow styles.
\tikzset{no body/.style={/tikz/dash pattern=on 0 off 1mm}}


\newcommand{\triplecolon}{%
  \mathrel{\vbox{\baselineskip=2pt \hbox{.}\hbox{.}\hbox{.}}}%
}

\DeclareUnicodeCharacter{2AF6}{\triplecolon}
\usepackage{mathpartir}

]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[
\begin {tikzcd}
	{よ\Delta } \\
	& {よ(\Gamma , x \colon  A)} & \mathsf {Tm} \\
	& {よ\Gamma } & \mathsf {Ty}
	\arrow ["{\psi ; a}"{description}, dotted, from=1-1, to=2-2]
	\arrow ["a", curve={height=-12pt}, from=1-1, to=2-3]
	\arrow ["\psi "', curve={height=12pt}, from=1-1, to=3-2]
	\arrow ["x", from=2-2, to=2-3]
	\arrow [from=2-2, to=3-2]
	\arrow ["\lrcorner "{anchor=center, pos=0.125}, draw=none, from=2-2, to=3-3]
	\arrow ["\mathsf {u}", from=2-3, to=3-3]
	\arrow ["{A}"', from=3-2, to=3-3]
\end {tikzcd}
]]></fr:resource-source></fr:resource></html:figure>

<html:p>This diagram says that if we have a substitution <fr:tex display="inline"><![CDATA[\psi  \colon  \Delta  \to  \Gamma ]]></fr:tex> and a term <fr:tex display="inline"><![CDATA[a]]></fr:tex> of type <fr:tex display="inline"><![CDATA[A[\psi ]]]></fr:tex> (that is, the action of <fr:tex display="inline"><![CDATA[\psi ]]></fr:tex> on the type <fr:tex display="inline"><![CDATA[A]]></fr:tex>), then we can form a substitution into <fr:tex display="inline"><![CDATA[\Gamma , x\colon  A]]></fr:tex>, and moreover all substitutions into <fr:tex display="inline"><![CDATA[\Gamma , x \colon  A]]></fr:tex> are produced in this manner. This is in accordance with the definition of substitution into an extended context that we gave in <fr:link href="/ocl-009G/" title="Dependent substitution" uri="https://forest.topos.site/ocl-009G/" display-uri="https://forest.topos.site/ocl-009G" type="local">definition <fr:contextual-number uri="https://forest.topos.site/ocl-009G/" display-uri="https://forest.topos.site/ocl-009G" /></fr:link>.</html:p><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link></fr:author></fr:authors><fr:date><fr:year>2025</fr:year><fr:month>3</fr:month><fr:day>11</fr:day></fr:date><fr:uri>https://forest.topos.site/ocl-009K/</fr:uri><fr:display-uri>https://forest.topos.site/ocl-009K</fr:display-uri><fr:route>/ocl-009K/</fr:route><fr:title text="Additional conditions on natural models">Additional conditions on natural models</fr:title><fr:taxon>remark</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>There are two additional conditions one might wish to put on a natural model. The first condition is that <fr:tex display="inline"><![CDATA[\mathsf {Ctx}]]></fr:tex> has a terminal object, which models the empty context. The second condition is that every object in <fr:tex display="inline"><![CDATA[\mathsf {Ctx}]]></fr:tex> is formed by repeated context extension from the terminal object. This is known as a “democratic” model.</html:p></fr:mainmatter></fr:tree></fr:mainmatter>
            </fr:tree>
            <fr:tree show-metadata="false">
              <fr:frontmatter>
                <fr:authors>
                  <fr:author>
                    <fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link>
                  </fr:author>
                </fr:authors>
                <fr:date>
                  <fr:year>2025</fr:year>
                  <fr:month>2</fr:month>
                  <fr:day>28</fr:day>
                </fr:date>
                <fr:uri>https://forest.topos.site/ocl-007W/</fr:uri>
                <fr:display-uri>https://forest.topos.site/ocl-007W</fr:display-uri>
                <fr:route>/ocl-007W/</fr:route>
                <fr:title text="2-theories in \mathbb {D} and their semantics">2-theories in <fr:tex display="inline"><![CDATA[\mathbb {D}]]></fr:tex> and their semantics</fr:title>
              </fr:frontmatter>
              <fr:mainmatter>
                <html:p>In this section, we will go over some of the inference rules one can add to <fr:tex display="inline"><![CDATA[\mathbb {D}]]></fr:tex> and their semantics from the natural models perspective. Note that combining <fr:link href="/ocl-007X/" title="Sigma types" uri="https://forest.topos.site/ocl-007X/" display-uri="https://forest.topos.site/ocl-007X" type="local">§ <fr:contextual-number uri="https://forest.topos.site/ocl-007X/" display-uri="https://forest.topos.site/ocl-007X" /></fr:link> and <fr:link href="/ocl-0080/" title="Pi types" uri="https://forest.topos.site/ocl-0080/" display-uri="https://forest.topos.site/ocl-0080" type="local">§ <fr:contextual-number uri="https://forest.topos.site/ocl-0080/" display-uri="https://forest.topos.site/ocl-0080" /></fr:link> gets you most of the way to Martin-Löf type theory.</html:p>
                <fr:tree show-metadata="false">
                  <fr:frontmatter>
                    <fr:authors>
                      <fr:contributor>
                        <fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link>
                      </fr:contributor>
                    </fr:authors>
                    <fr:date>
                      <fr:year>2025</fr:year>
                      <fr:month>2</fr:month>
                      <fr:day>28</fr:day>
                    </fr:date>
                    <fr:uri>https://forest.topos.site/ocl-007X/</fr:uri>
                    <fr:display-uri>https://forest.topos.site/ocl-007X</fr:display-uri>
                    <fr:route>/ocl-007X/</fr:route>
                    <fr:title text="Sigma types">Sigma types</fr:title>
                  </fr:frontmatter>
                  <fr:mainmatter><html:p>Sigma types are also known as dependent sums. They are called sigma types because the mathematical notation for disjoint union uses a capital sigma: <fr:tex display="inline"><![CDATA[\sum _{a \colon  A} B(a)]]></fr:tex>.</html:p><html:p>We start with the inference rules. These are presented in a different style than <fr:link href="/ocl-007Q/" title="Product types" uri="https://forest.topos.site/ocl-007Q/" display-uri="https://forest.topos.site/ocl-007Q" type="local">§ <fr:contextual-number uri="https://forest.topos.site/ocl-007Q/" display-uri="https://forest.topos.site/ocl-007Q" /></fr:link>, because writing out dependent sigma types in the style of <fr:link href="/ocl-007Q/" title="Product types" uri="https://forest.topos.site/ocl-007Q/" display-uri="https://forest.topos.site/ocl-007Q" type="local">§ <fr:contextual-number uri="https://forest.topos.site/ocl-007Q/" display-uri="https://forest.topos.site/ocl-007Q" /></fr:link> is somewhat annoying and in a structural type theory (a type theory with no restrictions on variable use), the two presentations are equivalent.</html:p><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link></fr:author></fr:authors><fr:date><fr:year>2025</fr:year><fr:month>3</fr:month><fr:day>11</fr:day></fr:date><fr:uri>https://forest.topos.site/ocl-009L/</fr:uri><fr:display-uri>https://forest.topos.site/ocl-009L</fr:display-uri><fr:route>/ocl-009L/</fr:route><fr:title text="Formation for sigma types">Formation for sigma types</fr:title><fr:taxon>rule</fr:taxon></fr:frontmatter><fr:mainmatter>
<fr:resource hash="560b1831a59f4ed8dff3819394d5f8ac"><fr:resource-content><html:img src="https://forest.topos.site/560b1831a59f4ed8dff3819394d5f8ac.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[\usepackage {mathpartir, amssymb, amsmath, mathtools}]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[
\begin {mathpar}

\inferrule {\Gamma  \,\vdash \, A \,\,\mathsf {type} \and  \Gamma , x \colon  A \,\vdash \, B \,\,\mathsf {type}}{\Gamma  \,\vdash \, (x \colon  A) \times  B \,\,\mathsf {type}}

\end {mathpar}
]]></fr:resource-source></fr:resource>
</fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link></fr:author></fr:authors><fr:date><fr:year>2025</fr:year><fr:month>3</fr:month><fr:day>11</fr:day></fr:date><fr:uri>https://forest.topos.site/ocl-009M/</fr:uri><fr:display-uri>https://forest.topos.site/ocl-009M</fr:display-uri><fr:route>/ocl-009M/</fr:route><fr:title text="Introduction and elimination for sigma types">Introduction and elimination for sigma types</fr:title><fr:taxon>rule</fr:taxon></fr:frontmatter><fr:mainmatter>
<fr:resource hash="0c4e1ac5a69d94f1093ddeadb14d3072"><fr:resource-content><html:img src="https://forest.topos.site/0c4e1ac5a69d94f1093ddeadb14d3072.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[\usepackage {mathpartir, amssymb, amsmath, mathtools}]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[
\begin {mathpar}

\inferrule {\Gamma  \,\vdash \, a \colon  A \and  \Gamma  \,\vdash \, b \colon  B[x \backslash  a]}{\Gamma  \,\vdash \, (a, b) \colon  (x \colon  A) \times  B} \and 
\inferrule {\Gamma  \,\vdash \, p \colon  (x \colon  A) \times  B}{\Gamma  \,\vdash \, p.0 \colon  A \and  \Gamma  \,\vdash \, p.1 \colon  B[x \backslash  p.0]}

\end {mathpar}
]]></fr:resource-source></fr:resource>
</fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link></fr:author></fr:authors><fr:date><fr:year>2025</fr:year><fr:month>3</fr:month><fr:day>11</fr:day></fr:date><fr:uri>https://forest.topos.site/ocl-009N/</fr:uri><fr:display-uri>https://forest.topos.site/ocl-009N</fr:display-uri><fr:route>/ocl-009N/</fr:route><fr:title text="Beta and eta for sigma types">Beta and eta for sigma types</fr:title><fr:taxon>rule</fr:taxon></fr:frontmatter><fr:mainmatter>
<fr:resource hash="712cba97cce1f808edfc70a3b6911f2f"><fr:resource-content><html:img src="https://forest.topos.site/712cba97cce1f808edfc70a3b6911f2f.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[\usepackage {mathpartir, amssymb, amsmath, mathtools}]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[
\begin {mathpar}

\inferrule {\Gamma  \,\vdash \, a \colon  A \and  \Gamma  \,\vdash \, b \colon  B[x \backslash  a]}{\Gamma  \,\vdash \, (a, b).0 = a \colon  A \and  \Gamma  \,\vdash \, (a,b).1 = b \colon  B[x \backslash  a]} \and 
\inferrule {\Gamma  \,\vdash \, p \colon  (x \colon  A) \times  B}{\Gamma  \,\vdash \, (p.0, p.1) = p \colon  (x \colon  A) \times  B}

\end {mathpar}
]]></fr:resource-source></fr:resource>
</fr:mainmatter></fr:tree><html:p>These inference rules above correspond to the following structure on a natural model. Specifically, we say that a certain morphism <fr:tex display="inline"><![CDATA[\Delta  \to  \Gamma ]]></fr:tex> is <html:em>small</html:em> if there exists a type <fr:tex display="inline"><![CDATA[A \in  \mathsf {Ty}(\Gamma )]]></fr:tex> with an isomorphism <fr:tex display="inline"><![CDATA[\Gamma , x \colon  A \cong  \Delta ]]></fr:tex> in the slice over <fr:tex display="inline"><![CDATA[\Gamma ]]></fr:tex>, such that the following commutes</html:p>



<html:figure><fr:resource hash="894f657e83736843a618c2ee1e292834"><fr:resource-content><html:img src="https://forest.topos.site/894f657e83736843a618c2ee1e292834.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[

\usepackage[utf8]{inputenc}
\DeclareFontFamily{U}{min}{}
\DeclareFontShape{U}{min}{m}{n}{<-> udmj30}{}
\newcommand\yo{\!\text{\usefont{U}{min}{m}{n}\symbol{'207}}\!}
\DeclareUnicodeCharacter{3088}{\yo}


\usepackage{tikz, tikz-cd, mathtools, amssymb, stmaryrd,xcolor}
\usetikzlibrary{matrix,arrows}
\usetikzlibrary{backgrounds,fit,positioning,calc,shapes}
\usetikzlibrary{decorations.pathreplacing}
\usetikzlibrary{decorations.pathmorphing}
\usetikzlibrary{decorations.markings}

% `tikz-cd` is necessary to draw commutative diagrams.
\RequirePackage{tikz-cd}
% `amssymb` is necessary for `\lrcorner` and `\ulcorner`.
\RequirePackage{amssymb}
% `calc` is necessary to draw curved arrows.
\usetikzlibrary{calc}
% `pathmorphing` is necessary to draw squiggly arrows.
\usetikzlibrary{decorations.pathmorphing}
% `spath3` is necessary to draw shortened edges.
\usetikzlibrary{spath3}

% A TikZ style for curved arrows of a fixed height, due to AndréC.
\tikzset{curve/.style={settings={#1},to path={(\tikztostart)
    .. controls ($(\tikztostart)!\pv{pos}!(\tikztotarget)!\pv{height}!270:(\tikztotarget)$)
    and ($(\tikztostart)!1-\pv{pos}!(\tikztotarget)!\pv{height}!270:(\tikztotarget)$)
    .. (\tikztotarget)\tikztonodes}},
    settings/.code={\tikzset{quiver/.cd,#1}
        \def\pv##1{\pgfkeysvalueof{/tikz/quiver/##1}}},
    quiver/.cd,pos/.initial=0.35,height/.initial=0}

% A TikZ style for shortening paths without the poor behaviour of `shorten <' and `shorten >'.
\tikzset{between/.style n args={2}{/tikz/spath/at end path construction={
    \tikzset{spath/split at keep middle={current}{#1}{#2}}
}}}

% TikZ arrowhead/tail styles.
\tikzset{tail reversed/.code={\pgfsetarrowsstart{tikzcd to}}}
\tikzset{2tail/.code={\pgfsetarrowsstart{Implies[reversed]}}}
\tikzset{2tail reversed/.code={\pgfsetarrowsstart{Implies}}}
% TikZ arrow styles.
\tikzset{no body/.style={/tikz/dash pattern=on 0 off 1mm}}


\newcommand{\triplecolon}{%
  \mathrel{\vbox{\baselineskip=2pt \hbox{.}\hbox{.}\hbox{.}}}%
}

\DeclareUnicodeCharacter{2AF6}{\triplecolon}
\usepackage{mathpartir}

]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[
\begin {tikzcd}
	{\Delta } && {\Gamma , x \colon  A} \\
	& {\Gamma }
	\arrow ["\sim ", from=1-1, to=1-3]
	\arrow [from=1-1, to=2-2]
	\arrow [from=1-3, to=2-2]
\end {tikzcd}
]]></fr:resource-source></fr:resource></html:figure>

<html:p>Then a natural model has sigma types if all morphisms <fr:tex display="inline"><![CDATA[(\Gamma , x \colon  A, y \colon  B) \to  \Gamma ]]></fr:tex> are small. Specifically, we have an isomorphism</html:p>



<html:figure><fr:resource hash="0ca1457a004c760047c08571271844e2"><fr:resource-content><html:img src="https://forest.topos.site/0ca1457a004c760047c08571271844e2.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[

\usepackage[utf8]{inputenc}
\DeclareFontFamily{U}{min}{}
\DeclareFontShape{U}{min}{m}{n}{<-> udmj30}{}
\newcommand\yo{\!\text{\usefont{U}{min}{m}{n}\symbol{'207}}\!}
\DeclareUnicodeCharacter{3088}{\yo}


\usepackage{tikz, tikz-cd, mathtools, amssymb, stmaryrd,xcolor}
\usetikzlibrary{matrix,arrows}
\usetikzlibrary{backgrounds,fit,positioning,calc,shapes}
\usetikzlibrary{decorations.pathreplacing}
\usetikzlibrary{decorations.pathmorphing}
\usetikzlibrary{decorations.markings}

% `tikz-cd` is necessary to draw commutative diagrams.
\RequirePackage{tikz-cd}
% `amssymb` is necessary for `\lrcorner` and `\ulcorner`.
\RequirePackage{amssymb}
% `calc` is necessary to draw curved arrows.
\usetikzlibrary{calc}
% `pathmorphing` is necessary to draw squiggly arrows.
\usetikzlibrary{decorations.pathmorphing}
% `spath3` is necessary to draw shortened edges.
\usetikzlibrary{spath3}

% A TikZ style for curved arrows of a fixed height, due to AndréC.
\tikzset{curve/.style={settings={#1},to path={(\tikztostart)
    .. controls ($(\tikztostart)!\pv{pos}!(\tikztotarget)!\pv{height}!270:(\tikztotarget)$)
    and ($(\tikztostart)!1-\pv{pos}!(\tikztotarget)!\pv{height}!270:(\tikztotarget)$)
    .. (\tikztotarget)\tikztonodes}},
    settings/.code={\tikzset{quiver/.cd,#1}
        \def\pv##1{\pgfkeysvalueof{/tikz/quiver/##1}}},
    quiver/.cd,pos/.initial=0.35,height/.initial=0}

% A TikZ style for shortening paths without the poor behaviour of `shorten <' and `shorten >'.
\tikzset{between/.style n args={2}{/tikz/spath/at end path construction={
    \tikzset{spath/split at keep middle={current}{#1}{#2}}
}}}

% TikZ arrowhead/tail styles.
\tikzset{tail reversed/.code={\pgfsetarrowsstart{tikzcd to}}}
\tikzset{2tail/.code={\pgfsetarrowsstart{Implies[reversed]}}}
\tikzset{2tail reversed/.code={\pgfsetarrowsstart{Implies}}}
% TikZ arrow styles.
\tikzset{no body/.style={/tikz/dash pattern=on 0 off 1mm}}


\newcommand{\triplecolon}{%
  \mathrel{\vbox{\baselineskip=2pt \hbox{.}\hbox{.}\hbox{.}}}%
}

\DeclareUnicodeCharacter{2AF6}{\triplecolon}
\usepackage{mathpartir}

]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[
\begin {tikzcd}
	{\Gamma , x \colon  A, y \colon  B} && {\Gamma , p \colon  (x \colon  A) \times  B} \\
	& {\Gamma }
	\arrow ["\sim ", from=1-1, to=1-3]
	\arrow [from=1-1, to=2-2]
	\arrow [from=1-3, to=2-2]
\end {tikzcd}
]]></fr:resource-source></fr:resource></html:figure>

<html:p>More generally, a natural model has sigma types if all composites of small morphisms are small.</html:p></fr:mainmatter>
                </fr:tree>
                <fr:tree show-metadata="false">
                  <fr:frontmatter>
                    <fr:authors>
                      <fr:contributor>
                        <fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link>
                      </fr:contributor>
                    </fr:authors>
                    <fr:date>
                      <fr:year>2025</fr:year>
                      <fr:month>2</fr:month>
                      <fr:day>28</fr:day>
                    </fr:date>
                    <fr:uri>https://forest.topos.site/ocl-007Y/</fr:uri>
                    <fr:display-uri>https://forest.topos.site/ocl-007Y</fr:display-uri>
                    <fr:route>/ocl-007Y/</fr:route>
                    <fr:title text="Sigma types via polynomial functors">Sigma types via polynomial functors</fr:title>
                  </fr:frontmatter>
                  <fr:mainmatter>
                    <html:p>In this section, we give an alternative presentation of the semantics for <fr:link href="/ocl-007X/" title="Sigma types" uri="https://forest.topos.site/ocl-007X/" display-uri="https://forest.topos.site/ocl-007X" type="local">§ <fr:contextual-number uri="https://forest.topos.site/ocl-007X/" display-uri="https://forest.topos.site/ocl-007X" /></fr:link>, which introduces some categorical machinery that we will want to use later on. This draws on material from <fr:link href="/awodey-2016-natural/" title="Natural models of homotopy type theory" uri="https://forest.topos.site/awodey-2016-natural/" display-uri="https://forest.topos.site/awodey-2016-natural" type="local">Reference <fr:contextual-number uri="https://forest.topos.site/awodey-2016-natural/" display-uri="https://forest.topos.site/awodey-2016-natural" /></fr:link>, as well as <fr:link href="/aberlé-2024-polynomial/" title="Polynomial Universes and Dependent Types" uri="https://forest.topos.site/aberlé-2024-polynomial/" display-uri="https://forest.topos.site/aberlé-2024-polynomial" type="local">Reference <fr:contextual-number uri="https://forest.topos.site/aberlé-2024-polynomial/" display-uri="https://forest.topos.site/aberlé-2024-polynomial" /></fr:link>.</html:p>
                    <html:p>Recall that the category of presheaves on a small category is a topos, and so in specific it is a locally cartesian closed category. Thus, for any morphism of presheaves <fr:tex display="inline"><![CDATA[f \colon  B \to  A]]></fr:tex>, there is a polynomial functor <fr:tex display="inline"><![CDATA[P_f \colon  \mathsf {Psh}(\mathsf {C}) \to  \mathsf {Psh}(\mathsf {C})]]></fr:tex> defined in the internal language by</html:p>
                    <fr:tex display="block"><![CDATA[P_f(X) = \sum _{a \colon  A} X^{f^{-1}(a)}]]></fr:tex>
                    <html:p>and defined externally by</html:p>
                    <fr:tex display="block"><![CDATA[(\mathsf {Psh}(\mathsf {C}) \xrightarrow {P_f} \mathsf {Psh}(\mathsf {C})) = (\mathsf {Psh}(\mathsf {C})/1 \xrightarrow {\Delta _{!_B}} \mathsf {Psh}(\mathsf {C})/B \xrightarrow {\Pi _f} \mathsf {Psh}(\mathsf {C})/A \xrightarrow {\Sigma _{!_A}} \mathsf {Psh}(\mathsf {C})/1)]]></fr:tex>
                    <html:p>where <fr:tex display="inline"><![CDATA[!_B \colon  B \to  1]]></fr:tex> and <fr:tex display="inline"><![CDATA[!_A \colon  A \to  1]]></fr:tex> are the unique morphisms to the terminal presheaf.</html:p>
                    <html:p>We are particularly interested in <fr:tex display="inline"><![CDATA[P_\mathsf {u} \colon  \mathsf {Psh}(\mathsf {Ctx}) \to  \mathsf {Psh}(\mathsf {Ctx})]]></fr:tex> for <fr:tex display="inline"><![CDATA[\mathsf {u} \colon  \mathsf {Tm} \to  \mathsf {Ty}]]></fr:tex> a natural model; we will be able to use this endofunctor to interpret the rules of inference for sigma types and pi types.</html:p>
                    <html:p>Why this works is that, morally speaking and working internal to <fr:tex display="inline"><![CDATA[\mathsf {Psh}(\mathsf {C})]]></fr:tex>, the polynomial <fr:tex display="inline"><![CDATA[P_\mathsf {u}]]></fr:tex> looks like</html:p>
                    <fr:tex display="block"><![CDATA[P_\mathsf {u}(X) = \sum _{A \colon  \mathbf {Type}} X^{\mathrm {El}(A)}]]></fr:tex>
                    <html:p>where <fr:tex display="inline"><![CDATA[A \colon  \mathbf {Type} \,\vdash \, \mathrm {El}(A) \,\,\mathsf {type}]]></fr:tex> is the internal version of the display map <fr:tex display="inline"><![CDATA[\mathsf {u} \colon  \mathsf {Tm} \to  \mathsf {Ty}]]></fr:tex>. <fr:tex display="inline"><![CDATA[\mathrm {El}]]></fr:tex> is short for “element”; <fr:tex display="inline"><![CDATA[\mathrm {El}(A)]]></fr:tex> is the type of elements of <fr:tex display="inline"><![CDATA[A]]></fr:tex>.</html:p>
                    <html:p>This gives an intuition for things like the composite, that is</html:p>
                    <fr:tex display="block"><![CDATA[
\begin {aligned}
(P_\mathsf {u} \circ  P_\mathsf {u})(X) &= \sum _{A \colon  \mathbf {Type}} \prod _{a \colon  \mathrm {El}(A)} \sum _{B \colon  \mathbf {Type}} X^{\mathrm {El}(B)} \\
&= \sum _{A \colon  \mathbf {Type}} \sum _{B \colon  \mathrm {El}(A) \to  \mathbf {Type}} \prod _{a \colon  \mathrm {El}(A)} X^{\mathrm {El}(B(a))} \\
&= \sum _{A \colon  \mathbf {Type}} \sum _{B \colon  \mathrm {El}(A) \to  \mathbf {Type}} X^{\sum _{a \colon  \mathrm {El}(a)} \mathrm {El}(B(a))}
\end {aligned}
]]></fr:tex>
                    <html:p>As a sigma type (which is a sigma type in the internal logic of presheaves on <fr:tex display="inline"><![CDATA[\mathsf {Ctx}]]></fr:tex>, not yet a sigma type in the type theory) shows up in the exponent for this composite, it is no surprise that this composite can be used to define sigma types in the type theory. Specifically, the existence of sigma types is equivalent to having a <html:em>cartesian morphism</html:em> <fr:tex display="inline"><![CDATA[P_\mathsf {u} \circ  P_\mathsf {u} \to  P_\mathsf {u}]]></fr:tex></html:p>
                    <fr:tree show-metadata="false">
                      <fr:frontmatter>
                        <fr:authors>
                          <fr:author>
                            <fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link>
                          </fr:author>
                        </fr:authors>
                        <fr:date>
                          <fr:year>2025</fr:year>
                          <fr:month>3</fr:month>
                          <fr:day>12</fr:day>
                        </fr:date>
                        <fr:uri>https://forest.topos.site/ocl-009R/</fr:uri>
                        <fr:display-uri>https://forest.topos.site/ocl-009R</fr:display-uri>
                        <fr:route>/ocl-009R/</fr:route>
                        <fr:title text="Cartesian morphism of polynomial functors">Cartesian morphism of polynomial functors</fr:title>
                        <fr:taxon>definition</fr:taxon>
                      </fr:frontmatter>
                      <fr:mainmatter>
                        <html:p>Given polynomial functors <fr:tex display="inline"><![CDATA[P(X) = \sum _{a \colon  A} X^{B(a)}]]></fr:tex> and <fr:tex display="inline"><![CDATA[Q(X) = \sum _{c \colon  C} X^{D(c)}]]></fr:tex> where <fr:tex display="inline"><![CDATA[a \colon  A \,\vdash \, B(a) \,\,\mathsf {type}]]></fr:tex> and <fr:tex display="inline"><![CDATA[c \colon  C \,\vdash \, D \,\,\mathsf {type}]]></fr:tex> are type families, then a cartesian morphism from <fr:tex display="inline"><![CDATA[P]]></fr:tex> to <fr:tex display="inline"><![CDATA[Q]]></fr:tex> consists of a pair <fr:tex display="inline"><![CDATA[(f, f^\sharp )]]></fr:tex>, where</html:p>
                        <fr:tex display="block"><![CDATA[f \colon  A \to  C]]></fr:tex>
                        <fr:tex display="block"><![CDATA[f^\sharp  \colon  (a \colon  A) \to  D(f(a)) \cong  B(a)]]></fr:tex>
                      </fr:mainmatter>
                    </fr:tree>
                    <html:p>Unwrapping <fr:link href="/ocl-009R/" title="Cartesian morphism of polynomial functors" uri="https://forest.topos.site/ocl-009R/" display-uri="https://forest.topos.site/ocl-009R" type="local">definition <fr:contextual-number uri="https://forest.topos.site/ocl-009R/" display-uri="https://forest.topos.site/ocl-009R" /></fr:link> in the case of <fr:tex display="inline"><![CDATA[P_\mathsf {u} \circ  P_\mathsf {u}]]></fr:tex> and
 <fr:tex display="inline"><![CDATA[P_\mathsf {u}]]></fr:tex>, we get a pair <fr:tex display="inline"><![CDATA[(f, f^\sharp )]]></fr:tex>, where</html:p>
                    <fr:tex display="block"><![CDATA[f \colon  \left (\sum _{A \colon  \mathbf {Type}} \mathrm {El}(A) \to  \mathbf {Type}\right ) \to  \mathbf {Type}]]></fr:tex>
                    <fr:tex display="block"><![CDATA[f^\sharp  \colon  \left ((A, B) \colon  \sum _{A \colon  \mathbf {Type}} \mathrm {El}(A) \to  \mathbf {Type}\right ) \to  \left (\sum _{a \colon  \mathrm {El}(a)} \mathrm {El}(B(a))\right ) \cong  \mathrm {El}(f(A, B))]]></fr:tex>
                    <html:p>We can identify <fr:tex display="inline"><![CDATA[f]]></fr:tex> with the formation rule for sigma types, and <fr:tex display="inline"><![CDATA[f^\sharp ]]></fr:tex> with the introduction, elimination, beta, and eta rules, which form the four parts of an equivalence as usual.</html:p>
                    <html:p>It turns out that (modulo some complications around the difference between equality and isomorphism), if we also give a unit type via a cartesian morphism <fr:tex display="inline"><![CDATA[1_{\mathsf {Psh}(\mathsf {Ctx})} \to  P_\mathsf {u}]]></fr:tex>, then <fr:tex display="inline"><![CDATA[P_\mathsf {u}]]></fr:tex> is in fact a cartesian monad (a monoid in the category of polynomial functors and cartesian morphisms with composition as the monoidal product). The left and right unit laws for this monad witness that, internal to the type theory</html:p>
                    <fr:tex display="block"><![CDATA[(x \colon  A) \times  1 \cong  A]]></fr:tex>
                    <fr:tex display="block"><![CDATA[(x \colon  1) \times  A \cong  A]]></fr:tex>
                    <html:p>and the associativity witnesses that (again internally)</html:p>
                    <fr:tex display="block"><![CDATA[(x \colon  A) \times  (y \colon  B(x) \times  C(x,y)) \cong  ((x,y) \colon  (x \colon  A) \times  B(x)) \times  C(x,y)]]></fr:tex>
                    <html:p>There are a variety of approaches to handling that these are isomorphisms and not equalities; in <fr:link href="/awodey-2018-polynomial/" title="Polynomial pseudomonads and dependent type theory" uri="https://forest.topos.site/awodey-2018-polynomial/" display-uri="https://forest.topos.site/awodey-2018-polynomial" type="local">Reference <fr:contextual-number uri="https://forest.topos.site/awodey-2018-polynomial/" display-uri="https://forest.topos.site/awodey-2018-polynomial" /></fr:link> Awodey and Newstead handle this with pseudomonads, and in <fr:link href="/aberlé-2024-polynomial/" title="Polynomial Universes and Dependent Types" uri="https://forest.topos.site/aberlé-2024-polynomial/" display-uri="https://forest.topos.site/aberlé-2024-polynomial" type="local">Reference <fr:contextual-number uri="https://forest.topos.site/aberlé-2024-polynomial/" display-uri="https://forest.topos.site/aberlé-2024-polynomial" /></fr:link>, Aberlé and Spivak handle this by taking their metatheory to be homotopy type theory rather than set theory.</html:p>
                  </fr:mainmatter>
                </fr:tree>
                <fr:tree show-metadata="false">
                  <fr:frontmatter>
                    <fr:authors>
                      <fr:author>
                        <fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link>
                      </fr:author>
                    </fr:authors>
                    <fr:date>
                      <fr:year>2025</fr:year>
                      <fr:month>2</fr:month>
                      <fr:day>28</fr:day>
                    </fr:date>
                    <fr:uri>https://forest.topos.site/ocl-007Z/</fr:uri>
                    <fr:display-uri>https://forest.topos.site/ocl-007Z</fr:display-uri>
                    <fr:route>/ocl-007Z/</fr:route>
                    <fr:title text="Dependent records">Dependent records</fr:title>
                  </fr:frontmatter>
                  <fr:mainmatter>
                    <html:p>A useful consequence of working with the universe as a polynomial functor is that the <fr:tex display="inline"><![CDATA[n]]></fr:tex>-ary generalization of sigma types, e.g. dependent records, becomes quite straightforwards to state. To do this, we first need to introduce the concept of the <html:em>free polynomial monad</html:em> on a polynomial functor.</html:p>
                    <fr:tree show-metadata="false">
                      <fr:frontmatter>
                        <fr:authors>
                          <fr:author>
                            <fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link>
                          </fr:author>
                        </fr:authors>
                        <fr:date>
                          <fr:year>2025</fr:year>
                          <fr:month>3</fr:month>
                          <fr:day>12</fr:day>
                        </fr:date>
                        <fr:uri>https://forest.topos.site/ocl-009S/</fr:uri>
                        <fr:display-uri>https://forest.topos.site/ocl-009S</fr:display-uri>
                        <fr:route>/ocl-009S/</fr:route>
                        <fr:title text="The free polynomial monad on a polynomial functor">The free polynomial monad on a polynomial functor</fr:title>
                        <fr:taxon>definition</fr:taxon>
                      </fr:frontmatter>
                      <fr:mainmatter>
                        <html:p>Given any locally cartesian closed category <fr:tex display="inline"><![CDATA[\cal {E}]]></fr:tex> (or, more generally, a category with finite limits and a chosen class of exponentiable maps), there is a category of polynomial monads <fr:tex display="inline"><![CDATA[\mathsf {MonPoly}(\cal {E})]]></fr:tex>, which are monoids in the category of polynomial functors on <fr:tex display="inline"><![CDATA[\cal {E}]]></fr:tex>. There is a forgetful functor <fr:tex display="inline"><![CDATA[U \colon  \mathsf {MonPoly}(\cal {E}) \to  \mathsf {Poly}(\cal {E})]]></fr:tex>. Depending on the category <fr:tex display="inline"><![CDATA[\cal {E}]]></fr:tex>, there may or may not be a left adjoint to this forgetful functor; for <fr:tex display="inline"><![CDATA[\cal {E} = \mathsf {Set}]]></fr:tex> the existence of this left adjoint may be proved via transfinite induction, see <fr:link href="/libkind-2024-pattern/" title="Pattern runs on matter: The free monad monad as a module over the cofree comonad comonad" uri="https://forest.topos.site/libkind-2024-pattern/" display-uri="https://forest.topos.site/libkind-2024-pattern" type="local">Reference <fr:contextual-number uri="https://forest.topos.site/libkind-2024-pattern/" display-uri="https://forest.topos.site/libkind-2024-pattern" /></fr:link> for details.</html:p>
                        <html:p>However, for a specific polynomial <fr:tex display="inline"><![CDATA[P]]></fr:tex>, we may ask if there is a free polynomial monad on <fr:tex display="inline"><![CDATA[P]]></fr:tex>, which is equivalent to asking if the slice category <fr:tex display="inline"><![CDATA[P \downarrow  U]]></fr:tex> has an initial object; if the left adjoint existed, this is where it would have to send <fr:tex display="inline"><![CDATA[P]]></fr:tex>. We will take this (an initial object of <fr:tex display="inline"><![CDATA[P \downarrow  U]]></fr:tex>) to be our definition of the free polynomial monad on <fr:tex display="inline"><![CDATA[P]]></fr:tex>, and call this <fr:tex display="inline"><![CDATA[\mathfrak {m}_P]]></fr:tex>.</html:p>
                      </fr:mainmatter>
                    </fr:tree>
                    <html:p>In “good” cases (for instance, polynomial functors on set with finite degrees), the free polynomial monad on a polynomial functor <fr:tex display="inline"><![CDATA[P]]></fr:tex> can be compuuted as the colimit of</html:p>
                    <fr:tex display="block"><![CDATA[P_0 \to  P_1 \to  P_2 \to  \cdots ]]></fr:tex>
                    <html:p>where <fr:tex display="inline"><![CDATA[P_0 = y]]></fr:tex>, and <fr:tex display="inline"><![CDATA[P_{i+1} = y + P \circ  P_i]]></fr:tex>, <fr:tex display="inline"><![CDATA[y]]></fr:tex> being the identity polynomial. Intuitively, this colimit is something like</html:p>
                    <fr:tex display="block"><![CDATA[y + P + P^2 + P^3 + \cdots ]]></fr:tex>
                    <html:p>Thus, a cartesian map <fr:tex display="inline"><![CDATA[\mathfrak {m}_P \to  P]]></fr:tex> gives a “record type” for every arity simultaneously (classical sigma types are given by <fr:tex display="inline"><![CDATA[P^2 \to  P]]></fr:tex>), and if we furthermore assume that this is an algebra for the free monad monad we get analogous conditions to the assumption that <fr:tex display="inline"><![CDATA[P]]></fr:tex> was a monad in <fr:link href="/ocl-007Z/" title="Dependent records" uri="https://forest.topos.site/ocl-007Z/" display-uri="https://forest.topos.site/ocl-007Z" type="local">§ <fr:contextual-number uri="https://forest.topos.site/ocl-007Z/" display-uri="https://forest.topos.site/ocl-007Z" /></fr:link>.</html:p>
                    <html:p>Note: perhaps even when the free monad is not computed by that specific colimit, we in fact want to use that specific colimit? Is that specific colimit still a monad, even if it is not the free monad monad?</html:p>
                  </fr:mainmatter>
                </fr:tree>
                <fr:tree show-metadata="false">
                  <fr:frontmatter>
                    <fr:authors>
                      <fr:author>
                        <fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link>
                      </fr:author>
                    </fr:authors>
                    <fr:date>
                      <fr:year>2025</fr:year>
                      <fr:month>2</fr:month>
                      <fr:day>28</fr:day>
                    </fr:date>
                    <fr:uri>https://forest.topos.site/ocl-0080/</fr:uri>
                    <fr:display-uri>https://forest.topos.site/ocl-0080</fr:display-uri>
                    <fr:route>/ocl-0080/</fr:route>
                    <fr:title text="Pi types">Pi types</fr:title>
                  </fr:frontmatter>
                  <fr:mainmatter><html:p>The rules for pi types are analogous to <fr:link href="/ocl-007R/" title="Function types" uri="https://forest.topos.site/ocl-007R/" display-uri="https://forest.topos.site/ocl-007R" type="local">§ <fr:contextual-number uri="https://forest.topos.site/ocl-007R/" display-uri="https://forest.topos.site/ocl-007R" /></fr:link>.</html:p><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link></fr:author></fr:authors><fr:date><fr:year>2025</fr:year><fr:month>3</fr:month><fr:day>11</fr:day></fr:date><fr:uri>https://forest.topos.site/ocl-009O/</fr:uri><fr:display-uri>https://forest.topos.site/ocl-009O</fr:display-uri><fr:route>/ocl-009O/</fr:route><fr:title text="Formation for pi types">Formation for pi types</fr:title><fr:taxon>rule</fr:taxon></fr:frontmatter><fr:mainmatter>
<fr:resource hash="cf841c2dade25bbf829ca67e3851894b"><fr:resource-content><html:img src="https://forest.topos.site/cf841c2dade25bbf829ca67e3851894b.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[\usepackage {mathpartir, amssymb, amsmath, mathtools}]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[
\begin {mathpar}

\inferrule {\Gamma  \,\vdash \, A \,\,\mathsf {type} \and  \Gamma , x \colon  A \,\vdash \, B \,\,\mathsf {type}}{\Gamma  \,\vdash \, (x \colon  A) \to  B \,\,\mathsf {type}}

\end {mathpar}
]]></fr:resource-source></fr:resource>
</fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link></fr:author></fr:authors><fr:date><fr:year>2025</fr:year><fr:month>3</fr:month><fr:day>11</fr:day></fr:date><fr:uri>https://forest.topos.site/ocl-009P/</fr:uri><fr:display-uri>https://forest.topos.site/ocl-009P</fr:display-uri><fr:route>/ocl-009P/</fr:route><fr:title text="Introduction and elimination for pi types">Introduction and elimination for pi types</fr:title><fr:taxon>rule</fr:taxon></fr:frontmatter><fr:mainmatter>
<fr:resource hash="50b395b44ca1cca8790b2b9e97ba39ff"><fr:resource-content><html:img src="https://forest.topos.site/50b395b44ca1cca8790b2b9e97ba39ff.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[\usepackage {mathpartir, amssymb, amsmath, mathtools}]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[
\begin {mathpar}

\inferrule {\Gamma , x \colon  A \,\vdash \, b \colon  B}{\Gamma  \,\vdash \, ((x \colon  A) \mapsto  B) \colon  (x \colon  A) \to  B} \and 
\inferrule {\Gamma  \,\vdash \, f \colon  (x \colon  A) \to  B \and  \Gamma  \,\vdash \, a \colon  A}{\Gamma  \,\vdash \, f(a) \colon  B[x \backslash  a]}

\end {mathpar}
]]></fr:resource-source></fr:resource>
</fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link></fr:author></fr:authors><fr:date><fr:year>2025</fr:year><fr:month>3</fr:month><fr:day>11</fr:day></fr:date><fr:uri>https://forest.topos.site/ocl-009Q/</fr:uri><fr:display-uri>https://forest.topos.site/ocl-009Q</fr:display-uri><fr:route>/ocl-009Q/</fr:route><fr:title text="Beta and eta for pi types">Beta and eta for pi types</fr:title><fr:taxon>rule</fr:taxon></fr:frontmatter><fr:mainmatter>
<fr:resource hash="29a3b9266ab02b3e0d2b0b0f43340e9a"><fr:resource-content><html:img src="https://forest.topos.site/29a3b9266ab02b3e0d2b0b0f43340e9a.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[\usepackage {mathpartir, amssymb, amsmath, mathtools}]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[
\begin {mathpar}

\inferrule {\Gamma , x \colon  A \,\vdash \, b \colon  B \and  \Gamma  \,\vdash \, a \colon  A}{\Gamma  \,\vdash \, (x \mapsto  b)(a) = b[x \backslash  a] \colon  B[x \backslash  a]} \and 
\inferrule {\Gamma  \,\vdash \, f \colon  (x \colon  A) \to  B}{\Gamma  \,\vdash \, f = (x \mapsto  f(x)) \colon  (x \colon  A) \to  B}

\end {mathpar}
]]></fr:resource-source></fr:resource>
</fr:mainmatter></fr:tree><html:p>Following <fr:link href="/awodey-2016-natural/" title="Natural models of homotopy type theory" uri="https://forest.topos.site/awodey-2016-natural/" display-uri="https://forest.topos.site/awodey-2016-natural" type="local">Reference <fr:contextual-number uri="https://forest.topos.site/awodey-2016-natural/" display-uri="https://forest.topos.site/awodey-2016-natural" /></fr:link>, this corresponds to the existence of a pullback square</html:p>



<html:figure><fr:resource hash="63b08d8a6d51efaae3d5cf4772a9d932"><fr:resource-content><html:img src="https://forest.topos.site/63b08d8a6d51efaae3d5cf4772a9d932.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[

\usepackage[utf8]{inputenc}
\DeclareFontFamily{U}{min}{}
\DeclareFontShape{U}{min}{m}{n}{<-> udmj30}{}
\newcommand\yo{\!\text{\usefont{U}{min}{m}{n}\symbol{'207}}\!}
\DeclareUnicodeCharacter{3088}{\yo}


\usepackage{tikz, tikz-cd, mathtools, amssymb, stmaryrd,xcolor}
\usetikzlibrary{matrix,arrows}
\usetikzlibrary{backgrounds,fit,positioning,calc,shapes}
\usetikzlibrary{decorations.pathreplacing}
\usetikzlibrary{decorations.pathmorphing}
\usetikzlibrary{decorations.markings}

% `tikz-cd` is necessary to draw commutative diagrams.
\RequirePackage{tikz-cd}
% `amssymb` is necessary for `\lrcorner` and `\ulcorner`.
\RequirePackage{amssymb}
% `calc` is necessary to draw curved arrows.
\usetikzlibrary{calc}
% `pathmorphing` is necessary to draw squiggly arrows.
\usetikzlibrary{decorations.pathmorphing}
% `spath3` is necessary to draw shortened edges.
\usetikzlibrary{spath3}

% A TikZ style for curved arrows of a fixed height, due to AndréC.
\tikzset{curve/.style={settings={#1},to path={(\tikztostart)
    .. controls ($(\tikztostart)!\pv{pos}!(\tikztotarget)!\pv{height}!270:(\tikztotarget)$)
    and ($(\tikztostart)!1-\pv{pos}!(\tikztotarget)!\pv{height}!270:(\tikztotarget)$)
    .. (\tikztotarget)\tikztonodes}},
    settings/.code={\tikzset{quiver/.cd,#1}
        \def\pv##1{\pgfkeysvalueof{/tikz/quiver/##1}}},
    quiver/.cd,pos/.initial=0.35,height/.initial=0}

% A TikZ style for shortening paths without the poor behaviour of `shorten <' and `shorten >'.
\tikzset{between/.style n args={2}{/tikz/spath/at end path construction={
    \tikzset{spath/split at keep middle={current}{#1}{#2}}
}}}

% TikZ arrowhead/tail styles.
\tikzset{tail reversed/.code={\pgfsetarrowsstart{tikzcd to}}}
\tikzset{2tail/.code={\pgfsetarrowsstart{Implies[reversed]}}}
\tikzset{2tail reversed/.code={\pgfsetarrowsstart{Implies}}}
% TikZ arrow styles.
\tikzset{no body/.style={/tikz/dash pattern=on 0 off 1mm}}


\newcommand{\triplecolon}{%
  \mathrel{\vbox{\baselineskip=2pt \hbox{.}\hbox{.}\hbox{.}}}%
}

\DeclareUnicodeCharacter{2AF6}{\triplecolon}
\usepackage{mathpartir}

]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[
\begin {tikzcd}
	{P_\mathsf {u}(\mathsf {Tm})} & \mathsf {Tm} \\
	{P_\mathsf {u}(\mathsf {Ty})} & \mathsf {Ty}
	\arrow ["\lambda ", from=1-1, to=1-2]
	\arrow ["{P_\mathsf {u}(\mathsf {u})}"', from=1-1, to=2-1]
	\arrow ["\lrcorner "{anchor=center, pos=0.125}, draw=none, from=1-1, to=2-2]
	\arrow ["\mathsf {u}", from=1-2, to=2-2]
	\arrow ["\Pi "', from=2-1, to=2-2]
\end {tikzcd}
]]></fr:resource-source></fr:resource></html:figure>

<html:p>Let us work out what that means, by working internally. An element of <fr:tex display="inline"><![CDATA[P_\mathsf {u}(\mathsf {Ty}) = \sum _{A \colon  \mathbf {Type}} \mathbf {Type}^{\mathrm {El}(A)}]]></fr:tex> is a type <fr:tex display="inline"><![CDATA[A]]></fr:tex> with another type depending on it, that is <fr:tex display="inline"><![CDATA[a \colon  A \,\vdash \, B(a) \,\,\mathsf {type}]]></fr:tex>. The morphism <fr:tex display="inline"><![CDATA[\Pi ]]></fr:tex> takes this setup to a new type <fr:tex display="inline"><![CDATA[\Pi (A,B)]]></fr:tex>, which we may identify with <fr:tex display="inline"><![CDATA[(a \colon  A) \to  B(a)]]></fr:tex>. An element of <fr:tex display="inline"><![CDATA[P_\mathsf {u}(\mathsf {Tm})]]></fr:tex> is a type <fr:tex display="inline"><![CDATA[A]]></fr:tex> with a term of some type depending on it, that is <fr:tex display="inline"><![CDATA[a \colon  A \,\vdash \, b \colon  B(a)]]></fr:tex>, and the projection downwards forgets that term. The morphism <fr:tex display="inline"><![CDATA[\lambda ]]></fr:tex> takes this setup to <fr:tex display="inline"><![CDATA[(a \colon  A) \mapsto  b]]></fr:tex>, which is a term of <fr:tex display="inline"><![CDATA[(a \colon  A) \to  B(a)]]></fr:tex> (by commutativity of the square). Then the fact that the square is a pullback gives the elimination, beta, and eta laws.</html:p><html:p>We can think about this pullback square in a different way, by considering <fr:tex display="inline"><![CDATA[P_\mathsf {u} \colon  P_\mathsf {u}(\mathsf {Tm}) \to  P_\mathsf {u}(\mathsf {Ty})]]></fr:tex> as itself a polynomial functor. In <fr:link href="/aberlé-2024-polynomial/" title="Polynomial Universes and Dependent Types" uri="https://forest.topos.site/aberlé-2024-polynomial/" display-uri="https://forest.topos.site/aberlé-2024-polynomial" type="local">Reference <fr:contextual-number uri="https://forest.topos.site/aberlé-2024-polynomial/" display-uri="https://forest.topos.site/aberlé-2024-polynomial" /></fr:link>, this polynomial functor is called <fr:tex display="inline"><![CDATA[P_\mathsf {u} \upuparrows  P_\mathsf {u}]]></fr:tex>. Then the pullback square is equivalent to a cartesian morphism from <fr:tex display="inline"><![CDATA[P_\mathsf {u} \upuparrows  P_\mathsf {u}]]></fr:tex> to <fr:tex display="inline"><![CDATA[P_\mathsf {u}]]></fr:tex>.</html:p></fr:mainmatter>
                </fr:tree>
                <fr:tree show-metadata="false">
                  <fr:frontmatter>
                    <fr:authors>
                      <fr:contributor>
                        <fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link>
                      </fr:contributor>
                    </fr:authors>
                    <fr:date>
                      <fr:year>2025</fr:year>
                      <fr:month>2</fr:month>
                      <fr:day>28</fr:day>
                    </fr:date>
                    <fr:uri>https://forest.topos.site/ocl-0081/</fr:uri>
                    <fr:display-uri>https://forest.topos.site/ocl-0081</fr:display-uri>
                    <fr:route>/ocl-0081/</fr:route>
                    <fr:title text="Extensional equality types">Extensional equality types</fr:title>
                  </fr:frontmatter>
                  <fr:mainmatter><html:p>Equality types are a tricky business in type theory, because each of the two main approaches (intensional and extensional) have major drawbacks. Intensional equality types complicate the use of equality types internally (which leads to so-called “transport hell”), but extensional equality types make full derivation reconstruction from terms undecidable.</html:p><html:p>From a purely logical viewpoint however, where we study the structure of derivation trees not the algorithmics of reconstructing derivations trees from terms, there is no problem with extensional equality types. Moreover, as we will see later on, there are partial derivation reconstruction algorithms for type theory with extensional equality types which are nevertheless quite usable.</html:p><html:p>Without further ado, we present the rules for extensional equality types.</html:p><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link></fr:author></fr:authors><fr:date><fr:year>2025</fr:year><fr:month>3</fr:month><fr:day>12</fr:day></fr:date><fr:uri>https://forest.topos.site/ocl-009T/</fr:uri><fr:display-uri>https://forest.topos.site/ocl-009T</fr:display-uri><fr:route>/ocl-009T/</fr:route><fr:title text="Equality formation">Equality formation</fr:title><fr:taxon>rule</fr:taxon></fr:frontmatter><fr:mainmatter>
<fr:resource hash="64336a9c0b042012002f5afdf3e9961d"><fr:resource-content><html:img src="https://forest.topos.site/64336a9c0b042012002f5afdf3e9961d.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[\usepackage {mathpartir, amssymb, amsmath, mathtools}]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[
\begin {mathpar}

\inferrule {\Gamma  \,\vdash \, A \,\,\mathsf {type}}{\Gamma , x \colon  A, y \colon  A \,\vdash \, x =\hspace {-0.2em} =_A y \,\,\mathsf {type}}

\end {mathpar}
]]></fr:resource-source></fr:resource>
<html:p>We use <fr:tex display="inline"><![CDATA[=\hspace {-0.2em} =]]></fr:tex> to distinguish from judgmental equality, which uses <fr:tex display="inline"><![CDATA[=]]></fr:tex>, following the use of <html:code>==</html:code> in typical programming languages to check equality.</html:p></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link></fr:author></fr:authors><fr:date><fr:year>2025</fr:year><fr:month>3</fr:month><fr:day>12</fr:day></fr:date><fr:uri>https://forest.topos.site/ocl-009U/</fr:uri><fr:display-uri>https://forest.topos.site/ocl-009U</fr:display-uri><fr:route>/ocl-009U/</fr:route><fr:title text="Equality introduction and elimination">Equality introduction and elimination</fr:title><fr:taxon>rule</fr:taxon></fr:frontmatter><fr:mainmatter>
<fr:resource hash="ff6f54d77a076521abfdb691b1dc0623"><fr:resource-content><html:img src="https://forest.topos.site/ff6f54d77a076521abfdb691b1dc0623.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[\usepackage {mathpartir, amssymb, amsmath, mathtools}]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[
\begin {mathpar}

\inferrule {\Gamma  \,\vdash \, a = a' \colon  A}{\Gamma  \,\vdash \, \mathtt {refl} \colon  a =\hspace {-0.2em} =_A a'} \and 
\inferrule {\Gamma  \,\vdash \, e \colon  a =\hspace {-0.2em} =_A a'}{\Gamma  \,\vdash \, a = a' \colon  A}

\end {mathpar}
]]></fr:resource-source></fr:resource>
<html:p>The introduction rule might look slightly strange, because normally <fr:tex display="inline"><![CDATA[\mathtt {refl}]]></fr:tex> is a constructor applied to an argument, but we present the rule in this way because it corresponds closely to how one would check extensional equality in a bidirectional type checker; when one checks <fr:tex display="inline"><![CDATA[\mathtt {refl}]]></fr:tex> against an equality type, one does a conversion check between the two sides of that equality.</html:p></fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link></fr:author></fr:authors><fr:date><fr:year>2025</fr:year><fr:month>3</fr:month><fr:day>12</fr:day></fr:date><fr:uri>https://forest.topos.site/ocl-009V/</fr:uri><fr:display-uri>https://forest.topos.site/ocl-009V</fr:display-uri><fr:route>/ocl-009V/</fr:route><fr:title text="Equality beta and eta">Equality beta and eta</fr:title><fr:taxon>rule</fr:taxon></fr:frontmatter><fr:mainmatter><html:p>Really, we only need the eta rule, which states that the equality type is judgmentally contractible.</html:p>
<fr:resource hash="65d58d27385a3564fcb3fe5480792ea6"><fr:resource-content><html:img src="https://forest.topos.site/65d58d27385a3564fcb3fe5480792ea6.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[\usepackage {mathpartir, amssymb, amsmath, mathtools}]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[
\begin {mathpar}

\inferrule {\Gamma  \,\vdash \, e \colon  a =\hspace {-0.2em} =_A a'}{\Gamma  \,\vdash \, e = \mathtt {refl} \colon  a =\hspace {-0.2em} =_A a'}

\end {mathpar}
]]></fr:resource-source></fr:resource>
<html:p>The beta rule is implicit in the assumption that judgmental equality is already contractible. If we were working in a homotopy type-theoretic metatheory, where this was not the case, then <fr:tex display="inline"><![CDATA[\mathtt {refl}]]></fr:tex> would depend on the specific metatheoretic equality we chose, and we would have a beta rule which said that eliminating from <fr:tex display="inline"><![CDATA[\mathtt {refl}]]></fr:tex> gave back the same metatheoretic equality; such a perspective is explored in <fr:link href="/nguyen-2022-inftytype/" title="\infty -type theories" uri="https://forest.topos.site/nguyen-2022-inftytype/" display-uri="https://forest.topos.site/nguyen-2022-inftytype" type="local">Reference <fr:contextual-number uri="https://forest.topos.site/nguyen-2022-inftytype/" display-uri="https://forest.topos.site/nguyen-2022-inftytype" /></fr:link>.</html:p></fr:mainmatter></fr:tree><html:p>Equality types are interpreted by the following pullback square, which may also be thought of as a cartesian morphism of polynomial functors</html:p>



<html:figure><fr:resource hash="25bf0787500d6371940b9ee00b848e6f"><fr:resource-content><html:img src="https://forest.topos.site/25bf0787500d6371940b9ee00b848e6f.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[

\usepackage[utf8]{inputenc}
\DeclareFontFamily{U}{min}{}
\DeclareFontShape{U}{min}{m}{n}{<-> udmj30}{}
\newcommand\yo{\!\text{\usefont{U}{min}{m}{n}\symbol{'207}}\!}
\DeclareUnicodeCharacter{3088}{\yo}


\usepackage{tikz, tikz-cd, mathtools, amssymb, stmaryrd,xcolor}
\usetikzlibrary{matrix,arrows}
\usetikzlibrary{backgrounds,fit,positioning,calc,shapes}
\usetikzlibrary{decorations.pathreplacing}
\usetikzlibrary{decorations.pathmorphing}
\usetikzlibrary{decorations.markings}

% `tikz-cd` is necessary to draw commutative diagrams.
\RequirePackage{tikz-cd}
% `amssymb` is necessary for `\lrcorner` and `\ulcorner`.
\RequirePackage{amssymb}
% `calc` is necessary to draw curved arrows.
\usetikzlibrary{calc}
% `pathmorphing` is necessary to draw squiggly arrows.
\usetikzlibrary{decorations.pathmorphing}
% `spath3` is necessary to draw shortened edges.
\usetikzlibrary{spath3}

% A TikZ style for curved arrows of a fixed height, due to AndréC.
\tikzset{curve/.style={settings={#1},to path={(\tikztostart)
    .. controls ($(\tikztostart)!\pv{pos}!(\tikztotarget)!\pv{height}!270:(\tikztotarget)$)
    and ($(\tikztostart)!1-\pv{pos}!(\tikztotarget)!\pv{height}!270:(\tikztotarget)$)
    .. (\tikztotarget)\tikztonodes}},
    settings/.code={\tikzset{quiver/.cd,#1}
        \def\pv##1{\pgfkeysvalueof{/tikz/quiver/##1}}},
    quiver/.cd,pos/.initial=0.35,height/.initial=0}

% A TikZ style for shortening paths without the poor behaviour of `shorten <' and `shorten >'.
\tikzset{between/.style n args={2}{/tikz/spath/at end path construction={
    \tikzset{spath/split at keep middle={current}{#1}{#2}}
}}}

% TikZ arrowhead/tail styles.
\tikzset{tail reversed/.code={\pgfsetarrowsstart{tikzcd to}}}
\tikzset{2tail/.code={\pgfsetarrowsstart{Implies[reversed]}}}
\tikzset{2tail reversed/.code={\pgfsetarrowsstart{Implies}}}
% TikZ arrow styles.
\tikzset{no body/.style={/tikz/dash pattern=on 0 off 1mm}}


\newcommand{\triplecolon}{%
  \mathrel{\vbox{\baselineskip=2pt \hbox{.}\hbox{.}\hbox{.}}}%
}

\DeclareUnicodeCharacter{2AF6}{\triplecolon}
\usepackage{mathpartir}

]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[
\begin {tikzcd}
	\mathsf {Tm} & \mathsf {Tm} \\
	{\mathsf {Tm} \times _\mathsf {Ty} \mathsf {Tm}} & \mathsf {Ty}
	\arrow ["{1_\mathsf {Tm}}", from=1-1, to=1-2]
	\arrow ["\Delta "', from=1-1, to=2-1]
	\arrow ["\lrcorner "{anchor=center, pos=0.125}, draw=none, from=1-1, to=2-2]
	\arrow ["\mathsf {u}", from=1-2, to=2-2]
	\arrow ["=\hspace {-0.2em} ="', from=2-1, to=2-2]
\end {tikzcd}
]]></fr:resource-source></fr:resource></html:figure>

<html:p>This says that for any pair of terms of the same type, there is a type of equalities between them, and that type has a single element precisely in the case that the two terms are equal (that is, are in the image of the diagonal).</html:p><html:p>Note that just like in <fr:link href="/ocl-007Z/" title="Dependent records" uri="https://forest.topos.site/ocl-007Z/" display-uri="https://forest.topos.site/ocl-007Z" type="local">§ <fr:contextual-number uri="https://forest.topos.site/ocl-007Z/" display-uri="https://forest.topos.site/ocl-007Z" /></fr:link>, we can assume a cartesian morphism of polynomial functors that is equivalent to the above pullback square.</html:p></fr:mainmatter>
                </fr:tree>
                <fr:tree show-metadata="false">
                  <fr:frontmatter>
                    <fr:authors>
                      <fr:author>
                        <fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link>
                      </fr:author>
                    </fr:authors>
                    <fr:date>
                      <fr:year>2025</fr:year>
                      <fr:month>3</fr:month>
                      <fr:day>12</fr:day>
                    </fr:date>
                    <fr:uri>https://forest.topos.site/ocl-009W/</fr:uri>
                    <fr:display-uri>https://forest.topos.site/ocl-009W</fr:display-uri>
                    <fr:route>/ocl-009W/</fr:route>
                    <fr:title text="Finite limits and essentially algebraic theories">Finite limits and essentially algebraic theories</fr:title>
                  </fr:frontmatter>
                  <fr:mainmatter><html:p>If we combine the theories of <fr:link href="/ocl-007X/" title="Sigma types" uri="https://forest.topos.site/ocl-007X/" display-uri="https://forest.topos.site/ocl-007X" type="local">sigma types</fr:link> and <fr:link href="/ocl-0081/" title="Extensional equality types" uri="https://forest.topos.site/ocl-0081/" display-uri="https://forest.topos.site/ocl-0081" type="local">equality types</fr:link>, we can write down a type for any finite limit. For instance, the pullback of</html:p>



<html:figure><fr:resource hash="181f2cda23717c72db008e590b5ea9de"><fr:resource-content><html:img src="https://forest.topos.site/181f2cda23717c72db008e590b5ea9de.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[

\usepackage[utf8]{inputenc}
\DeclareFontFamily{U}{min}{}
\DeclareFontShape{U}{min}{m}{n}{<-> udmj30}{}
\newcommand\yo{\!\text{\usefont{U}{min}{m}{n}\symbol{'207}}\!}
\DeclareUnicodeCharacter{3088}{\yo}


\usepackage{tikz, tikz-cd, mathtools, amssymb, stmaryrd,xcolor}
\usetikzlibrary{matrix,arrows}
\usetikzlibrary{backgrounds,fit,positioning,calc,shapes}
\usetikzlibrary{decorations.pathreplacing}
\usetikzlibrary{decorations.pathmorphing}
\usetikzlibrary{decorations.markings}

% `tikz-cd` is necessary to draw commutative diagrams.
\RequirePackage{tikz-cd}
% `amssymb` is necessary for `\lrcorner` and `\ulcorner`.
\RequirePackage{amssymb}
% `calc` is necessary to draw curved arrows.
\usetikzlibrary{calc}
% `pathmorphing` is necessary to draw squiggly arrows.
\usetikzlibrary{decorations.pathmorphing}
% `spath3` is necessary to draw shortened edges.
\usetikzlibrary{spath3}

% A TikZ style for curved arrows of a fixed height, due to AndréC.
\tikzset{curve/.style={settings={#1},to path={(\tikztostart)
    .. controls ($(\tikztostart)!\pv{pos}!(\tikztotarget)!\pv{height}!270:(\tikztotarget)$)
    and ($(\tikztostart)!1-\pv{pos}!(\tikztotarget)!\pv{height}!270:(\tikztotarget)$)
    .. (\tikztotarget)\tikztonodes}},
    settings/.code={\tikzset{quiver/.cd,#1}
        \def\pv##1{\pgfkeysvalueof{/tikz/quiver/##1}}},
    quiver/.cd,pos/.initial=0.35,height/.initial=0}

% A TikZ style for shortening paths without the poor behaviour of `shorten <' and `shorten >'.
\tikzset{between/.style n args={2}{/tikz/spath/at end path construction={
    \tikzset{spath/split at keep middle={current}{#1}{#2}}
}}}

% TikZ arrowhead/tail styles.
\tikzset{tail reversed/.code={\pgfsetarrowsstart{tikzcd to}}}
\tikzset{2tail/.code={\pgfsetarrowsstart{Implies[reversed]}}}
\tikzset{2tail reversed/.code={\pgfsetarrowsstart{Implies}}}
% TikZ arrow styles.
\tikzset{no body/.style={/tikz/dash pattern=on 0 off 1mm}}


\newcommand{\triplecolon}{%
  \mathrel{\vbox{\baselineskip=2pt \hbox{.}\hbox{.}\hbox{.}}}%
}

\DeclareUnicodeCharacter{2AF6}{\triplecolon}
\usepackage{mathpartir}

]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[
\begin {tikzcd}
	& B \\
	A & C
	\arrow ["g", from=1-2, to=2-2]
	\arrow ["f"', from=2-1, to=2-2]
\end {tikzcd}
]]></fr:resource-source></fr:resource></html:figure>

<html:p>may be written as <fr:tex display="inline"><![CDATA[(x \colon  A) \times  (y \colon  B) \times  (f(x) =\hspace {-0.2em} =_C g(y))]]></fr:tex>.</html:p><html:p>More generally, if we only have equality types, then we may write down a <html:em>context</html:em> for any finite limit (we can only internalize contexts to types if we have sigma types).</html:p><html:p>Essentially algebraic theories are 1-theories in the 2-theory of equality types where all of the postulated primitive types are given in the empty context. For instance, we could have an essentially algebraic theory for categories with:</html:p><html:ul><html:li><fr:tex display="inline"><![CDATA[\,\vdash \, \mathrm {Ob} \,\,\mathsf {type}]]></fr:tex></html:li>
  <html:li><fr:tex display="inline"><![CDATA[\,\vdash \, \mathrm {Hom} \,\,\mathsf {type}]]></fr:tex></html:li>
  <html:li><fr:tex display="inline"><![CDATA[f \colon  \mathrm {Hom} \,\vdash \, \partial _0(f) \colon  \mathrm {Ob}]]></fr:tex></html:li>
  <html:li><fr:tex display="inline"><![CDATA[f \colon  \mathrm {Hom} \,\vdash \, \partial _1(f) \colon  \mathrm {Ob}]]></fr:tex></html:li>
  <html:li><fr:tex display="inline"><![CDATA[f \colon  \mathrm {Hom}, g \colon  \mathrm {Hom}, e \colon  \partial _0(g) =\hspace {-0.2em} =_\mathrm {Ob} \partial _1(f) \,\vdash \, \mathrm {compose}(f,g,e) \colon  \mathrm {Hom}]]></fr:tex></html:li>
  <html:li><fr:tex display="inline"><![CDATA[\ldots ]]></fr:tex></html:li></html:ul><html:p>Thus, general 1-theories in the 2-theory of equality types are a common generalization of generalized algebraic theories and essentially algebraic theories. Adding sigma types is a matter of convenience (it does not change the power of the theory), but as they are not terribly hard to implement or use, it seems natural to also have them.</html:p><html:p>Thus, we call equality types + sigma types the 2-theory of finite limits. Later, we will build a type theory for talking about 1-theories in this particular 2-theory.</html:p></fr:mainmatter>
                </fr:tree>
              </fr:mainmatter>
            </fr:tree>
            <fr:tree show-metadata="false">
              <fr:frontmatter>
                <fr:authors>
                  <fr:author>
                    <fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link>
                  </fr:author>
                </fr:authors>
                <fr:date>
                  <fr:year>2025</fr:year>
                  <fr:month>3</fr:month>
                  <fr:day>17</fr:day>
                </fr:date>
                <fr:uri>https://forest.topos.site/ocl-00BH/</fr:uri>
                <fr:display-uri>https://forest.topos.site/ocl-00BH</fr:display-uri>
                <fr:route>/ocl-00BH/</fr:route>
                <fr:title text="Non-strict semantics via display map structures">Non-strict semantics via display map structures</fr:title>
              </fr:frontmatter>
              <fr:mainmatter>
                <html:p>Natural models are very convenient, because they faithfully interpret the strictness of substitutions. However, when discussing semantics, it is sometimes desirable to consider less-strict models, so that we can define certain operations via universal properties without needing to choose representatives for pullbacks, etc.</html:p>
                <html:p>One mathematical structure which can serve this purpose is that of a <html:em>clan</html:em>.</html:p>
                <fr:tree show-metadata="false">
                  <fr:frontmatter>
                    <fr:authors>
                      <fr:author>
                        <fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link>
                      </fr:author>
                    </fr:authors>
                    <fr:date>
                      <fr:year>2025</fr:year>
                      <fr:month>3</fr:month>
                      <fr:day>17</fr:day>
                    </fr:date>
                    <fr:uri>https://forest.topos.site/ocl-00BI/</fr:uri>
                    <fr:display-uri>https://forest.topos.site/ocl-00BI</fr:display-uri>
                    <fr:route>/ocl-00BI/</fr:route>
                    <fr:title text="Clan">Clan</fr:title>
                    <fr:taxon>definition</fr:taxon>
                  </fr:frontmatter>
                  <fr:mainmatter>
                    <html:p>A <html:strong>clan</html:strong> is a category equipped with a terminal object and a subclass of morphisms called <html:strong>display maps</html:strong> or <html:strong>fibrations</html:strong>, such that</html:p>
                    <html:ol><html:li>Every isomorphism is a display map</html:li>
  <html:li>For every object, the unique map to the terminal object is a display map</html:li>
  <html:li>Display maps are closed under pullback against arbitrary other morphisms</html:li>
  <html:li>Display maps are closed under composition</html:li></html:ol>
                    <html:p>The name <html:em>clan</html:em> is due to <fr:link href="/joyal-2017-notes/" title="Notes on Clans and Tribes" uri="https://forest.topos.site/joyal-2017-notes/" display-uri="https://forest.topos.site/joyal-2017-notes" type="local">Reference <fr:contextual-number uri="https://forest.topos.site/joyal-2017-notes/" display-uri="https://forest.topos.site/joyal-2017-notes" /></fr:link>, but the concept goes back to <fr:link href="/taylor-1986-recursive/" title="Recursive Domains, Indexed Category Theory and Polymorphism" uri="https://forest.topos.site/taylor-1986-recursive/" display-uri="https://forest.topos.site/taylor-1986-recursive" type="local">Reference <fr:contextual-number uri="https://forest.topos.site/taylor-1986-recursive/" display-uri="https://forest.topos.site/taylor-1986-recursive" /></fr:link>, where clans were called “categories with display maps”.</html:p>
                  </fr:mainmatter>
                </fr:tree>
                <html:p>For our purposes, we want a much more lightweight notion, which is just a category equipped with a class of maps stable under pullback. We call this a <html:strong>display category</html:strong>.</html:p>
                <html:p>Given a natural model, one may construct a display category structure on <fr:tex display="inline"><![CDATA[\mathsf {Ctx}]]></fr:tex> where the display maps are those that are isomorphic to <fr:tex display="inline"><![CDATA[\Gamma , x \colon  A \to  \Gamma ]]></fr:tex> for some <fr:tex display="inline"><![CDATA[A \in  \mathsf {Ty}(\Gamma )]]></fr:tex>. If the natural model has sigma types, then display maps are closed under composition, and if the natural model is additionally democratic with a terminal object, then terminal projections are display maps, and <fr:tex display="inline"><![CDATA[\mathsf {Ctx}]]></fr:tex> gains a clan structure.</html:p>
                <html:p>We can then reformulate 2-theories in terms of postulating that certain maps defined by universal properties exist and are display maps. For instance, equality types are interpreted by asking that <fr:tex display="inline"><![CDATA[\Delta  \colon  \Gamma , x \colon  A \to  \Gamma , x \colon  A, y \colon  A]]></fr:tex> be a display map. The intuition is that this should be isomorphic to <fr:tex display="inline"><![CDATA[\Gamma , x \colon  A, y \colon  A, e \colon  x =\hspace {-0.2em} =_A y \to  \Gamma , x \colon  A, y \colon  A]]></fr:tex>.</html:p>
              </fr:mainmatter>
            </fr:tree>
          </fr:mainmatter>
        </fr:tree>
        <fr:tree show-metadata="false">
          <fr:frontmatter>
            <fr:authors>
              <fr:contributor>
                <fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link>
              </fr:contributor>
            </fr:authors>
            <fr:date>
              <fr:year>2025</fr:year>
              <fr:month>2</fr:month>
              <fr:day>28</fr:day>
            </fr:date>
            <fr:uri>https://forest.topos.site/ocl-0073/</fr:uri>
            <fr:display-uri>https://forest.topos.site/ocl-0073</fr:display-uri>
            <fr:route>/ocl-0073/</fr:route>
            <fr:title text="The 3-theory of two-level dependent type theories (\mathbb {D}^{2})">The 3-theory of two-level dependent type theories (<fr:tex display="inline"><![CDATA[\mathbb {D}^{2}]]></fr:tex>)</fr:title>
          </fr:frontmatter>
          <fr:mainmatter>
            <html:p>Type theories that are explicitly called “two-level” have been studied for about a decade now, and used for a variety of purposes, from their original application to formulating “crisp” equality in homotopy type theory, found in <fr:link href="/annenkov-2023-twolevel/" title="Two-level type theory and applications" uri="https://forest.topos.site/annenkov-2023-twolevel/" display-uri="https://forest.topos.site/annenkov-2023-twolevel" type="local">Reference <fr:contextual-number uri="https://forest.topos.site/annenkov-2023-twolevel/" display-uri="https://forest.topos.site/annenkov-2023-twolevel" /></fr:link>, to recent applications in staged metaprogramming in <fr:link href="/kovács-2022-staged/" title="Staged compilation with two-level type theory" uri="https://forest.topos.site/kovács-2022-staged/" display-uri="https://forest.topos.site/kovács-2022-staged" type="local">Reference <fr:contextual-number uri="https://forest.topos.site/kovács-2022-staged/" display-uri="https://forest.topos.site/kovács-2022-staged" /></fr:link> and <fr:link href="/kovács-2024-closurefree/" title="Closure-Free Functional Programming in a Two-Level Type Theory" uri="https://forest.topos.site/kovács-2024-closurefree/" display-uri="https://forest.topos.site/kovács-2024-closurefree" type="local">Reference <fr:contextual-number uri="https://forest.topos.site/kovács-2024-closurefree/" display-uri="https://forest.topos.site/kovács-2024-closurefree" /></fr:link>.</html:p>
            <fr:tree show-metadata="false">
              <fr:frontmatter>
                <fr:authors>
                  <fr:author>
                    <fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link>
                  </fr:author>
                </fr:authors>
                <fr:date>
                  <fr:year>2025</fr:year>
                  <fr:month>3</fr:month>
                  <fr:day>12</fr:day>
                </fr:date>
                <fr:uri>https://forest.topos.site/ocl-00A2/</fr:uri>
                <fr:display-uri>https://forest.topos.site/ocl-00A2</fr:display-uri>
                <fr:route>/ocl-00A2/</fr:route>
                <fr:title text="2LTT is \mathbb {N} + \mathbb {N}-level type theory">2LTT is <fr:tex display="inline"><![CDATA[\mathbb {N} + \mathbb {N}]]></fr:tex>-level type theory</fr:title>
                <fr:taxon>remark</fr:taxon>
              </fr:frontmatter>
              <fr:mainmatter>
                <html:p>If one carefully reads <fr:link href="/annenkov-2023-twolevel/" title="Two-level type theory and applications" uri="https://forest.topos.site/annenkov-2023-twolevel/" display-uri="https://forest.topos.site/annenkov-2023-twolevel" type="local">Reference <fr:contextual-number uri="https://forest.topos.site/annenkov-2023-twolevel/" display-uri="https://forest.topos.site/annenkov-2023-twolevel" /></fr:link>, one will see that in fact there are <fr:tex display="inline"><![CDATA[\mathbb {N} + \mathbb {N}]]></fr:tex> levels, as universes in Martin-Löf type theory require levels in order for the type theory to be consistent. However, the first <fr:tex display="inline"><![CDATA[\mathbb {N}]]></fr:tex> levels look the same as one another, and the second <fr:tex display="inline"><![CDATA[\mathbb {N}]]></fr:tex> levels also all look the same as one another, so there are only two “meaningful” levels.</html:p>
              </fr:mainmatter>
            </fr:tree>
            <html:p>However, the basic idea of two-level type theory is significantly older than a decade. Specifically, one can see classical type theories such as parametric simply typed lambda calculus and the type theory for first-order logic presented in <fr:link href="/shulman-2016-catlog/" title="Categorical logic from a categorical point of view" uri="https://forest.topos.site/shulman-2016-catlog/" display-uri="https://forest.topos.site/shulman-2016-catlog" type="local">Reference <fr:contextual-number uri="https://forest.topos.site/shulman-2016-catlog/" display-uri="https://forest.topos.site/shulman-2016-catlog" /></fr:link> as two-level type theories. In parametric simply typed lambda calculus, the two levels are type variables and term variables, and in first-order logic the two levels are term variables and proposition variables (though, typically in first-order logic we leave the proposition variables implicit because propositions are proof-irrelevant).</html:p>
            <fr:tree show-metadata="false">
              <fr:frontmatter>
                <fr:authors>
                  <fr:author>
                    <fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link>
                  </fr:author>
                </fr:authors>
                <fr:date>
                  <fr:year>2025</fr:year>
                  <fr:month>3</fr:month>
                  <fr:day>12</fr:day>
                </fr:date>
                <fr:uri>https://forest.topos.site/ocl-009X/</fr:uri>
                <fr:display-uri>https://forest.topos.site/ocl-009X</fr:display-uri>
                <fr:route>/ocl-009X/</fr:route>
                <fr:title text="Second-order logic as three-level type theory">Second-order logic as three-level type theory</fr:title>
                <fr:taxon>remark</fr:taxon>
              </fr:frontmatter>
              <fr:mainmatter>
                <html:p>One is tempted to try to formulate second-order logic (type variables, term variables, and proposition variables) as a three-level type theory. We will not pursue this in the current paper.</html:p>
              </fr:mainmatter>
            </fr:tree>
            <html:p>The basic idea of a two-level type theory is to have “inner” and “outer” types. Considering the inner types and the outer types separately, they may or may not be dependent type theories, but inner types are typically allowed to depend on outer types.</html:p>
            <html:p>In this section, we will only consider two-level type theories where both inner and outer types are dependent; we might call these dependent-dependent two-level type theories. This follows the definition of two-level type theory in <fr:link href="/uemura-2023-general/" title="A general framework for the semantics of type theory" uri="https://forest.topos.site/uemura-2023-general/" display-uri="https://forest.topos.site/uemura-2023-general" type="local">Reference <fr:contextual-number uri="https://forest.topos.site/uemura-2023-general/" display-uri="https://forest.topos.site/uemura-2023-general" /></fr:link>. We will leave to future work the definition of 3-theories for dependent-simple (as in <fr:link href="/kovács-2022-staged/" title="Staged compilation with two-level type theory" uri="https://forest.topos.site/kovács-2022-staged/" display-uri="https://forest.topos.site/kovács-2022-staged" type="local">Reference <fr:contextual-number uri="https://forest.topos.site/kovács-2022-staged/" display-uri="https://forest.topos.site/kovács-2022-staged" /></fr:link>) and simple-simple (as in first order logic) two-level type theories.</html:p>
            <fr:tree show-metadata="false">
              <fr:frontmatter>
                <fr:authors>
                  <fr:contributor>
                    <fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link>
                  </fr:contributor>
                </fr:authors>
                <fr:date>
                  <fr:year>2025</fr:year>
                  <fr:month>2</fr:month>
                  <fr:day>28</fr:day>
                </fr:date>
                <fr:uri>https://forest.topos.site/ocl-0082/</fr:uri>
                <fr:display-uri>https://forest.topos.site/ocl-0082</fr:display-uri>
                <fr:route>/ocl-0082/</fr:route>
                <fr:title text="Judgment structure of \mathbb {D}^{2}">Judgment structure of <fr:tex display="inline"><![CDATA[\mathbb {D}^{2}]]></fr:tex></fr:title>
              </fr:frontmatter>
              <fr:mainmatter>
                <html:p>In this section, we review the judgment structure for the 3-theory of (dependent) two-level type theory. As mentioned before, this can be seen as a specific case of the general theory of dependent type theory worked out in <fr:link href="/uemura-2023-general/" title="A general framework for the semantics of type theory" uri="https://forest.topos.site/uemura-2023-general/" display-uri="https://forest.topos.site/uemura-2023-general" type="local">Reference <fr:contextual-number uri="https://forest.topos.site/uemura-2023-general/" display-uri="https://forest.topos.site/uemura-2023-general" /></fr:link>.</html:p>
                <fr:tree show-metadata="false">
                  <fr:frontmatter>
                    <fr:authors>
                      <fr:author>
                        <fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link>
                      </fr:author>
                    </fr:authors>
                    <fr:date>
                      <fr:year>2025</fr:year>
                      <fr:month>3</fr:month>
                      <fr:day>12</fr:day>
                    </fr:date>
                    <fr:uri>https://forest.topos.site/ocl-00A0/</fr:uri>
                    <fr:display-uri>https://forest.topos.site/ocl-00A0</fr:display-uri>
                    <fr:route>/ocl-00A0/</fr:route>
                    <fr:title text="Example judgments for \mathbb {D}^{2}">Example judgments for <fr:tex display="inline"><![CDATA[\mathbb {D}^{2}]]></fr:tex></fr:title>
                    <fr:taxon>table</fr:taxon>
                  </fr:frontmatter>
                  <fr:mainmatter>
                    <html:table>
                      <html:thead>
<html:tr><html:th>Judgment</html:th><html:th>Pronunciation</html:th></html:tr>
</html:thead>
                      <html:tbody>
<html:tr><html:td><fr:tex display="inline"><![CDATA[\Gamma  \,\,\mathsf {ctx}]]></fr:tex></html:td><html:td><fr:tex display="inline"><![CDATA[\Gamma ]]></fr:tex> is a context</html:td></html:tr>
<html:tr><html:td><fr:tex display="inline"><![CDATA[\Gamma  \,\vdash \, T \,\,\mathsf {type}^{\circ }]]></fr:tex></html:td><html:td>In context <fr:tex display="inline"><![CDATA[\Gamma ]]></fr:tex>, <fr:tex display="inline"><![CDATA[T]]></fr:tex> is an outer type</html:td></html:tr>
<html:tr><html:td><fr:tex display="inline"><![CDATA[\Gamma  \,\vdash \, T = T' \,\,\mathsf {type}^{\circ }]]></fr:tex></html:td><html:td>In context <fr:tex display="inline"><![CDATA[\Gamma ]]></fr:tex>, <fr:tex display="inline"><![CDATA[T]]></fr:tex> and <fr:tex display="inline"><![CDATA[T']]></fr:tex> are judgmentally equal outer types</html:td></html:tr>
<html:tr><html:td><fr:tex display="inline"><![CDATA[\Gamma  \,\vdash \, t \mathpunct {\,{\raisebox {-0.03em}{${\scriptscriptstyle  \circ }$}} \mathllap {\raisebox {0.28em}{${\scriptscriptstyle  \circ }$}}\,} T]]></fr:tex></html:td><html:td>In context <fr:tex display="inline"><![CDATA[\Gamma ]]></fr:tex>, <fr:tex display="inline"><![CDATA[t]]></fr:tex> is an term of outer type <fr:tex display="inline"><![CDATA[T]]></fr:tex></html:td></html:tr>
<html:tr><html:td><fr:tex display="inline"><![CDATA[\Gamma  \,\vdash \, t = t' \mathpunct {\,{\raisebox {-0.03em}{${\scriptscriptstyle  \circ }$}} \mathllap {\raisebox {0.28em}{${\scriptscriptstyle  \circ }$}}\,} T]]></fr:tex></html:td><html:td>In context <fr:tex display="inline"><![CDATA[\Gamma ]]></fr:tex>, <fr:tex display="inline"><![CDATA[t]]></fr:tex> are judgmentally equal terms of outer type <fr:tex display="inline"><![CDATA[T]]></fr:tex></html:td></html:tr>
<html:tr><html:td><fr:tex display="inline"><![CDATA[\Gamma  \,\vdash \, T \,\,\mathsf {type}^{\bullet }]]></fr:tex></html:td><html:td>In context <fr:tex display="inline"><![CDATA[\Gamma ]]></fr:tex>, <fr:tex display="inline"><![CDATA[T]]></fr:tex> is an inner type</html:td></html:tr>
<html:tr><html:td><fr:tex display="inline"><![CDATA[\Gamma  \,\vdash \, T = T' \,\,\mathsf {type}^{\bullet }]]></fr:tex></html:td><html:td>In context <fr:tex display="inline"><![CDATA[\Gamma ]]></fr:tex>, <fr:tex display="inline"><![CDATA[T]]></fr:tex> and <fr:tex display="inline"><![CDATA[T']]></fr:tex> are judgmentally equal inner types</html:td></html:tr>
<html:tr><html:td><fr:tex display="inline"><![CDATA[\Gamma  \,\vdash \, t \mathpunct {\,{\raisebox {-0.03em}{${\scriptscriptstyle  \bullet }$}} \mathllap {\raisebox {0.28em}{${\scriptscriptstyle  \bullet }$}}\,} T]]></fr:tex></html:td><html:td>In context <fr:tex display="inline"><![CDATA[\Gamma ]]></fr:tex>, <fr:tex display="inline"><![CDATA[t]]></fr:tex> is an term of inner type <fr:tex display="inline"><![CDATA[T]]></fr:tex></html:td></html:tr>
<html:tr><html:td><fr:tex display="inline"><![CDATA[\Gamma  \,\vdash \, t = t' \mathpunct {\,{\raisebox {-0.03em}{${\scriptscriptstyle  \bullet }$}} \mathllap {\raisebox {0.28em}{${\scriptscriptstyle  \bullet }$}}\,} T]]></fr:tex></html:td><html:td>In context <fr:tex display="inline"><![CDATA[\Gamma ]]></fr:tex>, <fr:tex display="inline"><![CDATA[t]]></fr:tex> are judgmentally equal terms of inner type <fr:tex display="inline"><![CDATA[T]]></fr:tex></html:td></html:tr>
</html:tbody>
                    </html:table>
                  </fr:mainmatter>
                </fr:tree>
                <html:p>We can then extend the context by both inner and outer types, so we have:</html:p>
                <fr:tree show-metadata="false">
                  <fr:frontmatter>
                    <fr:authors>
                      <fr:author>
                        <fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link>
                      </fr:author>
                    </fr:authors>
                    <fr:date>
                      <fr:year>2025</fr:year>
                      <fr:month>3</fr:month>
                      <fr:day>12</fr:day>
                    </fr:date>
                    <fr:uri>https://forest.topos.site/ocl-009Y/</fr:uri>
                    <fr:display-uri>https://forest.topos.site/ocl-009Y</fr:display-uri>
                    <fr:route>/ocl-009Y/</fr:route>
                    <fr:title text="Outer context extension and variable rule">Outer context extension and variable rule</fr:title>
                    <fr:taxon>rule</fr:taxon>
                  </fr:frontmatter>
                  <fr:mainmatter>
<fr:resource hash="dda8ca216b37809486245993ea4eefa8"><fr:resource-content><html:img src="https://forest.topos.site/dda8ca216b37809486245993ea4eefa8.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[\usepackage {mathpartir, amssymb, amsmath, mathtools}]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[
\begin {mathpar}
\inferrule {\Gamma  \,\vdash \, A \,\,\mathsf {type}^{\circ }}{\Gamma , x \mathpunct {\,{\raisebox {-0.03em}{${\scriptscriptstyle  \circ }$}} \mathllap {\raisebox {0.28em}{${\scriptscriptstyle  \circ }$}}\,} A \,\,\mathsf {ctx}} \and 
\inferrule {\Gamma  \,\vdash \, A \,\,\mathsf {type}^{\circ }}{\Gamma , x \mathpunct {\,{\raisebox {-0.03em}{${\scriptscriptstyle  \circ }$}} \mathllap {\raisebox {0.28em}{${\scriptscriptstyle  \circ }$}}\,} A \,\vdash \, x \mathpunct {\,{\raisebox {-0.03em}{${\scriptscriptstyle  \circ }$}} \mathllap {\raisebox {0.28em}{${\scriptscriptstyle  \circ }$}}\,} A}

\end {mathpar}
]]></fr:resource-source></fr:resource>
</fr:mainmatter>
                </fr:tree>
                <fr:tree show-metadata="false">
                  <fr:frontmatter>
                    <fr:authors>
                      <fr:author>
                        <fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link>
                      </fr:author>
                    </fr:authors>
                    <fr:date>
                      <fr:year>2025</fr:year>
                      <fr:month>3</fr:month>
                      <fr:day>12</fr:day>
                    </fr:date>
                    <fr:uri>https://forest.topos.site/ocl-009Z/</fr:uri>
                    <fr:display-uri>https://forest.topos.site/ocl-009Z</fr:display-uri>
                    <fr:route>/ocl-009Z/</fr:route>
                    <fr:title text="Inner context extension and variable rule">Inner context extension and variable rule</fr:title>
                    <fr:taxon>rule</fr:taxon>
                  </fr:frontmatter>
                  <fr:mainmatter>
<fr:resource hash="6b8922753103d6cb71bad83d086d7c52"><fr:resource-content><html:img src="https://forest.topos.site/6b8922753103d6cb71bad83d086d7c52.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[\usepackage {mathpartir, amssymb, amsmath, mathtools}]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[
\begin {mathpar}
\inferrule {\Gamma  \,\vdash \, A \,\,\mathsf {type}^{\bullet }}{\Gamma , x \mathpunct {\,{\raisebox {-0.03em}{${\scriptscriptstyle  \bullet }$}} \mathllap {\raisebox {0.28em}{${\scriptscriptstyle  \bullet }$}}\,} A \,\,\mathsf {ctx}} \and 
\inferrule {\Gamma  \,\vdash \, A \,\,\mathsf {type}^{\bullet }}{\Gamma , x \mathpunct {\,{\raisebox {-0.03em}{${\scriptscriptstyle  \bullet }$}} \mathllap {\raisebox {0.28em}{${\scriptscriptstyle  \bullet }$}}\,} A \,\vdash \, x \mathpunct {\,{\raisebox {-0.03em}{${\scriptscriptstyle  \bullet }$}} \mathllap {\raisebox {0.28em}{${\scriptscriptstyle  \bullet }$}}\,} A}

\end {mathpar}
]]></fr:resource-source></fr:resource>
</fr:mainmatter>
                </fr:tree>
                <html:p>We also have weakening for both types of context extension.</html:p>
                <html:p>Note that as of yet, there are no rules which explicitly make inner types and outer types interact, or break the symmetry between inner and outer types. However, because there is only one type of context, inner types may depend on outer types and vice versa.</html:p>
              </fr:mainmatter>
            </fr:tree>
            <fr:tree show-metadata="false">
              <fr:frontmatter>
                <fr:authors />
                <fr:date>
                  <fr:year>2025</fr:year>
                  <fr:month>2</fr:month>
                  <fr:day>28</fr:day>
                </fr:date>
                <fr:uri>https://forest.topos.site/ocl-0083/</fr:uri>
                <fr:display-uri>https://forest.topos.site/ocl-0083</fr:display-uri>
                <fr:route>/ocl-0083/</fr:route>
                <fr:title text="Categorical semantics for \mathbb {D}^{2}">Categorical semantics for <fr:tex display="inline"><![CDATA[\mathbb {D}^{2}]]></fr:tex></fr:title>
              </fr:frontmatter>
              <fr:mainmatter>
                <html:p>The categorical semantics for <fr:tex display="inline"><![CDATA[\mathbb {D}^{2}]]></fr:tex> are a very simple extension of <fr:tex display="inline"><![CDATA[\mathbb {D}]]></fr:tex>. Specifically, a model for <fr:tex display="inline"><![CDATA[\mathbb {D}^{2}]]></fr:tex> just consists of a category <fr:tex display="inline"><![CDATA[\mathsf {Ctx}]]></fr:tex> along with <html:em>two</html:em> representable natural transformations of presheaves on <fr:tex display="inline"><![CDATA[\mathsf {Ctx}]]></fr:tex>, <fr:tex display="inline"><![CDATA[{\mathsf {u}^{\scriptscriptstyle  \circ }} \colon  {\mathsf {Tm}^{\scriptscriptstyle  \circ }} \to  {\mathsf {Ty}^{\scriptscriptstyle  \circ }}]]></fr:tex> and <fr:tex display="inline"><![CDATA[{\mathsf {u}^{\scriptscriptstyle  \bullet }} \colon  {\mathsf {Tm}^{\scriptscriptstyle  \bullet }} \to  {\mathsf {Ty}^{\scriptscriptstyle  \bullet }}]]></fr:tex>.</html:p>
                <html:p>The judgment structure of <fr:link href="/ocl-0082/" title="Judgment structure of \mathbb {D}^{2}" uri="https://forest.topos.site/ocl-0082/" display-uri="https://forest.topos.site/ocl-0082" type="local">§ <fr:contextual-number uri="https://forest.topos.site/ocl-0082/" display-uri="https://forest.topos.site/ocl-0082" /></fr:link> then translates to statements about this pair of natural transformations in precisely the same way that dependent type theory translates to statements about a single natural transformation.</html:p>
              </fr:mainmatter>
            </fr:tree>
            <fr:tree show-metadata="false">
              <fr:frontmatter>
                <fr:authors>
                  <fr:contributor>
                    <fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link>
                  </fr:contributor>
                </fr:authors>
                <fr:date>
                  <fr:year>2025</fr:year>
                  <fr:month>2</fr:month>
                  <fr:day>28</fr:day>
                </fr:date>
                <fr:uri>https://forest.topos.site/ocl-0084/</fr:uri>
                <fr:display-uri>https://forest.topos.site/ocl-0084</fr:display-uri>
                <fr:route>/ocl-0084/</fr:route>
                <fr:title text="2-theories in \mathbb {D}^{2} and their semantics">2-theories in <fr:tex display="inline"><![CDATA[\mathbb {D}^{2}]]></fr:tex> and their semantics</fr:title>
              </fr:frontmatter>
              <fr:mainmatter>
                <fr:tree show-metadata="false">
                  <fr:frontmatter>
                    <fr:authors>
                      <fr:contributor>
                        <fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link>
                      </fr:contributor>
                    </fr:authors>
                    <fr:date>
                      <fr:year>2025</fr:year>
                      <fr:month>2</fr:month>
                      <fr:day>28</fr:day>
                    </fr:date>
                    <fr:uri>https://forest.topos.site/ocl-0085/</fr:uri>
                    <fr:display-uri>https://forest.topos.site/ocl-0085</fr:display-uri>
                    <fr:route>/ocl-0085/</fr:route>
                    <fr:title text="Single-level 2-theories">Single-level 2-theories</fr:title>
                  </fr:frontmatter>
                  <fr:mainmatter>
                    <html:p>All of the 2-theories from <fr:link href="/ocl-007W/" title="2-theories in \mathbb {D} and their semantics" uri="https://forest.topos.site/ocl-007W/" display-uri="https://forest.topos.site/ocl-007W" type="local">§ <fr:contextual-number uri="https://forest.topos.site/ocl-007W/" display-uri="https://forest.topos.site/ocl-007W" /></fr:link> may be imported at either the “inner” or “outer” level. So we may speak of having outer sigma types, inner sigma types, outer pi type, or inner pi types. These are 2-theories that purely involve either outer or inner types. An example for one of these 2-theories is in <fr:link href="/ocl-00A3/" title="Outer pi types" uri="https://forest.topos.site/ocl-00A3/" display-uri="https://forest.topos.site/ocl-00A3" type="local">example <fr:contextual-number uri="https://forest.topos.site/ocl-00A3/" display-uri="https://forest.topos.site/ocl-00A3" /></fr:link>.</html:p>
                    <fr:tree show-metadata="false">
                      <fr:frontmatter>
                        <fr:authors>
                          <fr:author>
                            <fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link>
                          </fr:author>
                        </fr:authors>
                        <fr:date>
                          <fr:year>2025</fr:year>
                          <fr:month>3</fr:month>
                          <fr:day>12</fr:day>
                        </fr:date>
                        <fr:uri>https://forest.topos.site/ocl-00A3/</fr:uri>
                        <fr:display-uri>https://forest.topos.site/ocl-00A3</fr:display-uri>
                        <fr:route>/ocl-00A3/</fr:route>
                        <fr:title text="Outer pi types">Outer pi types</fr:title>
                        <fr:taxon>example</fr:taxon>
                      </fr:frontmatter>
                      <fr:mainmatter>
                        <fr:tree show-metadata="false">
                          <fr:frontmatter>
                            <fr:authors>
                              <fr:author>
                                <fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link>
                              </fr:author>
                            </fr:authors>
                            <fr:date>
                              <fr:year>2025</fr:year>
                              <fr:month>3</fr:month>
                              <fr:day>12</fr:day>
                            </fr:date>
                            <fr:uri>https://forest.topos.site/ocl-00A4/</fr:uri>
                            <fr:display-uri>https://forest.topos.site/ocl-00A4</fr:display-uri>
                            <fr:route>/ocl-00A4/</fr:route>
                            <fr:title text="Formation for outer pi types">Formation for outer pi types</fr:title>
                            <fr:taxon>rule</fr:taxon>
                          </fr:frontmatter>
                          <fr:mainmatter>
<fr:resource hash="61abc83267f678ee5387ebfa6680d2fe"><fr:resource-content><html:img src="https://forest.topos.site/61abc83267f678ee5387ebfa6680d2fe.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[\usepackage {mathpartir, amssymb, amsmath, mathtools}]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[
\begin {mathpar}

\inferrule {\Gamma  \,\vdash \, A \,\,\mathsf {type}^{\circ } \and  \Gamma , x \mathpunct {\,{\raisebox {-0.03em}{${\scriptscriptstyle  \circ }$}} \mathllap {\raisebox {0.28em}{${\scriptscriptstyle  \circ }$}}\,} A \,\vdash \, B \,\,\mathsf {type}^{\circ }}{\Gamma  \,\vdash \, (x \mathpunct {\,{\raisebox {-0.03em}{${\scriptscriptstyle  \circ }$}} \mathllap {\raisebox {0.28em}{${\scriptscriptstyle  \circ }$}}\,} A) \to  B \,\,\mathsf {type}^{\circ }}

\end {mathpar}
]]></fr:resource-source></fr:resource>
</fr:mainmatter>
                        </fr:tree>
                        <fr:tree show-metadata="false">
                          <fr:frontmatter>
                            <fr:authors>
                              <fr:author>
                                <fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link>
                              </fr:author>
                            </fr:authors>
                            <fr:date>
                              <fr:year>2025</fr:year>
                              <fr:month>3</fr:month>
                              <fr:day>12</fr:day>
                            </fr:date>
                            <fr:uri>https://forest.topos.site/ocl-00A5/</fr:uri>
                            <fr:display-uri>https://forest.topos.site/ocl-00A5</fr:display-uri>
                            <fr:route>/ocl-00A5/</fr:route>
                            <fr:title text="Introduction and elimination for outer pi types">Introduction and elimination for outer pi types</fr:title>
                            <fr:taxon>rule</fr:taxon>
                          </fr:frontmatter>
                          <fr:mainmatter>
<fr:resource hash="22721fba9fc477cde9ad9be51eeec09c"><fr:resource-content><html:img src="https://forest.topos.site/22721fba9fc477cde9ad9be51eeec09c.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[\usepackage {mathpartir, amssymb, amsmath, mathtools}]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[
\begin {mathpar}

\inferrule {\Gamma , x \mathpunct {\,{\raisebox {-0.03em}{${\scriptscriptstyle  \circ }$}} \mathllap {\raisebox {0.28em}{${\scriptscriptstyle  \circ }$}}\,} A \,\vdash \, b \mathpunct {\,{\raisebox {-0.03em}{${\scriptscriptstyle  \circ }$}} \mathllap {\raisebox {0.28em}{${\scriptscriptstyle  \circ }$}}\,} B}{\Gamma  \,\vdash \, (x \mapsto  B) \mathpunct {\,{\raisebox {-0.03em}{${\scriptscriptstyle  \circ }$}} \mathllap {\raisebox {0.28em}{${\scriptscriptstyle  \circ }$}}\,} (x \mathpunct {\,{\raisebox {-0.03em}{${\scriptscriptstyle  \circ }$}} \mathllap {\raisebox {0.28em}{${\scriptscriptstyle  \circ }$}}\,} A) \to  B} \and 
\inferrule {\Gamma  \,\vdash \, f \mathpunct {\,{\raisebox {-0.03em}{${\scriptscriptstyle  \circ }$}} \mathllap {\raisebox {0.28em}{${\scriptscriptstyle  \circ }$}}\,} (x \mathpunct {\,{\raisebox {-0.03em}{${\scriptscriptstyle  \circ }$}} \mathllap {\raisebox {0.28em}{${\scriptscriptstyle  \circ }$}}\,} A) \to  B \and  \Gamma  \,\vdash \, a \mathpunct {\,{\raisebox {-0.03em}{${\scriptscriptstyle  \circ }$}} \mathllap {\raisebox {0.28em}{${\scriptscriptstyle  \circ }$}}\,} A}{\Gamma  \,\vdash \, f(a) \mathpunct {\,{\raisebox {-0.03em}{${\scriptscriptstyle  \circ }$}} \mathllap {\raisebox {0.28em}{${\scriptscriptstyle  \circ }$}}\,} B[x \backslash  a]}

\end {mathpar}
]]></fr:resource-source></fr:resource>
</fr:mainmatter>
                        </fr:tree>
                        <fr:tree show-metadata="false">
                          <fr:frontmatter>
                            <fr:authors>
                              <fr:author>
                                <fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link>
                              </fr:author>
                            </fr:authors>
                            <fr:date>
                              <fr:year>2025</fr:year>
                              <fr:month>3</fr:month>
                              <fr:day>13</fr:day>
                            </fr:date>
                            <fr:uri>https://forest.topos.site/ocl-00A7/</fr:uri>
                            <fr:display-uri>https://forest.topos.site/ocl-00A7</fr:display-uri>
                            <fr:route>/ocl-00A7/</fr:route>
                            <fr:title text="Beta and eta for outer pi types">Beta and eta for outer pi types</fr:title>
                            <fr:taxon>rule</fr:taxon>
                          </fr:frontmatter>
                          <fr:mainmatter>
<fr:resource hash="fab8be00a80742ad9dad257fe56bc230"><fr:resource-content><html:img src="https://forest.topos.site/fab8be00a80742ad9dad257fe56bc230.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[\usepackage {mathpartir, amssymb, amsmath, mathtools}]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[
\begin {mathpar}

\inferrule {\Gamma , x \mathpunct {\,{\raisebox {-0.03em}{${\scriptscriptstyle  \circ }$}} \mathllap {\raisebox {0.28em}{${\scriptscriptstyle  \circ }$}}\,} A \,\vdash \, b \mathpunct {\,{\raisebox {-0.03em}{${\scriptscriptstyle  \circ }$}} \mathllap {\raisebox {0.28em}{${\scriptscriptstyle  \circ }$}}\,} B \and  \Gamma  \,\vdash \, a \mathpunct {\,{\raisebox {-0.03em}{${\scriptscriptstyle  \circ }$}} \mathllap {\raisebox {0.28em}{${\scriptscriptstyle  \circ }$}}\,} A}{\Gamma  \,\vdash \, (x \mapsto  b)(a) = b[x \backslash  a] \mathpunct {\,{\raisebox {-0.03em}{${\scriptscriptstyle  \circ }$}} \mathllap {\raisebox {0.28em}{${\scriptscriptstyle  \circ }$}}\,} B[x \backslash  a]} \and 
\inferrule {\Gamma  \,\vdash \, f \mathpunct {\,{\raisebox {-0.03em}{${\scriptscriptstyle  \circ }$}} \mathllap {\raisebox {0.28em}{${\scriptscriptstyle  \circ }$}}\,} (x \mathpunct {\,{\raisebox {-0.03em}{${\scriptscriptstyle  \circ }$}} \mathllap {\raisebox {0.28em}{${\scriptscriptstyle  \circ }$}}\,} A) \to  B}{\Gamma  \,\vdash \, f = (x \mapsto  f(x)) \mathpunct {\,{\raisebox {-0.03em}{${\scriptscriptstyle  \circ }$}} \mathllap {\raisebox {0.28em}{${\scriptscriptstyle  \circ }$}}\,} (x \mathpunct {\,{\raisebox {-0.03em}{${\scriptscriptstyle  \circ }$}} \mathllap {\raisebox {0.28em}{${\scriptscriptstyle  \circ }$}}\,} A) \to  B}

\end {mathpar}
]]></fr:resource-source></fr:resource>
</fr:mainmatter>
                        </fr:tree>
                        <html:p>Then the semantics for these rules are given by a cartesian morphism <fr:tex display="inline"><![CDATA[P_{{\mathsf {u}^{\scriptscriptstyle  \circ }}} \upuparrows  P_{{\mathsf {u}^{\scriptscriptstyle  \circ }}} \to  P_{{\mathsf {u}^{\scriptscriptstyle  \circ }}}]]></fr:tex>, just as in <fr:link href="/ocl-0080/" title="Pi types" uri="https://forest.topos.site/ocl-0080/" display-uri="https://forest.topos.site/ocl-0080" type="local">§ <fr:contextual-number uri="https://forest.topos.site/ocl-0080/" display-uri="https://forest.topos.site/ocl-0080" /></fr:link>.</html:p>
                      </fr:mainmatter>
                    </fr:tree>
                    <html:p>We trust that the reader could supply similar definitions for outer and inner versions for the rest of the 2-theories in <fr:link href="/ocl-007W/" title="2-theories in \mathbb {D} and their semantics" uri="https://forest.topos.site/ocl-007W/" display-uri="https://forest.topos.site/ocl-007W" type="local">§ <fr:contextual-number uri="https://forest.topos.site/ocl-007W/" display-uri="https://forest.topos.site/ocl-007W" /></fr:link>.</html:p>
                  </fr:mainmatter>
                </fr:tree>
                <fr:tree show-metadata="false">
                  <fr:frontmatter>
                    <fr:authors>
                      <fr:contributor>
                        <fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link>
                      </fr:contributor>
                    </fr:authors>
                    <fr:date>
                      <fr:year>2025</fr:year>
                      <fr:month>2</fr:month>
                      <fr:day>28</fr:day>
                    </fr:date>
                    <fr:uri>https://forest.topos.site/ocl-0086/</fr:uri>
                    <fr:display-uri>https://forest.topos.site/ocl-0086</fr:display-uri>
                    <fr:route>/ocl-0086/</fr:route>
                    <fr:title text="Multi-level 2-theories">Multi-level 2-theories</fr:title>
                  </fr:frontmatter>
                  <fr:mainmatter>
                    <html:p>The interesting 2-theories in two-level type theory are those which mix the levels.</html:p>
                    <fr:tree show-metadata="false">
                      <fr:frontmatter>
                        <fr:authors>
                          <fr:author>
                            <fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link>
                          </fr:author>
                        </fr:authors>
                        <fr:date>
                          <fr:year>2025</fr:year>
                          <fr:month>3</fr:month>
                          <fr:day>12</fr:day>
                        </fr:date>
                        <fr:uri>https://forest.topos.site/ocl-00A1/</fr:uri>
                        <fr:display-uri>https://forest.topos.site/ocl-00A1</fr:display-uri>
                        <fr:route>/ocl-00A1/</fr:route>
                        <fr:title text="Inclusion of inner types into outer types">Inclusion of inner types into outer types</fr:title>
                      </fr:frontmatter>
                      <fr:mainmatter><html:p>This 2-theory breaks the symmetry between inner and outer types, by injecting inner types into outer types. Such a 2-theory might reflect an intended semantics where outer types are somehow “larger” than inner types.</html:p><html:p>For instance, in Agda there is such a inclusion from universe level 0 into universe level 1.</html:p><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link></fr:author></fr:authors><fr:date><fr:year>2025</fr:year><fr:month>3</fr:month><fr:day>13</fr:day></fr:date><fr:uri>https://forest.topos.site/ocl-00A8/</fr:uri><fr:display-uri>https://forest.topos.site/ocl-00A8</fr:display-uri><fr:route>/ocl-00A8/</fr:route><fr:title text="Formation for inclusion of inner into outer">Formation for inclusion of inner into outer</fr:title><fr:taxon>rule</fr:taxon></fr:frontmatter><fr:mainmatter>
<fr:resource hash="b20a6a2f0b7c312f46e157dd25229464"><fr:resource-content><html:img src="https://forest.topos.site/b20a6a2f0b7c312f46e157dd25229464.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[\usepackage {mathpartir, amssymb, amsmath, mathtools}]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[
\begin {mathpar}
\inferrule {\Gamma  \,\vdash \, A \,\,\mathsf {type}^{\bullet }}{\Gamma  \,\vdash \, \circ  A \,\,\mathsf {type}^{\circ }}

\end {mathpar}
]]></fr:resource-source></fr:resource>
</fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link></fr:author></fr:authors><fr:date><fr:year>2025</fr:year><fr:month>3</fr:month><fr:day>13</fr:day></fr:date><fr:uri>https://forest.topos.site/ocl-00A9/</fr:uri><fr:display-uri>https://forest.topos.site/ocl-00A9</fr:display-uri><fr:route>/ocl-00A9/</fr:route><fr:title text="Introduction and elimination for inclusion of inner into outer">Introduction and elimination for inclusion of inner into outer</fr:title><fr:taxon>rule</fr:taxon></fr:frontmatter><fr:mainmatter>
<fr:resource hash="05ded2da2ac0c0d482eb67a3295e5814"><fr:resource-content><html:img src="https://forest.topos.site/05ded2da2ac0c0d482eb67a3295e5814.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[\usepackage {mathpartir, amssymb, amsmath, mathtools}]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[
\begin {mathpar}
\inferrule {\Gamma  \,\vdash \, a \mathpunct {\,{\raisebox {-0.03em}{${\scriptscriptstyle  \bullet }$}} \mathllap {\raisebox {0.28em}{${\scriptscriptstyle  \bullet }$}}\,} A}{\Gamma  \,\vdash \, \circ  a \mathpunct {\,{\raisebox {-0.03em}{${\scriptscriptstyle  \circ }$}} \mathllap {\raisebox {0.28em}{${\scriptscriptstyle  \circ }$}}\,} \circ  A} \and 
\inferrule {\Gamma  \,\vdash \, a \mathpunct {\,{\raisebox {-0.03em}{${\scriptscriptstyle  \circ }$}} \mathllap {\raisebox {0.28em}{${\scriptscriptstyle  \circ }$}}\,} \circ  A}{\Gamma  \,\vdash \, \bullet  a \mathpunct {\,{\raisebox {-0.03em}{${\scriptscriptstyle  \circ }$}} \mathllap {\raisebox {0.28em}{${\scriptscriptstyle  \circ }$}}\,} A}

\end {mathpar}
]]></fr:resource-source></fr:resource>
</fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link></fr:author></fr:authors><fr:date><fr:year>2025</fr:year><fr:month>3</fr:month><fr:day>13</fr:day></fr:date><fr:uri>https://forest.topos.site/ocl-00AA/</fr:uri><fr:display-uri>https://forest.topos.site/ocl-00AA</fr:display-uri><fr:route>/ocl-00AA/</fr:route><fr:title text="Beta and eta for inclusion of inner into outer">Beta and eta for inclusion of inner into outer</fr:title><fr:taxon>rule</fr:taxon></fr:frontmatter><fr:mainmatter>
<fr:resource hash="3d67daf931fede2b17cb2270d944a512"><fr:resource-content><html:img src="https://forest.topos.site/3d67daf931fede2b17cb2270d944a512.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[\usepackage {mathpartir, amssymb, amsmath, mathtools}]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[
\begin {mathpar}
\inferrule {\Gamma  \,\vdash \, a \mathpunct {\,{\raisebox {-0.03em}{${\scriptscriptstyle  \bullet }$}} \mathllap {\raisebox {0.28em}{${\scriptscriptstyle  \bullet }$}}\,} A}{\Gamma  \,\vdash \, a = \bullet  \circ  t \mathpunct {\,{\raisebox {-0.03em}{${\scriptscriptstyle  \bullet }$}} \mathllap {\raisebox {0.28em}{${\scriptscriptstyle  \bullet }$}}\,} A} \and 
\inferrule {\Gamma  \,\vdash \, a \mathpunct {\,{\raisebox {-0.03em}{${\scriptscriptstyle  \circ }$}} \mathllap {\raisebox {0.28em}{${\scriptscriptstyle  \circ }$}}\,} \circ  A}{\Gamma  \,\vdash \, a = \circ  \bullet  a \mathpunct {\,{\raisebox {-0.03em}{${\scriptscriptstyle  \circ }$}} \mathllap {\raisebox {0.28em}{${\scriptscriptstyle  \circ }$}}\,} \circ  A}

\end {mathpar}
]]></fr:resource-source></fr:resource>
</fr:mainmatter></fr:tree><html:p>The semantics for this are a cartesian morphism <fr:tex display="inline"><![CDATA[P_{\mathsf {u}^{\scriptscriptstyle  \bullet }} \to  P_{\mathsf {u}^{\scriptscriptstyle  \circ }}]]></fr:tex>, or equivalently a pullback square</html:p>



<html:figure><fr:resource hash="cf3f1bc7b839717502032faf45441b33"><fr:resource-content><html:img src="https://forest.topos.site/cf3f1bc7b839717502032faf45441b33.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[

\usepackage[utf8]{inputenc}
\DeclareFontFamily{U}{min}{}
\DeclareFontShape{U}{min}{m}{n}{<-> udmj30}{}
\newcommand\yo{\!\text{\usefont{U}{min}{m}{n}\symbol{'207}}\!}
\DeclareUnicodeCharacter{3088}{\yo}


\usepackage{tikz, tikz-cd, mathtools, amssymb, stmaryrd,xcolor}
\usetikzlibrary{matrix,arrows}
\usetikzlibrary{backgrounds,fit,positioning,calc,shapes}
\usetikzlibrary{decorations.pathreplacing}
\usetikzlibrary{decorations.pathmorphing}
\usetikzlibrary{decorations.markings}

% `tikz-cd` is necessary to draw commutative diagrams.
\RequirePackage{tikz-cd}
% `amssymb` is necessary for `\lrcorner` and `\ulcorner`.
\RequirePackage{amssymb}
% `calc` is necessary to draw curved arrows.
\usetikzlibrary{calc}
% `pathmorphing` is necessary to draw squiggly arrows.
\usetikzlibrary{decorations.pathmorphing}
% `spath3` is necessary to draw shortened edges.
\usetikzlibrary{spath3}

% A TikZ style for curved arrows of a fixed height, due to AndréC.
\tikzset{curve/.style={settings={#1},to path={(\tikztostart)
    .. controls ($(\tikztostart)!\pv{pos}!(\tikztotarget)!\pv{height}!270:(\tikztotarget)$)
    and ($(\tikztostart)!1-\pv{pos}!(\tikztotarget)!\pv{height}!270:(\tikztotarget)$)
    .. (\tikztotarget)\tikztonodes}},
    settings/.code={\tikzset{quiver/.cd,#1}
        \def\pv##1{\pgfkeysvalueof{/tikz/quiver/##1}}},
    quiver/.cd,pos/.initial=0.35,height/.initial=0}

% A TikZ style for shortening paths without the poor behaviour of `shorten <' and `shorten >'.
\tikzset{between/.style n args={2}{/tikz/spath/at end path construction={
    \tikzset{spath/split at keep middle={current}{#1}{#2}}
}}}

% TikZ arrowhead/tail styles.
\tikzset{tail reversed/.code={\pgfsetarrowsstart{tikzcd to}}}
\tikzset{2tail/.code={\pgfsetarrowsstart{Implies[reversed]}}}
\tikzset{2tail reversed/.code={\pgfsetarrowsstart{Implies}}}
% TikZ arrow styles.
\tikzset{no body/.style={/tikz/dash pattern=on 0 off 1mm}}


\newcommand{\triplecolon}{%
  \mathrel{\vbox{\baselineskip=2pt \hbox{.}\hbox{.}\hbox{.}}}%
}

\DeclareUnicodeCharacter{2AF6}{\triplecolon}
\usepackage{mathpartir}

]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[
\begin {tikzcd}
	{\mathsf {Tm}^{\scriptscriptstyle  \bullet }} & {\mathsf {Tm}^{\scriptscriptstyle  \circ }} \\
	{\mathsf {Ty}^{\scriptscriptstyle  \bullet }} & {\mathsf {Ty}^{\scriptscriptstyle  \circ }}
	\arrow ["\circ ", from=1-1, to=1-2]
	\arrow ["{\mathsf {u}^{\scriptscriptstyle  \bullet }}"', from=1-1, to=2-1]
	\arrow ["\lrcorner "{anchor=center, pos=0.125}, draw=none, from=1-1, to=2-2]
	\arrow ["{\mathsf {u}^{\scriptscriptstyle  \circ }}", from=1-2, to=2-2]
	\arrow ["\circ "', from=2-1, to=2-2]
\end {tikzcd}
]]></fr:resource-source></fr:resource></html:figure>

<html:p>This pullback square says that the terms of an inner type <fr:tex display="inline"><![CDATA[A]]></fr:tex> are in bijection with the terms of the outer type <fr:tex display="inline"><![CDATA[\circ  A]]></fr:tex>.</html:p></fr:mainmatter>
                    </fr:tree>
                    <fr:tree show-metadata="false">
                      <fr:frontmatter>
                        <fr:authors>
                          <fr:author>
                            <fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link>
                          </fr:author>
                        </fr:authors>
                        <fr:date>
                          <fr:year>2025</fr:year>
                          <fr:month>3</fr:month>
                          <fr:day>13</fr:day>
                        </fr:date>
                        <fr:uri>https://forest.topos.site/ocl-00AB/</fr:uri>
                        <fr:display-uri>https://forest.topos.site/ocl-00AB</fr:display-uri>
                        <fr:route>/ocl-00AB/</fr:route>
                        <fr:title text="Inner-inner-outer pi types">Inner-inner-outer pi types</fr:title>
                      </fr:frontmatter>
                      <fr:mainmatter>
                        <html:p>If functions are somehow “too large” to be inner types (as would be the case, for instance, if inner types were supposed to model finite-dimensional smooth manifolds, or inner types were supposed to be statically-sized types in a systems language), it is never the less still possible to have an outer type which plays the role of a pi type for inner types. We call these “inner-inner-outer” pi types, because the domain is an inner type, the codomain is an inner type, but the pi type itself in an outer type. What we previously called “inner pi types” in <fr:link href="/ocl-0085/" title="Single-level 2-theories" uri="https://forest.topos.site/ocl-0085/" display-uri="https://forest.topos.site/ocl-0085" type="local">§ <fr:contextual-number uri="https://forest.topos.site/ocl-0085/" display-uri="https://forest.topos.site/ocl-0085" /></fr:link> would now be called inner-inner-inner pi types.</html:p>
                        <html:p>Note that we do not bother to make up different notation for all of the various pi types (inner-inner-inner, inner-inner-outer, inner-outer-outer, etc.), as a given 2-theory there is likely to not contain more than two of them, one with an inner domain and the other with an outer domain. If we end up wanting more, we will have to come up with notation.</html:p>
                        <fr:tree show-metadata="false">
                          <fr:frontmatter>
                            <fr:authors>
                              <fr:author>
                                <fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link>
                              </fr:author>
                            </fr:authors>
                            <fr:date>
                              <fr:year>2025</fr:year>
                              <fr:month>3</fr:month>
                              <fr:day>13</fr:day>
                            </fr:date>
                            <fr:uri>https://forest.topos.site/ocl-00AC/</fr:uri>
                            <fr:display-uri>https://forest.topos.site/ocl-00AC</fr:display-uri>
                            <fr:route>/ocl-00AC/</fr:route>
                            <fr:title text="Formation for inner-inner-outer pi types">Formation for inner-inner-outer pi types</fr:title>
                            <fr:taxon>rule</fr:taxon>
                          </fr:frontmatter>
                          <fr:mainmatter>
<fr:resource hash="5ac30f0ac666bb18ca10834d25206866"><fr:resource-content><html:img src="https://forest.topos.site/5ac30f0ac666bb18ca10834d25206866.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[\usepackage {mathpartir, amssymb, amsmath, mathtools}]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[
\begin {mathpar}

\inferrule {\Gamma  \,\vdash \, A \,\,\mathsf {type}^{\bullet } \and  \Gamma , x \colon  A \,\vdash \, B \,\,\mathsf {type}^{\bullet }}{\Gamma  \,\vdash \, (x \mathpunct {\,{\raisebox {-0.03em}{${\scriptscriptstyle  \bullet }$}} \mathllap {\raisebox {0.28em}{${\scriptscriptstyle  \bullet }$}}\,} A) \to  B \,\,\mathsf {type}^{\circ }}

\end {mathpar}
]]></fr:resource-source></fr:resource>
</fr:mainmatter>
                        </fr:tree>
                        <fr:tree show-metadata="false">
                          <fr:frontmatter>
                            <fr:authors>
                              <fr:author>
                                <fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link>
                              </fr:author>
                            </fr:authors>
                            <fr:date>
                              <fr:year>2025</fr:year>
                              <fr:month>3</fr:month>
                              <fr:day>13</fr:day>
                            </fr:date>
                            <fr:uri>https://forest.topos.site/ocl-00AD/</fr:uri>
                            <fr:display-uri>https://forest.topos.site/ocl-00AD</fr:display-uri>
                            <fr:route>/ocl-00AD/</fr:route>
                            <fr:title text="Introduction and elimination for inner-inner-outer pi types">Introduction and elimination for inner-inner-outer pi types</fr:title>
                            <fr:taxon>rule</fr:taxon>
                          </fr:frontmatter>
                          <fr:mainmatter>
<fr:resource hash="5712b61aecc00bf0d93c948b329d61fc"><fr:resource-content><html:img src="https://forest.topos.site/5712b61aecc00bf0d93c948b329d61fc.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[\usepackage {mathpartir, amssymb, amsmath, mathtools}]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[
\begin {mathpar}

\inferrule {\Gamma , x \mathpunct {\,{\raisebox {-0.03em}{${\scriptscriptstyle  \bullet }$}} \mathllap {\raisebox {0.28em}{${\scriptscriptstyle  \bullet }$}}\,} A \,\vdash \, b \mathpunct {\,{\raisebox {-0.03em}{${\scriptscriptstyle  \bullet }$}} \mathllap {\raisebox {0.28em}{${\scriptscriptstyle  \bullet }$}}\,} B}{\Gamma  \,\vdash \, (x \mapsto  B) \mathpunct {\,{\raisebox {-0.03em}{${\scriptscriptstyle  \circ }$}} \mathllap {\raisebox {0.28em}{${\scriptscriptstyle  \circ }$}}\,} (x \mathpunct {\,{\raisebox {-0.03em}{${\scriptscriptstyle  \bullet }$}} \mathllap {\raisebox {0.28em}{${\scriptscriptstyle  \bullet }$}}\,} A) \to  B} \and 
\inferrule {\Gamma  \,\vdash \, f \mathpunct {\,{\raisebox {-0.03em}{${\scriptscriptstyle  \circ }$}} \mathllap {\raisebox {0.28em}{${\scriptscriptstyle  \circ }$}}\,} (x \mathpunct {\,{\raisebox {-0.03em}{${\scriptscriptstyle  \bullet }$}} \mathllap {\raisebox {0.28em}{${\scriptscriptstyle  \bullet }$}}\,} A) \to  B \and  \Gamma  \,\vdash \, a \mathpunct {\,{\raisebox {-0.03em}{${\scriptscriptstyle  \bullet }$}} \mathllap {\raisebox {0.28em}{${\scriptscriptstyle  \bullet }$}}\,} A}{\Gamma  \,\vdash \, f(a) \mathpunct {\,{\raisebox {-0.03em}{${\scriptscriptstyle  \bullet }$}} \mathllap {\raisebox {0.28em}{${\scriptscriptstyle  \bullet }$}}\,} B[x \backslash  a]}

\end {mathpar}
]]></fr:resource-source></fr:resource>
</fr:mainmatter>
                        </fr:tree>
                        <fr:tree show-metadata="false">
                          <fr:frontmatter>
                            <fr:authors>
                              <fr:author>
                                <fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link>
                              </fr:author>
                            </fr:authors>
                            <fr:date>
                              <fr:year>2025</fr:year>
                              <fr:month>3</fr:month>
                              <fr:day>13</fr:day>
                            </fr:date>
                            <fr:uri>https://forest.topos.site/ocl-00AE/</fr:uri>
                            <fr:display-uri>https://forest.topos.site/ocl-00AE</fr:display-uri>
                            <fr:route>/ocl-00AE/</fr:route>
                            <fr:title text="Beta and eta for inner-inner-outer pi types">Beta and eta for inner-inner-outer pi types</fr:title>
                            <fr:taxon>rule</fr:taxon>
                          </fr:frontmatter>
                          <fr:mainmatter>
<fr:resource hash="8424dc8878ebdb2bb82838c22ba16f6e"><fr:resource-content><html:img src="https://forest.topos.site/8424dc8878ebdb2bb82838c22ba16f6e.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[\usepackage {mathpartir, amssymb, amsmath, mathtools}]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[
\begin {mathpar}

\inferrule {\Gamma , x \mathpunct {\,{\raisebox {-0.03em}{${\scriptscriptstyle  \bullet }$}} \mathllap {\raisebox {0.28em}{${\scriptscriptstyle  \bullet }$}}\,} A \,\vdash \, b \mathpunct {\,{\raisebox {-0.03em}{${\scriptscriptstyle  \bullet }$}} \mathllap {\raisebox {0.28em}{${\scriptscriptstyle  \bullet }$}}\,} B \and  \Gamma  \,\vdash \, a \mathpunct {\,{\raisebox {-0.03em}{${\scriptscriptstyle  \bullet }$}} \mathllap {\raisebox {0.28em}{${\scriptscriptstyle  \bullet }$}}\,} A}{\Gamma  \,\vdash \, (x \mapsto  b)(a) = b[x \backslash  a] \mathpunct {\,{\raisebox {-0.03em}{${\scriptscriptstyle  \bullet }$}} \mathllap {\raisebox {0.28em}{${\scriptscriptstyle  \bullet }$}}\,} B[x \backslash  a]} \and 
\inferrule {\Gamma  \,\vdash \, f \mathpunct {\,{\raisebox {-0.03em}{${\scriptscriptstyle  \circ }$}} \mathllap {\raisebox {0.28em}{${\scriptscriptstyle  \circ }$}}\,} (x \mathpunct {\,{\raisebox {-0.03em}{${\scriptscriptstyle  \bullet }$}} \mathllap {\raisebox {0.28em}{${\scriptscriptstyle  \bullet }$}}\,} A) \to  B}{\Gamma  \,\vdash \, f = (x \mapsto  f(x)) \mathpunct {\,{\raisebox {-0.03em}{${\scriptscriptstyle  \circ }$}} \mathllap {\raisebox {0.28em}{${\scriptscriptstyle  \circ }$}}\,} (x \mathpunct {\,{\raisebox {-0.03em}{${\scriptscriptstyle  \bullet }$}} \mathllap {\raisebox {0.28em}{${\scriptscriptstyle  \bullet }$}}\,} A) \to  B}

\end {mathpar}
]]></fr:resource-source></fr:resource>
</fr:mainmatter>
                        </fr:tree>
                        <html:p>The semantics for inner-inner-outer pi types are a cartesian morphism <fr:tex display="inline"><![CDATA[P_{\mathsf {u}^{\scriptscriptstyle  \bullet }} \upuparrows  P_{\mathsf {u}^{\scriptscriptstyle  \bullet }} \to  P_{\mathsf {u}^{\scriptscriptstyle  \circ }}]]></fr:tex>.</html:p>
                      </fr:mainmatter>
                    </fr:tree>
                    <fr:tree show-metadata="false">
                      <fr:frontmatter>
                        <fr:authors>
                          <fr:author>
                            <fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link>
                          </fr:author>
                        </fr:authors>
                        <fr:date>
                          <fr:year>2025</fr:year>
                          <fr:month>3</fr:month>
                          <fr:day>13</fr:day>
                        </fr:date>
                        <fr:uri>https://forest.topos.site/ocl-00AF/</fr:uri>
                        <fr:display-uri>https://forest.topos.site/ocl-00AF</fr:display-uri>
                        <fr:route>/ocl-00AF/</fr:route>
                        <fr:title text="Inner-outer-outer pi types">Inner-outer-outer pi types</fr:title>
                      </fr:frontmatter>
                      <fr:mainmatter>
                        <html:p>At this point, it should be entirely routine to come up with the definition of inner-outer-outer pi types, and these are modeled by a cartesian morphism <fr:tex display="inline"><![CDATA[P_{\mathsf {u}^{\scriptscriptstyle  \bullet }} \upuparrows  P_{\mathsf {u}^{\scriptscriptstyle  \circ }} \to  P_{\mathsf {u}^{\scriptscriptstyle  \circ }}]]></fr:tex>, and any other variation is similar.</html:p>
                      </fr:mainmatter>
                    </fr:tree>
                    <fr:tree show-metadata="false">
                      <fr:frontmatter>
                        <fr:authors>
                          <fr:author>
                            <fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link>
                          </fr:author>
                        </fr:authors>
                        <fr:date>
                          <fr:year>2025</fr:year>
                          <fr:month>3</fr:month>
                          <fr:day>13</fr:day>
                        </fr:date>
                        <fr:uri>https://forest.topos.site/ocl-00AG/</fr:uri>
                        <fr:display-uri>https://forest.topos.site/ocl-00AG</fr:display-uri>
                        <fr:route>/ocl-00AG/</fr:route>
                        <fr:title text="Inner universe as outer type">Inner universe as outer type</fr:title>
                      </fr:frontmatter>
                      <fr:mainmatter><html:p>It is well-known that having a type of all types leads to inconsitency. Classically, having “universes” is done by having a <fr:tex display="inline"><![CDATA[n+1]]></fr:tex>-type of <fr:tex display="inline"><![CDATA[n]]></fr:tex>-types. In this section, we give the rules for having an outer type of inner types.</html:p><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link></fr:author></fr:authors><fr:date><fr:year>2025</fr:year><fr:month>3</fr:month><fr:day>13</fr:day></fr:date><fr:uri>https://forest.topos.site/ocl-00AH/</fr:uri><fr:display-uri>https://forest.topos.site/ocl-00AH</fr:display-uri><fr:route>/ocl-00AH/</fr:route><fr:title text="Formation for inner universe">Formation for inner universe</fr:title><fr:taxon>rule</fr:taxon></fr:frontmatter><fr:mainmatter>
<fr:resource hash="896b66f9246727b420ea2291881aaf8b"><fr:resource-content><html:img src="https://forest.topos.site/896b66f9246727b420ea2291881aaf8b.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[\usepackage {mathpartir, amssymb, amsmath, mathtools}]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[
\begin {mathpar}
\inferrule {\Gamma  \,\,\mathsf {ctx}}{\Gamma  \,\vdash \, {U^{{\scriptscriptstyle  \bullet }}} \,\,\mathsf {type}^{\circ }}

\end {mathpar}
]]></fr:resource-source></fr:resource>
</fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link></fr:author></fr:authors><fr:date><fr:year>2025</fr:year><fr:month>3</fr:month><fr:day>13</fr:day></fr:date><fr:uri>https://forest.topos.site/ocl-00AI/</fr:uri><fr:display-uri>https://forest.topos.site/ocl-00AI</fr:display-uri><fr:route>/ocl-00AI/</fr:route><fr:title text="Introduction and elimination for inner universe">Introduction and elimination for inner universe</fr:title><fr:taxon>rule</fr:taxon></fr:frontmatter><fr:mainmatter>
<fr:resource hash="2e74590ad12fd65b9a25b6fcfbcee62e"><fr:resource-content><html:img src="https://forest.topos.site/2e74590ad12fd65b9a25b6fcfbcee62e.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[\usepackage {mathpartir, amssymb, amsmath, mathtools}]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[
\begin {mathpar}

\inferrule {\Gamma  \,\vdash \, A \,\,\mathsf {type}^{\bullet }}{\Gamma  \,\vdash \, [A] \mathpunct {\,{\raisebox {-0.03em}{${\scriptscriptstyle  \circ }$}} \mathllap {\raisebox {0.28em}{${\scriptscriptstyle  \circ }$}}\,} {U^{{\scriptscriptstyle  \bullet }}}} \and 
\inferrule {\Gamma  \,\vdash \, u \mathpunct {\,{\raisebox {-0.03em}{${\scriptscriptstyle  \circ }$}} \mathllap {\raisebox {0.28em}{${\scriptscriptstyle  \circ }$}}\,} {U^{{\scriptscriptstyle  \bullet }}}}{\Gamma  \,\vdash \, \mathrm {El}(u) \,\,\mathsf {type}^{\bullet }}

\end {mathpar}
]]></fr:resource-source></fr:resource>
</fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link></fr:author></fr:authors><fr:date><fr:year>2025</fr:year><fr:month>3</fr:month><fr:day>13</fr:day></fr:date><fr:uri>https://forest.topos.site/ocl-00AJ/</fr:uri><fr:display-uri>https://forest.topos.site/ocl-00AJ</fr:display-uri><fr:route>/ocl-00AJ/</fr:route><fr:title text="Beta and eta for inner universe">Beta and eta for inner universe</fr:title><fr:taxon>rule</fr:taxon></fr:frontmatter><fr:mainmatter>
<fr:resource hash="6660a7c76e922ff9194ffd1d85e5e64c"><fr:resource-content><html:img src="https://forest.topos.site/6660a7c76e922ff9194ffd1d85e5e64c.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[\usepackage {mathpartir, amssymb, amsmath, mathtools}]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[
\begin {mathpar}

\inferrule {\Gamma  \,\vdash \, A \,\,\mathsf {type}^{\bullet }}{\Gamma  \,\vdash \, A = \mathrm {El}([A]) \,\,\mathsf {type}^{\bullet }} \and 
\inferrule {\Gamma  \,\vdash \, u \mathpunct {\,{\raisebox {-0.03em}{${\scriptscriptstyle  \circ }$}} \mathllap {\raisebox {0.28em}{${\scriptscriptstyle  \circ }$}}\,} {U^{{\scriptscriptstyle  \bullet }}}}{\Gamma  \,\vdash \, u = [\mathrm {El}(u)] \mathpunct {\,{\raisebox {-0.03em}{${\scriptscriptstyle  \circ }$}} \mathllap {\raisebox {0.28em}{${\scriptscriptstyle  \circ }$}}\,} {U^{{\scriptscriptstyle  \bullet }}}}

\end {mathpar}
]]></fr:resource-source></fr:resource>
</fr:mainmatter></fr:tree><html:p>In practice, we may elide the <fr:tex display="inline"><![CDATA[[A]]]></fr:tex> and the <fr:tex display="inline"><![CDATA[\mathrm {El}(u)]]></fr:tex>, so our formation rule would look like</html:p>
<fr:resource hash="a1a133f569b957befd4a9a31ce3d186e"><fr:resource-content><html:img src="https://forest.topos.site/a1a133f569b957befd4a9a31ce3d186e.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[\usepackage {mathpartir, amssymb, amsmath, mathtools}]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[
\begin {mathpar}

\inferrule {\Gamma  \,\vdash \, A \,\,\mathsf {type}^{\circ }}{\Gamma  \,\vdash \, A \mathpunct {\,{\raisebox {-0.03em}{${\scriptscriptstyle  \circ }$}} \mathllap {\raisebox {0.28em}{${\scriptscriptstyle  \circ }$}}\,} {U^{{\scriptscriptstyle  \bullet }}}}

\end {mathpar}
]]></fr:resource-source></fr:resource>
<html:p>The semantics for this are a pullback square</html:p>



<html:figure><fr:resource hash="45e22bfe80cba33223a783f1011edf97"><fr:resource-content><html:img src="https://forest.topos.site/45e22bfe80cba33223a783f1011edf97.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[

\usepackage[utf8]{inputenc}
\DeclareFontFamily{U}{min}{}
\DeclareFontShape{U}{min}{m}{n}{<-> udmj30}{}
\newcommand\yo{\!\text{\usefont{U}{min}{m}{n}\symbol{'207}}\!}
\DeclareUnicodeCharacter{3088}{\yo}


\usepackage{tikz, tikz-cd, mathtools, amssymb, stmaryrd,xcolor}
\usetikzlibrary{matrix,arrows}
\usetikzlibrary{backgrounds,fit,positioning,calc,shapes}
\usetikzlibrary{decorations.pathreplacing}
\usetikzlibrary{decorations.pathmorphing}
\usetikzlibrary{decorations.markings}

% `tikz-cd` is necessary to draw commutative diagrams.
\RequirePackage{tikz-cd}
% `amssymb` is necessary for `\lrcorner` and `\ulcorner`.
\RequirePackage{amssymb}
% `calc` is necessary to draw curved arrows.
\usetikzlibrary{calc}
% `pathmorphing` is necessary to draw squiggly arrows.
\usetikzlibrary{decorations.pathmorphing}
% `spath3` is necessary to draw shortened edges.
\usetikzlibrary{spath3}

% A TikZ style for curved arrows of a fixed height, due to AndréC.
\tikzset{curve/.style={settings={#1},to path={(\tikztostart)
    .. controls ($(\tikztostart)!\pv{pos}!(\tikztotarget)!\pv{height}!270:(\tikztotarget)$)
    and ($(\tikztostart)!1-\pv{pos}!(\tikztotarget)!\pv{height}!270:(\tikztotarget)$)
    .. (\tikztotarget)\tikztonodes}},
    settings/.code={\tikzset{quiver/.cd,#1}
        \def\pv##1{\pgfkeysvalueof{/tikz/quiver/##1}}},
    quiver/.cd,pos/.initial=0.35,height/.initial=0}

% A TikZ style for shortening paths without the poor behaviour of `shorten <' and `shorten >'.
\tikzset{between/.style n args={2}{/tikz/spath/at end path construction={
    \tikzset{spath/split at keep middle={current}{#1}{#2}}
}}}

% TikZ arrowhead/tail styles.
\tikzset{tail reversed/.code={\pgfsetarrowsstart{tikzcd to}}}
\tikzset{2tail/.code={\pgfsetarrowsstart{Implies[reversed]}}}
\tikzset{2tail reversed/.code={\pgfsetarrowsstart{Implies}}}
% TikZ arrow styles.
\tikzset{no body/.style={/tikz/dash pattern=on 0 off 1mm}}


\newcommand{\triplecolon}{%
  \mathrel{\vbox{\baselineskip=2pt \hbox{.}\hbox{.}\hbox{.}}}%
}

\DeclareUnicodeCharacter{2AF6}{\triplecolon}
\usepackage{mathpartir}

]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[
\begin {tikzcd}
	{\mathsf {Ty}^{\scriptscriptstyle  \bullet }} & {\mathsf {Tm}^{\scriptscriptstyle  \circ }} \\
	1 & {\mathsf {Ty}^{\scriptscriptstyle  \circ }}
	\arrow ["\mathrm {El}", from=1-1, to=1-2]
	\arrow [from=1-1, to=2-1]
	\arrow ["\lrcorner "{anchor=center, pos=0.125}, draw=none, from=1-1, to=2-2]
	\arrow ["{\mathsf {u}^{\scriptscriptstyle  \circ }}", from=1-2, to=2-2]
	\arrow ["{U^{{\scriptscriptstyle  \bullet }}}"', from=2-1, to=2-2]
\end {tikzcd}
]]></fr:resource-source></fr:resource></html:figure>

<html:p>Equivalently, in the language of polynomials, this is a cartesian morphism <fr:tex display="inline"><![CDATA[y^{{\mathsf {Ty}^{\scriptscriptstyle  \bullet }}} \to  P_{\mathsf {u}^{\scriptscriptstyle  \circ }}]]></fr:tex>.</html:p></fr:mainmatter>
                    </fr:tree>
                    <fr:tree show-metadata="false">
                      <fr:frontmatter>
                        <fr:authors>
                          <fr:author>
                            <fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link>
                          </fr:author>
                        </fr:authors>
                        <fr:date>
                          <fr:year>2025</fr:year>
                          <fr:month>3</fr:month>
                          <fr:day>13</fr:day>
                        </fr:date>
                        <fr:uri>https://forest.topos.site/ocl-00AK/</fr:uri>
                        <fr:display-uri>https://forest.topos.site/ocl-00AK</fr:display-uri>
                        <fr:route>/ocl-00AK/</fr:route>
                        <fr:title text="Inner-outer equality types">Inner-outer equality types</fr:title>
                      </fr:frontmatter>
                      <fr:mainmatter><html:p>In the world of generalized algebraic theories, there is a distinction between “free model” and “finitely presented model”. For instance, the free models of the theory of commutative rings are the polynomial rings <fr:tex display="inline"><![CDATA[\mathbb {Z}[x_1,\ldots ,x_n]]]></fr:tex>, while the finitely presented models are quotients of polynomial rings <fr:tex display="inline"><![CDATA[\mathbb {Z}[x_1,\ldots ,x_n]/I]]></fr:tex>. Often it is the case that deciding equality between two terms in a free model is significantly easier than deciding equality between two terms in a finitely presented model; sometimes it can even be undecidable in the finitely presented case, which happens with the theory of groups. This distinction was introduced to us in conversation with Nathan Corbyn.</html:p><html:p>When we simply import equality types into the inner level, then the contexts that we can write down with only inner types include equalities. Thus, these contexts correspond to finitely-presented models. In this 2-theory, we internalize the equality of inner terms as an outer type, which allows us to still handle equalities type theoretically, but while maintaining the property that a “purely inner” context extension may not introduce any more equalities.</html:p><html:p>We end up choosing to still use “inner-inner” equality types in our implementation, because they are well-handled by e-graphs, but in a different algorithmic setting we imagine the inner-outer equality types being useful for controlling where we expect equalities to happen.</html:p><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link></fr:author></fr:authors><fr:date><fr:year>2025</fr:year><fr:month>3</fr:month><fr:day>13</fr:day></fr:date><fr:uri>https://forest.topos.site/ocl-00AL/</fr:uri><fr:display-uri>https://forest.topos.site/ocl-00AL</fr:display-uri><fr:route>/ocl-00AL/</fr:route><fr:title text="Formation for inner-outer equality types">Formation for inner-outer equality types</fr:title><fr:taxon>rule</fr:taxon></fr:frontmatter><fr:mainmatter>
<fr:resource hash="a9722290d2b0cf2fca4e0880df240d93"><fr:resource-content><html:img src="https://forest.topos.site/a9722290d2b0cf2fca4e0880df240d93.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[\usepackage {mathpartir, amssymb, amsmath, mathtools}]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[
\begin {mathpar}
\inferrule {\Gamma  \,\vdash \, a, a' \mathpunct {\,{\raisebox {-0.03em}{${\scriptscriptstyle  \bullet }$}} \mathllap {\raisebox {0.28em}{${\scriptscriptstyle  \bullet }$}}\,} A}{\Gamma  \,\vdash \, a =\hspace {-0.2em} =_A a' \,\,\mathsf {type}^{\circ }}

\end {mathpar}
]]></fr:resource-source></fr:resource>
</fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link></fr:author></fr:authors><fr:date><fr:year>2025</fr:year><fr:month>3</fr:month><fr:day>13</fr:day></fr:date><fr:uri>https://forest.topos.site/ocl-00AM/</fr:uri><fr:display-uri>https://forest.topos.site/ocl-00AM</fr:display-uri><fr:route>/ocl-00AM/</fr:route><fr:title text="Introduction and elimination for inner-outer equality types">Introduction and elimination for inner-outer equality types</fr:title><fr:taxon>rule</fr:taxon></fr:frontmatter><fr:mainmatter>
<fr:resource hash="78afe62ab1a352e9d3c1155cc433434a"><fr:resource-content><html:img src="https://forest.topos.site/78afe62ab1a352e9d3c1155cc433434a.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[\usepackage {mathpartir, amssymb, amsmath, mathtools}]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[
\begin {mathpar}
\inferrule {\Gamma  \,\vdash \, a = a' \mathpunct {\,{\raisebox {-0.03em}{${\scriptscriptstyle  \bullet }$}} \mathllap {\raisebox {0.28em}{${\scriptscriptstyle  \bullet }$}}\,} A}{\Gamma  \,\vdash \, \mathtt {refl} \mathpunct {\,{\raisebox {-0.03em}{${\scriptscriptstyle  \circ }$}} \mathllap {\raisebox {0.28em}{${\scriptscriptstyle  \circ }$}}\,} a =\hspace {-0.2em} =_A a'} \and 
\inferrule {\Gamma  \,\vdash \, e \mathpunct {\,{\raisebox {-0.03em}{${\scriptscriptstyle  \circ }$}} \mathllap {\raisebox {0.28em}{${\scriptscriptstyle  \circ }$}}\,} a =\hspace {-0.2em} =_A a'}{\Gamma  \,\vdash \, a = a' \mathpunct {\,{\raisebox {-0.03em}{${\scriptscriptstyle  \bullet }$}} \mathllap {\raisebox {0.28em}{${\scriptscriptstyle  \bullet }$}}\,} A}

\end {mathpar}
]]></fr:resource-source></fr:resource>
</fr:mainmatter></fr:tree><fr:tree show-metadata="false"><fr:frontmatter><fr:authors><fr:author><fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link></fr:author></fr:authors><fr:date><fr:year>2025</fr:year><fr:month>3</fr:month><fr:day>13</fr:day></fr:date><fr:uri>https://forest.topos.site/ocl-00AN/</fr:uri><fr:display-uri>https://forest.topos.site/ocl-00AN</fr:display-uri><fr:route>/ocl-00AN/</fr:route><fr:title text="Beta and eta for inner-outer equality types">Beta and eta for inner-outer equality types</fr:title><fr:taxon>rule</fr:taxon></fr:frontmatter><fr:mainmatter>
<fr:resource hash="848d8437b50f34482bac96de1bfd2619"><fr:resource-content><html:img src="https://forest.topos.site/848d8437b50f34482bac96de1bfd2619.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[\usepackage {mathpartir, amssymb, amsmath, mathtools}]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[
\begin {mathpar}
\inferrule {\Gamma  \,\vdash \, e \mathpunct {\,{\raisebox {-0.03em}{${\scriptscriptstyle  \circ }$}} \mathllap {\raisebox {0.28em}{${\scriptscriptstyle  \circ }$}}\,} a =\hspace {-0.2em} =_A a'}{\Gamma  \,\vdash \, \mathtt {refl} = e \mathpunct {\,{\raisebox {-0.03em}{${\scriptscriptstyle  \circ }$}} \mathllap {\raisebox {0.28em}{${\scriptscriptstyle  \circ }$}}\,} a =\hspace {-0.2em} =_A a'}

\end {mathpar}
]]></fr:resource-source></fr:resource>
<html:p>Just like in <fr:link href="/ocl-0081/" title="Extensional equality types" uri="https://forest.topos.site/ocl-0081/" display-uri="https://forest.topos.site/ocl-0081" type="local">§ <fr:contextual-number uri="https://forest.topos.site/ocl-0081/" display-uri="https://forest.topos.site/ocl-0081" /></fr:link>, there is no beta rule because we already assume that judgmental equality is contractible.</html:p></fr:mainmatter></fr:tree><html:p>The semantics for inner-outer equality types is the existence of the following pullback square.</html:p>



<html:figure><fr:resource hash="aa1da3c89e0e09ebabb9078ab15657a9"><fr:resource-content><html:img src="https://forest.topos.site/aa1da3c89e0e09ebabb9078ab15657a9.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[

\usepackage[utf8]{inputenc}
\DeclareFontFamily{U}{min}{}
\DeclareFontShape{U}{min}{m}{n}{<-> udmj30}{}
\newcommand\yo{\!\text{\usefont{U}{min}{m}{n}\symbol{'207}}\!}
\DeclareUnicodeCharacter{3088}{\yo}


\usepackage{tikz, tikz-cd, mathtools, amssymb, stmaryrd,xcolor}
\usetikzlibrary{matrix,arrows}
\usetikzlibrary{backgrounds,fit,positioning,calc,shapes}
\usetikzlibrary{decorations.pathreplacing}
\usetikzlibrary{decorations.pathmorphing}
\usetikzlibrary{decorations.markings}

% `tikz-cd` is necessary to draw commutative diagrams.
\RequirePackage{tikz-cd}
% `amssymb` is necessary for `\lrcorner` and `\ulcorner`.
\RequirePackage{amssymb}
% `calc` is necessary to draw curved arrows.
\usetikzlibrary{calc}
% `pathmorphing` is necessary to draw squiggly arrows.
\usetikzlibrary{decorations.pathmorphing}
% `spath3` is necessary to draw shortened edges.
\usetikzlibrary{spath3}

% A TikZ style for curved arrows of a fixed height, due to AndréC.
\tikzset{curve/.style={settings={#1},to path={(\tikztostart)
    .. controls ($(\tikztostart)!\pv{pos}!(\tikztotarget)!\pv{height}!270:(\tikztotarget)$)
    and ($(\tikztostart)!1-\pv{pos}!(\tikztotarget)!\pv{height}!270:(\tikztotarget)$)
    .. (\tikztotarget)\tikztonodes}},
    settings/.code={\tikzset{quiver/.cd,#1}
        \def\pv##1{\pgfkeysvalueof{/tikz/quiver/##1}}},
    quiver/.cd,pos/.initial=0.35,height/.initial=0}

% A TikZ style for shortening paths without the poor behaviour of `shorten <' and `shorten >'.
\tikzset{between/.style n args={2}{/tikz/spath/at end path construction={
    \tikzset{spath/split at keep middle={current}{#1}{#2}}
}}}

% TikZ arrowhead/tail styles.
\tikzset{tail reversed/.code={\pgfsetarrowsstart{tikzcd to}}}
\tikzset{2tail/.code={\pgfsetarrowsstart{Implies[reversed]}}}
\tikzset{2tail reversed/.code={\pgfsetarrowsstart{Implies}}}
% TikZ arrow styles.
\tikzset{no body/.style={/tikz/dash pattern=on 0 off 1mm}}


\newcommand{\triplecolon}{%
  \mathrel{\vbox{\baselineskip=2pt \hbox{.}\hbox{.}\hbox{.}}}%
}

\DeclareUnicodeCharacter{2AF6}{\triplecolon}
\usepackage{mathpartir}

]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[
\begin {tikzcd}
	{\mathsf {Tm}^{\scriptscriptstyle  \bullet }} & {\mathsf {Tm}^{\scriptscriptstyle  \circ }} \\
	{{\mathsf {Tm}^{\scriptscriptstyle  \bullet }} \times _{\mathsf {Ty}^{\scriptscriptstyle  \bullet }} {\mathsf {Tm}^{\scriptscriptstyle  \bullet }}} & {\mathsf {Ty}^{\scriptscriptstyle  \circ }}
	\arrow ["\mathtt {refl}", from=1-1, to=1-2]
	\arrow ["\Delta "', from=1-1, to=2-1]
	\arrow ["{\mathsf {u}^{\scriptscriptstyle  \circ }}", from=1-2, to=2-2]
	\arrow ["=\hspace {-0.2em} ="', from=2-1, to=2-2]
\end {tikzcd}
]]></fr:resource-source></fr:resource></html:figure>

</fr:mainmatter>
                    </fr:tree>
                  </fr:mainmatter>
                </fr:tree>
                <fr:tree show-metadata="false">
                  <fr:frontmatter>
                    <fr:authors>
                      <fr:author>
                        <fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link>
                      </fr:author>
                    </fr:authors>
                    <fr:date>
                      <fr:year>2025</fr:year>
                      <fr:month>3</fr:month>
                      <fr:day>13</fr:day>
                    </fr:date>
                    <fr:uri>https://forest.topos.site/ocl-00AO/</fr:uri>
                    <fr:display-uri>https://forest.topos.site/ocl-00AO</fr:display-uri>
                    <fr:route>/ocl-00AO/</fr:route>
                    <fr:title text="Element Model Type Theory as a 2-theory">Element Model Type Theory as a 2-theory</fr:title>
                  </fr:frontmatter>
                  <fr:mainmatter>
                    <html:p>The type theory we have implemented to accompany this paper we call “Element Model Type Theory”. This is because it is a two-level type theory, where:</html:p>
                    <html:ul><html:li>The inner terms are called elements</html:li>
  <html:li>The outer terms are called models</html:li>
  <html:li>The inner types are called types</html:li>
  <html:li>The outer types are called theories</html:li></html:ul>
                    <html:p>The intended semantics for EMTT is that general contexts (involving inner and outer types) correspond to finite limit theories, and the category of purely-inner context extensions of a fixed context is the category of contexts for the finite limit theory presented by that fixed context. We discuss precisely how this works in <fr:link href="/ocl-0076/" title="EMTT: an implementation of finite limit theories" uri="https://forest.topos.site/ocl-0076/" display-uri="https://forest.topos.site/ocl-0076" type="local">§ <fr:contextual-number uri="https://forest.topos.site/ocl-0076/" display-uri="https://forest.topos.site/ocl-0076" /></fr:link>.</html:p>
                    <html:p>With the machinery that we have developed for describing 2-theories in two-level type theory, we can succinctly describe EMTT as being the composite of the following 2-theories.</html:p>
                    <html:ul><html:li>Inclusion of inner types into outer types, <fr:link href="/ocl-00A1/" title="Inclusion of inner types into outer types" uri="https://forest.topos.site/ocl-00A1/" display-uri="https://forest.topos.site/ocl-00A1" type="local">§ <fr:contextual-number uri="https://forest.topos.site/ocl-00A1/" display-uri="https://forest.topos.site/ocl-00A1" /></fr:link></html:li>
  <html:li>Inner universe as outer type, <fr:link href="/ocl-00AG/" title="Inner universe as outer type" uri="https://forest.topos.site/ocl-00AG/" display-uri="https://forest.topos.site/ocl-00AG" type="local">§ <fr:contextual-number uri="https://forest.topos.site/ocl-00AG/" display-uri="https://forest.topos.site/ocl-00AG" /></fr:link></html:li>
  <html:li>Inner-inner-inner sigma types, <fr:link href="/ocl-0085/" title="Single-level 2-theories" uri="https://forest.topos.site/ocl-0085/" display-uri="https://forest.topos.site/ocl-0085" type="local">§ <fr:contextual-number uri="https://forest.topos.site/ocl-0085/" display-uri="https://forest.topos.site/ocl-0085" /></fr:link></html:li>
  <html:li>Outer-outer-outer sigma types, <fr:link href="/ocl-0085/" title="Single-level 2-theories" uri="https://forest.topos.site/ocl-0085/" display-uri="https://forest.topos.site/ocl-0085" type="local">§ <fr:contextual-number uri="https://forest.topos.site/ocl-0085/" display-uri="https://forest.topos.site/ocl-0085" /></fr:link></html:li>
  <html:li>Inner-outer-outer pi types, <fr:link href="/ocl-00AB/" title="Inner-inner-outer pi types" uri="https://forest.topos.site/ocl-00AB/" display-uri="https://forest.topos.site/ocl-00AB" type="local">§ <fr:contextual-number uri="https://forest.topos.site/ocl-00AB/" display-uri="https://forest.topos.site/ocl-00AB" /></fr:link></html:li>
  <html:li>Inner-inner equality types, <fr:link href="/ocl-0085/" title="Single-level 2-theories" uri="https://forest.topos.site/ocl-0085/" display-uri="https://forest.topos.site/ocl-0085" type="local">§ <fr:contextual-number uri="https://forest.topos.site/ocl-0085/" display-uri="https://forest.topos.site/ocl-0085" /></fr:link></html:li></html:ul>
                  </fr:mainmatter>
                </fr:tree>
              </fr:mainmatter>
            </fr:tree>
          </fr:mainmatter>
        </fr:tree>
      </fr:mainmatter>
    </fr:tree>
    <fr:tree show-metadata="false">
      <fr:frontmatter>
        <fr:authors>
          <fr:contributor>
            <fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link>
          </fr:contributor>
        </fr:authors>
        <fr:date>
          <fr:year>2025</fr:year>
          <fr:month>2</fr:month>
          <fr:day>28</fr:day>
        </fr:date>
        <fr:uri>https://forest.topos.site/ocl-0076/</fr:uri>
        <fr:display-uri>https://forest.topos.site/ocl-0076</fr:display-uri>
        <fr:route>/ocl-0076/</fr:route>
        <fr:title text="EMTT: an implementation of finite limit theories">EMTT: an implementation of finite limit theories</fr:title>
      </fr:frontmatter>
      <fr:mainmatter>
        <html:p>We gave the official type theory for EMTT in <fr:link href="/ocl-00AO/" title="Element Model Type Theory as a 2-theory" uri="https://forest.topos.site/ocl-00AO/" display-uri="https://forest.topos.site/ocl-00AO" type="local">§ <fr:contextual-number uri="https://forest.topos.site/ocl-00AO/" display-uri="https://forest.topos.site/ocl-00AO" /></fr:link>, where we showed that it was one of a large family of two-level type theories which could be built out of the basic 2-theories in two-level type theory that we gave. In this section we go into more depth about EMTT in particular.</html:p>
        <html:p>We start in <fr:link href="/ocl-007I/" title="An introduction to EMTT by examples" uri="https://forest.topos.site/ocl-007I/" display-uri="https://forest.topos.site/ocl-007I" type="local">§ <fr:contextual-number uri="https://forest.topos.site/ocl-007I/" display-uri="https://forest.topos.site/ocl-007I" /></fr:link> by showing off a variety of examples of EMTT code that actually type-checks, which also displays the various uses to which EMTT can be put. We then give the entire type theory for EMTT again in <fr:link href="/ocl-007J/" title="Type theory of EMTT" uri="https://forest.topos.site/ocl-007J/" display-uri="https://forest.topos.site/ocl-007J" type="local">§ <fr:contextual-number uri="https://forest.topos.site/ocl-007J/" display-uri="https://forest.topos.site/ocl-007J" /></fr:link>, using syntax more similar to the actual syntax we use in the implementation, as a reference. In <fr:link href="/ocl-00BG/" title="A model for EMTT in lex categories" uri="https://forest.topos.site/ocl-00BG/" display-uri="https://forest.topos.site/ocl-00BG" type="local">§ <fr:contextual-number uri="https://forest.topos.site/ocl-00BG/" display-uri="https://forest.topos.site/ocl-00BG" /></fr:link>, we give a formal account of the way in which outer types in EMTT are theories. Finally, in <fr:link href="/ocl-007H/" title="Adapting Coquand's algorithm to the two-level setting" uri="https://forest.topos.site/ocl-007H/" display-uri="https://forest.topos.site/ocl-007H" type="local">§ <fr:contextual-number uri="https://forest.topos.site/ocl-007H/" display-uri="https://forest.topos.site/ocl-007H" /></fr:link> and <fr:link href="/ocl-007G/" title="Integrating e-graphs into normalization-by-evaluation" uri="https://forest.topos.site/ocl-007G/" display-uri="https://forest.topos.site/ocl-007G" type="local">§ <fr:contextual-number uri="https://forest.topos.site/ocl-007G/" display-uri="https://forest.topos.site/ocl-007G" /></fr:link> we discuss some algorithmic aspects of the elaborator for EMTT, which is a modification of Coquand's algorithm for elaboration via normalization-by-evaluation to support two-level type theory and a limited form of extensional equality.</html:p>
        <fr:tree show-metadata="false">
          <fr:frontmatter>
            <fr:authors>
              <fr:contributor>
                <fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link>
              </fr:contributor>
            </fr:authors>
            <fr:date>
              <fr:year>2025</fr:year>
              <fr:month>2</fr:month>
              <fr:day>28</fr:day>
            </fr:date>
            <fr:uri>https://forest.topos.site/ocl-007I/</fr:uri>
            <fr:display-uri>https://forest.topos.site/ocl-007I</fr:display-uri>
            <fr:route>/ocl-007I/</fr:route>
            <fr:title text="An introduction to EMTT by examples">An introduction to EMTT by examples</fr:title>
          </fr:frontmatter>
          <fr:mainmatter>
            <html:p>In this section, we give an overview of the implemented version of EMTT. In <fr:link href="/ocl-0075/" title="Type theory as organized into 3-theories" uri="https://forest.topos.site/ocl-0075/" display-uri="https://forest.topos.site/ocl-0075" type="local">§ <fr:contextual-number uri="https://forest.topos.site/ocl-0075/" display-uri="https://forest.topos.site/ocl-0075" /></fr:link> we have attempted to present two-level type theory in generality with maximum clarity, and thus we stuck to familiar syntax and binary versions of type formers (e.g. sigma types instead of dependent records, single-argument pi types). However, in the actual implementation we have used a slightly non-standard syntax, for a variety of reasons including ease of implementation.</html:p>
            <fr:tree show-metadata="false">
              <fr:frontmatter>
                <fr:authors>
                  <fr:author>
                    <fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link>
                  </fr:author>
                </fr:authors>
                <fr:date>
                  <fr:year>2025</fr:year>
                  <fr:month>3</fr:month>
                  <fr:day>13</fr:day>
                </fr:date>
                <fr:uri>https://forest.topos.site/ocl-00AP/</fr:uri>
                <fr:display-uri>https://forest.topos.site/ocl-00AP</fr:display-uri>
                <fr:route>/ocl-00AP/</fr:route>
                <fr:title text="The theory of graphs">The theory of graphs</fr:title>
                <fr:taxon>example</fr:taxon>
              </fr:frontmatter>
              <fr:mainmatter>
                <html:p>We will present the theory of graphs in two ways. The first way is in “algebraic theory” style, where <html:code>E</html:code> is a non-dependent type and we have functions <html:code>src</html:code> and <html:code>tgt</html:code>.</html:p>
                <html:pre><![CDATA[ThAlgGraph: @theory = {
  V: @type;
  E: @type;
  src: [e: E] -> V;
  tgt: [e: E] -> V;
};]]></html:pre>
                <html:p>The first part, <html:code>ThAlgGraph: @theory</html:code>, says that <html:code>ThAlgGraph</html:code> will refer to a derivation of a theory (outer type) judgment in the empty context (the empty context is indicated by the lack of square brackets after <html:code>ThAlgGraph</html:code>).</html:p>
                <html:p>The second part after the equals sign is the syntax for a dependent record with four fields (which we might call an outer sigma type). Each of these fields has its own theory (outer type).</html:p>
                <html:p>For instance, the theory for <html:code>V</html:code> is <html:code>@type</html:code>, which is our name for the inner universe that we called <fr:tex display="inline"><![CDATA[{U^{{\scriptscriptstyle  \bullet }}}]]></fr:tex> before.</html:p>
                <html:p>The theory for <html:code>src</html:code> is <html:code>[e: E] -&gt; V</html:code>, which is an inner-outer-outer pi type, or as we call it in EMTT, a <html:strong>pi theory</html:strong>. Note that there are two implicit coercions going on to interpret <html:code>V</html:code> as a theory (which it needs to be in order to be the codomain of a pi theory). First, there is the coercion from <html:code>V</html:code> as a model (outer term) of the theory (outer type) <html:code>@type</html:code> to <html:code>V</html:code> as an type (inner type); we would write this coercion as <fr:tex display="inline"><![CDATA[\mathrm {El}(V)]]></fr:tex> using the notation of <fr:link href="/ocl-00AG/" title="Inner universe as outer type" uri="https://forest.topos.site/ocl-00AG/" display-uri="https://forest.topos.site/ocl-00AG" type="local">§ <fr:contextual-number uri="https://forest.topos.site/ocl-00AG/" display-uri="https://forest.topos.site/ocl-00AG" /></fr:link>. Then there is the coercion from <html:code>V</html:code> as a type (inner type) to <html:code>V</html:code> as a theory (outer type); we would write this as <fr:tex display="inline"><![CDATA[\circ  \mathrm {El}(V)]]></fr:tex> using the notation of <fr:link href="/ocl-00A1/" title="Inclusion of inner types into outer types" uri="https://forest.topos.site/ocl-00A1/" display-uri="https://forest.topos.site/ocl-00A1" type="local">§ <fr:contextual-number uri="https://forest.topos.site/ocl-00A1/" display-uri="https://forest.topos.site/ocl-00A1" /></fr:link>. Thus, in the notation we had before, the full pi theory would be given as <fr:tex display="inline"><![CDATA[(e \mathpunct {\,{\raisebox {-0.03em}{${\scriptscriptstyle  \bullet }$}} \mathllap {\raisebox {0.28em}{${\scriptscriptstyle  \bullet }$}}\,} E) \to  \circ  \mathrm {El}(V)]]></fr:tex>.</html:p>
                <html:p>The second presentation we have for the theory of graphs is the following.</html:p>
                <html:pre><![CDATA[ThDepGraph: @theory = {
  V: @type;
  E: [src: V, tgt: V] -> @type;
};]]></html:pre>
                <html:p>The first part of this, <html:code>ThDepGraph: @theory</html:code>, is just as before but with a different name.</html:p>
                <html:p>But in the body, instead of having two functions out of <html:code>E</html:code>, <html:code>E</html:code> is a pi theory with codomain <html:code>@type</html:code>, or in other words a type dependent on two elements of <html:code>V</html:code>.</html:p>
                <html:p>We can then convert between graphs in each style with the following code.</html:p>
                <html:pre><![CDATA[Dep2Alg[G: ThDepGraph]: ThAlgGraph = {
  V = G.V;
  E = {
    src: V;
    tgt: V;
    e: G.E[src, tgt]
  };
  src = [e] ↦ e.src;
  tgt = [e] ↦ e.tgt;
};

Alg2Dep[G: ThAlgGraph]: ThDepGraph = {
  V = G.V;
  E = [src, tgt] ↦ {
    e: G.E;
    _: G.src[e] == src;
    _: G.tgt[e] == tgt;
  };
}]]></html:pre>
                <html:p>The first line, <html:code>Dep2Alg[G: ThDepGraph]: ThAlgGraph</html:code> says that <html:code>Dep2Alg</html:code> refers to a derivation of a model of the theory  <html:code>ThAlgGraph</html:code> in the context of a model <html:code>G</html:code> of the theory <html:code>ThDepGraph</html:code>.</html:p>
                <html:p>Then the body of the <html:code>Dep2Alg</html:code> declaration uses the introduction rule for dependent record theories to produce a model of <html:code>ThAlgGraph</html:code> given by assigning each field to a model of the appropriate theory.</html:p>
                <html:p>For instance, in the line <html:code>V = G.V</html:code>, we assign the field <html:code>V</html:code> to the model <html:code>G.V</html:code> of the theory <html:code>@type</html:code>, which is the correct theory because that is the theory that we declared the field <html:code>V</html:code> to be of in <html:code>ThAlgGraph</html:code>. And <html:code>G.V</html:code> is a model of the theory <html:code>@type</html:code> because of the elimination rule for dependent record theories allows us to do a field projection from <html:code>G</html:code> (a model of <html:code>ThDepGraph</html:code>).</html:p>
                <html:p>In the next part, where we assign the field <html:code>E</html:code>, we use an <html:em>inner</html:em> sigma type, or as we say in EMTT, a dependent record <html:em>type</html:em> (as opposed to theory). This implicitly uses the coercion from derivations of the type judgment to models of the theory <html:code>@type</html:code>, which we called <fr:tex display="inline"><![CDATA[[-]]]></fr:tex> in <fr:link href="/ocl-00AG/" title="Inner universe as outer type" uri="https://forest.topos.site/ocl-00AG/" display-uri="https://forest.topos.site/ocl-00AG" type="local">§ <fr:contextual-number uri="https://forest.topos.site/ocl-00AG/" display-uri="https://forest.topos.site/ocl-00AG" /></fr:link>. This dependent type contains two vertices and an edge between them.</html:p>
                <html:p>Finally, we can define the <html:code>src</html:code> and <html:code>tgt</html:code> functions by projecting out of the record type that we assigned to <html:code>E</html:code>.</html:p>
                <html:p>In <html:code>Alg2Dep</html:code>, the only somewhat new part is the definition for <html:code>E</html:code>. Here, we define a model of the pi theory <html:code>[src: V, tgt: V] -&gt; @type</html:code> via a lambda abstraction <html:code>[src, tgt] ↦ ...</html:code> and then a dependent record type. The dependent record type has one field of type <fr:tex display="inline"><![CDATA[G.E]]></fr:tex>, and then two fields which store proofs that the source and target of the first field are <html:code>src</html:code> and <html:code>tgt</html:code> respectively, which use equality types. We leave the latter two fields unnamed, because we will not need to use them explicitly (we learn more about how this works in <fr:link href="/ocl-007G/" title="Integrating e-graphs into normalization-by-evaluation" uri="https://forest.topos.site/ocl-007G/" display-uri="https://forest.topos.site/ocl-007G" type="local">§ <fr:contextual-number uri="https://forest.topos.site/ocl-007G/" display-uri="https://forest.topos.site/ocl-007G" /></fr:link>).</html:p>
              </fr:mainmatter>
            </fr:tree>
            <fr:tree show-metadata="false">
              <fr:frontmatter>
                <fr:authors>
                  <fr:author>
                    <fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link>
                  </fr:author>
                </fr:authors>
                <fr:date>
                  <fr:year>2025</fr:year>
                  <fr:month>3</fr:month>
                  <fr:day>13</fr:day>
                </fr:date>
                <fr:uri>https://forest.topos.site/ocl-00AQ/</fr:uri>
                <fr:display-uri>https://forest.topos.site/ocl-00AQ</fr:display-uri>
                <fr:route>/ocl-00AQ/</fr:route>
                <fr:title text="The theory of rings, compositionally">The theory of rings, compositionally</fr:title>
                <fr:taxon>example</fr:taxon>
              </fr:frontmatter>
              <fr:mainmatter>
                <html:p>In this example, we show how to build up the theory of rings compositionally. This is quite similar to the way that rings would be defined in a full dependent type theory, but notice how it works very naturally with the type/theory distinction and does not require a full dependent type theory.</html:p>
                <html:p>We start with the theory of a monoid structure on a type.</html:p>
                <html:pre><![CDATA[ThMonoidOn[t: @type]: @theory = {
  op: [x: t, y: t] -> t;
  unit: t;
  lident: [x: t] -> op[unit, x] == x;
  rident: [x: t] -> op[x, unit] == x;
  assoc: [x: t, y: t, z: t] -> op[op[x, y], z] == op[x, op[y, z]];
};]]></html:pre>
                <html:p>Again, this binds <html:code>ThMonoidOn</html:code> to a derivation of a theory in the context of a model <html:code>t</html:code> of the theory <html:code>@type</html:code>. The body of this theory is a dependent record theory with five fields, which respectively model:</html:p>
                <html:ul><html:li>The monoid operation</html:li>
  <html:li>The unit</html:li>
  <html:li>The left identity law for the unit</html:li>
  <html:li>The right identity law for the unit</html:li>
  <html:li>The associativity law for the monoid operation</html:li></html:ul>
                <html:p>All of the theories of these fields are pi theories, with the exception of <html:code>unit</html:code> which uses the implicit coercion from types to theories to turn <html:code>t</html:code> into a theory.</html:p>
                <html:p>We can then layer the theory for an abelian group on top of this.</html:p>
                <html:pre><![CDATA[ThAbelianGroupOn[t: @type]: @theory = {
  m: ThMonoidOn[t];
  inv: [x: t] -> {
    elt: t;
    _: m.op[x, elt] == m.unit;
  };
  comm: [x: t, y: t] -> m.op[x, y] == m.op[y, x];
};]]></html:pre>
                <html:p>This shows off in multiple ways how it is useful to have a real type theory when forming finite limit theories. For instance, we see that a field does not have to be a type constructor, term constructor, or axiom, it can also be a previously defined theory. Also, we see that we can specify the codomain of <html:code>inv</html:code> to be the type of inverses of <html:code>x</html:code> (specified as a dependent record type).</html:p>
                <html:p>Then a ring consists of an abelian group and a monoid on the same type, along with a distributive law between them.</html:p>
                <html:pre><![CDATA[ThRingOn[t: @type]: @theory = {
  plus: ThAbelianGroupOn[t];
  times: ThMonoidOn[t];

  dist: [x: t, y: t, z: t] ->
   times.op[x, plus.m.op[y, z]] ==
    plus.m.op[times.op[x, y], times.op[x, z]];
};]]></html:pre>
                <html:p>Ideally, we would have some support for “opening” a dependent record so that its fields were in scope, possibly renaming them in the process, so that we could write <html:code>x * (y + z) == (x * y) + (x * z)</html:code> instead of the actual code for <html:code>dist</html:code>, but this syntax at least makes it quite clear what is going on.</html:p>
                <html:p>We can finish by producing the theory of a ring, rather than a ring on a type:</html:p>
                <html:pre><![CDATA[ThRing: @theory = {
  t: @type;
  r: ThRingOn[t];
};]]></html:pre>
              </fr:mainmatter>
            </fr:tree>
            <fr:tree show-metadata="false">
              <fr:frontmatter>
                <fr:authors>
                  <fr:author>
                    <fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link>
                  </fr:author>
                </fr:authors>
                <fr:date>
                  <fr:year>2025</fr:year>
                  <fr:month>3</fr:month>
                  <fr:day>13</fr:day>
                </fr:date>
                <fr:uri>https://forest.topos.site/ocl-00AR/</fr:uri>
                <fr:display-uri>https://forest.topos.site/ocl-00AR</fr:display-uri>
                <fr:route>/ocl-00AR/</fr:route>
                <fr:title text="Lens-based systems theory">Lens-based systems theory</fr:title>
                <fr:taxon>example</fr:taxon>
              </fr:frontmatter>
              <fr:mainmatter>
                <html:p>We can do a fair bit of lens-based systems theory in EMTT, following chapter 1 of <fr:link href="/myers-2021-book/" title="Categorical Systems Theory" uri="https://forest.topos.site/myers-2021-book/" display-uri="https://forest.topos.site/myers-2021-book" type="local">Reference <fr:contextual-number uri="https://forest.topos.site/myers-2021-book/" display-uri="https://forest.topos.site/myers-2021-book" /></fr:link>. The following definitions could be instead given in Agda or Lean, but doing them in EMTT instead has certain advantages. First of all, the base and fiber in an arena are <html:em>types</html:em> not theories. This means that we don't have to worry about universes or function types showing up in the state spaces of our dynamical systems.</html:p>
                <html:p>In fact, in base EMTT the <html:em>only</html:em> type that one can write down in the empty context is the unit type. However, if we gave ourselves a primitive ring object <fr:tex display="inline"><![CDATA[R]]></fr:tex>, then types that we could write down in the empty context correspond to sub-objects of <fr:tex display="inline"><![CDATA[R^n]]></fr:tex> specified by algebraic equations, which are finite-dimensional geometric objects appropriate for serving as the state space of a dynamical system.</html:p>
                <html:p>If we went even simpler, and only gave ourselves a primitive type with no operations <fr:tex display="inline"><![CDATA[X]]></fr:tex>, then types we could write down in the empty context correspond to finite sets, and then lenses correspond to wiring diagrams.</html:p>
                <html:p>The point is, the EMTT setup gives us the flexibility to narrowly restrict what a type is, while still allowing abstraction in the form of theories.</html:p>
                <html:p>Without further ado, we present the theories for lens-based system theory, starting with the theory of a dependent arena.</html:p>
                <html:pre><![CDATA[Arena: @theory = {
  base: @type;
  fiber: [x: base] -> @type;
};]]></html:pre>
                <html:p>We can then give a definition of lens between two arenas, which is given by forward and backwards maps.</html:p>
                <html:pre><![CDATA[Lens[A: Arena, B: Arena]: @theory = {
  fwd: [x: A.base] -> B.base;
  bwd: [x: A.base, y: B.fiber[fwd[x]]] -> A.fiber[x];
};]]></html:pre>
                <html:p>We can use these to give a definition of lens composition.</html:p>
                <html:pre><![CDATA[compose[
  A: Arena, B: Arena, C: Arena,
  f: Lens[A, B], g: Lens[B, C]
]: Lens[A, C] = {
  fwd = [x] ↦ g.fwd[f.fwd[x]];
  bwd = [x, y] ↦ f.bwd[x, g.bwd[f.fwd[x], y]];
};]]></html:pre>
                <html:p>We can write down systems if we give a definition of tangent bundle. For now we use the “discrete tangent” (which is appropriate for modeling discrete-time systems).</html:p>
                <html:pre><![CDATA[Tangent[X: @type]: Arena = {
  base = X;
  fiber = [_] ↦ X;
};]]></html:pre>
                <html:p>Then a system on an arena can be given as</html:p>
                <html:pre><![CDATA[System[A: Arena]: @theory = {
  state: @type;
  dynamics: Lens[Tangent[state], A];
};]]></html:pre>
                <html:p>Such a system is a dependent Moore machine with interface <html:code>A</html:code>. Thus, such a system is already “open” in one way. But another way in which a system could be open is for the system have “holes” into which one is expected to plug other systems. This is the case for a wiring diagram, for instance. Such an “incomplete” system may be expressed as a “system in the context of other systems”, such as the following (where <html:code>A</html:code>, <html:code>B</html:code>, <html:code>C</html:code> are some fixed arenas):</html:p>
                <html:pre><![CDATA[SomeWiringDiagram[X: System[A], Y: System[B]]: System[C] = ...;]]></html:pre>
                <html:p>Filling in the <html:code>...</html:code> directly is slightly painful, but the point is that this type theory has a place for such “higher-order” systems, the syntax for which could be derived from either a DSL or an actual graphical wiring diagram editor.</html:p>
              </fr:mainmatter>
            </fr:tree>
          </fr:mainmatter>
        </fr:tree>
        <fr:tree show-metadata="false">
          <fr:frontmatter>
            <fr:authors>
              <fr:contributor>
                <fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link>
              </fr:contributor>
            </fr:authors>
            <fr:date>
              <fr:year>2025</fr:year>
              <fr:month>2</fr:month>
              <fr:day>28</fr:day>
            </fr:date>
            <fr:uri>https://forest.topos.site/ocl-007J/</fr:uri>
            <fr:display-uri>https://forest.topos.site/ocl-007J</fr:display-uri>
            <fr:route>/ocl-007J/</fr:route>
            <fr:title text="Type theory of EMTT">Type theory of EMTT</fr:title>
          </fr:frontmatter>
          <fr:mainmatter>
            <fr:tree show-metadata="false">
              <fr:frontmatter>
                <fr:authors>
                  <fr:author>
                    <fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link>
                  </fr:author>
                </fr:authors>
                <fr:date>
                  <fr:year>2025</fr:year>
                  <fr:month>1</fr:month>
                  <fr:day>31</fr:day>
                </fr:date>
                <fr:uri>https://forest.topos.site/ocl-005V/</fr:uri>
                <fr:display-uri>https://forest.topos.site/ocl-005V</fr:display-uri>
                <fr:route>/ocl-005V/</fr:route>
                <fr:title text="Rules of EMTT">Rules of EMTT</fr:title>
              </fr:frontmatter>
              <fr:mainmatter><html:p>Type is a theory.</html:p>
<fr:resource hash="8c2ec612d74047e105d36fb9d04b9e07"><fr:resource-content><html:img src="https://forest.topos.site/8c2ec612d74047e105d36fb9d04b9e07.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[\usepackage {mathpartir, amssymb, amsmath, mathtools}]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[
\begin {mathpar}

\inferrule {\phantom {-}}{\mathtt {type} \,\,\mathsf {theory}} \\
\inferrule {\Gamma  \,\vdash \, A \colon  \mathtt {type}}{\Gamma  \,\vdash \, A \,\,\mathsf {type}} \and 
\inferrule {\Gamma  \,\vdash \, A \,\,\mathsf {type}}{\Gamma  \,\vdash \, A \colon  \mathtt {type}}

\end {mathpar}
]]></fr:resource-source></fr:resource>
<html:p>Types are theories.</html:p>
<fr:resource hash="bd7fc5be1b58d4b42c625409a64c7cc1"><fr:resource-content><html:img src="https://forest.topos.site/bd7fc5be1b58d4b42c625409a64c7cc1.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[\usepackage {mathpartir, amssymb, amsmath, mathtools}]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[
\begin {mathpar}

\inferrule {\Gamma  \,\vdash \, A \,\,\mathsf {type}}{\Gamma  \,\vdash \, A \,\,\mathsf {theory}}

\end {mathpar}
]]></fr:resource-source></fr:resource>
<html:p>Pi theories.</html:p>
<fr:resource hash="8b84b759163c91af3e40a9ca305e61d5"><fr:resource-content><html:img src="https://forest.topos.site/8b84b759163c91af3e40a9ca305e61d5.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[\usepackage {mathpartir, amssymb, amsmath, mathtools}]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[
\begin {mathpar}

\inferrule {\Gamma  \,\vdash \, A \,\,\mathsf {type} \and  \Gamma , x \colon  A \,\vdash \, T \,\,\mathsf {theory}}{\Gamma  \,\vdash \, (x \colon  A) \to  T \,\,\mathsf {theory}} \\
\inferrule {\Gamma , x \colon  A \,\vdash \, M \colon  T}{\Gamma  \,\vdash \, ((x \colon  A) \mapsto  M) \colon  (x \colon  A) \to  T} \and 
\inferrule {\Gamma  \,\vdash \, f \colon  (x\colon  A) \to  T \and  \Gamma  \,\vdash \, a \colon  A}{\Gamma  \,\vdash \, f \, a \colon  T[x \backslash  a]} \\
\inferrule {\Gamma , x \colon  A \,\vdash \, M \colon  T \and  \Gamma  \,\vdash \, a \colon  A}{\Gamma  \,\vdash \, ((x \colon  A) \mapsto  M) \, a = M[x \backslash  a] \colon  T[x \backslash  a]} \\
\inferrule {\Gamma  \,\vdash \, f \colon  (x\colon  A) \to  T \and  \Gamma  \,\vdash \, a \colon  A}{\Gamma  \,\vdash \, f = (x \colon  A) \mapsto  f \, x \colon  (x \colon  A) \to  T}

\end {mathpar}
]]></fr:resource-source></fr:resource>
<html:p>Sigma theories.</html:p>
<fr:resource hash="a23f7d3f80b05cfae459462496d6923b"><fr:resource-content><html:img src="https://forest.topos.site/a23f7d3f80b05cfae459462496d6923b.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[\usepackage {mathpartir, amssymb, amsmath, mathtools}]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[
\begin {mathpar}

\inferrule {\Gamma  \,\vdash \, T \,\,\mathsf {theory} \and  \Gamma , x \colon  T \,\vdash \, S \,\,\mathsf {theory}}{\Gamma  \,\vdash \, (x \colon  T) \times  S \,\,\mathsf {theory}} \\
\inferrule {\Gamma  \,\vdash \, t \colon  T \and  \Gamma , x := t \colon  T \,\vdash \, s \colon  S}{\Gamma  \,\vdash \, (x := t, s) \colon  (x \colon  T) \times  S} \and 
\inferrule {\Gamma  \,\vdash \, p \colon  (x \colon  T) \times  S}{\Gamma  \,\vdash \, p.0 \colon  T \and  \Gamma  \,\vdash \, p.1 \colon  S[x \backslash  p.0]} \\
\cdots 

\end {mathpar}
]]></fr:resource-source></fr:resource>
<html:p>Sigma types.</html:p>
<fr:resource hash="6811b957c877059d9d4b373788cca415"><fr:resource-content><html:img src="https://forest.topos.site/6811b957c877059d9d4b373788cca415.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[\usepackage {mathpartir, amssymb, amsmath, mathtools}]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[
\begin {mathpar}

\inferrule {\Gamma  \,\vdash \, A \,\,\mathsf {type} \and  \Gamma , x \colon  A \,\vdash \, B \,\,\mathsf {type}}{\Gamma  \,\vdash \, (x \colon  A) \times  B \,\,\mathsf {type}} \\
\inferrule {\Gamma  \,\vdash \, a \colon  A \and  \Gamma , x := a \colon  A \,\vdash \, b \colon  B}{\Gamma  \,\vdash \, (x := a, b) \colon  (x \colon  A) \times  B} \and 
\inferrule {\Gamma  \,\vdash \, p \colon  (x \colon  A) \times  B}{\Gamma  \,\vdash \, p.0 \colon  A \and  \Gamma  \,\vdash \, p.1 \colon  B[x \backslash  p.0]} \\
\cdots 

\end {mathpar}
]]></fr:resource-source></fr:resource>
<html:p>Equality types.</html:p>
<fr:resource hash="d423dd4c3f1a87bbba292b2313d6a74f"><fr:resource-content><html:img src="https://forest.topos.site/d423dd4c3f1a87bbba292b2313d6a74f.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[\usepackage {mathpartir, amssymb, amsmath, mathtools}]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[
\begin {mathpar}

\inferrule {\Gamma  \,\vdash \, A \,\,\mathsf {type} \and  \Gamma  \,\vdash \, a_1 \colon  A \and  \Gamma  \,\vdash \, a_2 \colon  A}{\Gamma  \,\vdash \, a_1 =\joinrel =_A a_2 \,\,\mathsf {type}} \\
\inferrule {\Gamma  \,\vdash \, a_1 = a_2 \colon  A}{
\Gamma  \,\vdash \, \mathtt {refl} \colon  a_1 =\joinrel =_A a_2} \and 
\inferrule {e \colon  a_1 =\joinrel =_A a_2 \in  \Gamma }{\Gamma  \,\vdash \, a_1 = a_2 \colon  A}

\end {mathpar}
]]></fr:resource-source></fr:resource>
</fr:mainmatter>
            </fr:tree>
          </fr:mainmatter>
        </fr:tree>
        <fr:tree show-metadata="false">
          <fr:frontmatter>
            <fr:authors>
              <fr:author>
                <fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link>
              </fr:author>
            </fr:authors>
            <fr:date>
              <fr:year>2025</fr:year>
              <fr:month>3</fr:month>
              <fr:day>17</fr:day>
            </fr:date>
            <fr:uri>https://forest.topos.site/ocl-00BG/</fr:uri>
            <fr:display-uri>https://forest.topos.site/ocl-00BG</fr:display-uri>
            <fr:route>/ocl-00BG/</fr:route>
            <fr:title text="A model for EMTT in lex categories">A model for EMTT in lex categories</fr:title>
          </fr:frontmatter>
          <fr:mainmatter>
            <html:p>Lex is a shortening of “left exact”, which how people in homological algebra say “finite limit-preserving”. It happens that the word “lex” is much shorter than “finite limit-preserving”, so it has been taken up by the community at large. We say “lex category” to mean a category with all finite limits, and “lex functor” to mean a functor which preserves all finite limits.</html:p>
            <html:p>In this section, we discuss a model for EMTT with category of contexts given by <fr:tex display="inline"><![CDATA[\mathcal {L}\mathsf {ex}^{\mathsf {op}}]]></fr:tex>. Immediately, there are problems with this, because <fr:tex display="inline"><![CDATA[\mathcal {L}\mathsf {ex}^{\mathsf {op}}]]></fr:tex> is a 2-category, and it may be that some of our constructions only work up to equivalence rather than up to isomorphism so we may not simply work in the 1-skeleton. We conjecture that there exists a 2-equivalent category to <fr:tex display="inline"><![CDATA[\mathcal {L}\mathsf {ex}^{\mathsf {op}}]]></fr:tex> in which the constructions that we do are all defined up to the correct level of strictness, but we do not pursue the development of this 2-category.</html:p>
            <html:p>One thing to note is that in order to be slightly less confusing about duals, we will work in <fr:tex display="inline"><![CDATA[\mathcal {L}\mathsf {ex}]]></fr:tex> and consider copresheaves of types, terms, etc. rather than working in <fr:tex display="inline"><![CDATA[\mathcal {L}\mathsf {ex}^{\mathsf {op}}]]></fr:tex> and using presheaves.</html:p>
            <fr:tree show-metadata="false">
              <fr:frontmatter>
                <fr:authors>
                  <fr:author>
                    <fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link>
                  </fr:author>
                </fr:authors>
                <fr:date>
                  <fr:year>2025</fr:year>
                  <fr:month>3</fr:month>
                  <fr:day>19</fr:day>
                </fr:date>
                <fr:uri>https://forest.topos.site/ocl-00BJ/</fr:uri>
                <fr:display-uri>https://forest.topos.site/ocl-00BJ</fr:display-uri>
                <fr:route>/ocl-00BJ/</fr:route>
                <fr:title text="Contexts">Contexts</fr:title>
                <fr:taxon>interpretation</fr:taxon>
              </fr:frontmatter>
              <fr:mainmatter>
                <html:p>In order to have semantics in <fr:tex display="inline"><![CDATA[\mathcal {L}\mathsf {ex}]]></fr:tex>, we must identify contexts with lex categories, and substitutions with lex functors.</html:p>
                <html:p>The intution for this is that a context <fr:tex display="inline"><![CDATA[\Gamma ]]></fr:tex> is sent to the category of <html:em>inner extensions</html:em> of <fr:tex display="inline"><![CDATA[\Gamma ]]></fr:tex>; that is, an object is a <html:em>inner type telescope</html:em> <fr:tex display="inline"><![CDATA[\Gamma  \,\vdash \, A_1 \,\,\mathsf {type}^{\bullet }, \ldots , \Gamma , x_1 \mathpunct {\,{\raisebox {-0.03em}{${\scriptscriptstyle  \bullet }$}} \mathllap {\raisebox {0.28em}{${\scriptscriptstyle  \bullet }$}}\,} A_1, \ldots , x_{n-1} \mathpunct {\,{\raisebox {-0.03em}{${\scriptscriptstyle  \bullet }$}} \mathllap {\raisebox {0.28em}{${\scriptscriptstyle  \bullet }$}}\,} A_{n-1} \,\vdash \, A_n \,\,\mathsf {type}^{\bullet }]]></fr:tex>. We will make this more precise later.</html:p>
              </fr:mainmatter>
            </fr:tree>
            <fr:tree show-metadata="false">
              <fr:frontmatter>
                <fr:authors>
                  <fr:author>
                    <fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link>
                  </fr:author>
                </fr:authors>
                <fr:date>
                  <fr:year>2025</fr:year>
                  <fr:month>3</fr:month>
                  <fr:day>19</fr:day>
                </fr:date>
                <fr:uri>https://forest.topos.site/ocl-00BK/</fr:uri>
                <fr:display-uri>https://forest.topos.site/ocl-00BK</fr:display-uri>
                <fr:route>/ocl-00BK/</fr:route>
                <fr:title text="Types (inner types)">Types (inner types)</fr:title>
                <fr:taxon>interpretation</fr:taxon>
              </fr:frontmatter>
              <fr:mainmatter>
                <html:p>As EMTT has inner sigma types, an inner type telescope (e.g., context extension comprised only of inner types, as in <fr:link href="/ocl-00BJ/" title="Contexts" uri="https://forest.topos.site/ocl-00BJ/" display-uri="https://forest.topos.site/ocl-00BJ" type="local">interpretation <fr:contextual-number uri="https://forest.topos.site/ocl-00BJ/" display-uri="https://forest.topos.site/ocl-00BJ" /></fr:link>) may be identified with a type in context <fr:tex display="inline"><![CDATA[\Gamma ]]></fr:tex>, and as we are working loosely, we will do this without further comment, so <fr:tex display="inline"><![CDATA[\Gamma  \,\vdash \, A \,\,\mathsf {type}^{\bullet }]]></fr:tex> means that <fr:tex display="inline"><![CDATA[A]]></fr:tex> is an object of <fr:tex display="inline"><![CDATA[\Gamma ]]></fr:tex>.</html:p>
                <html:p>Then lex functors act on inner types covariantly, as required.</html:p>
              </fr:mainmatter>
            </fr:tree>
            <fr:tree show-metadata="false">
              <fr:frontmatter>
                <fr:authors>
                  <fr:author>
                    <fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link>
                  </fr:author>
                </fr:authors>
                <fr:date>
                  <fr:year>2025</fr:year>
                  <fr:month>3</fr:month>
                  <fr:day>19</fr:day>
                </fr:date>
                <fr:uri>https://forest.topos.site/ocl-00BL/</fr:uri>
                <fr:display-uri>https://forest.topos.site/ocl-00BL</fr:display-uri>
                <fr:route>/ocl-00BL/</fr:route>
                <fr:title text="Elements (inner terms)">Elements (inner terms)</fr:title>
                <fr:taxon>interpretation</fr:taxon>
              </fr:frontmatter>
              <fr:mainmatter>
                <html:p>A element <fr:tex display="inline"><![CDATA[a \mathpunct {\,{\raisebox {-0.03em}{${\scriptscriptstyle  \bullet }$}} \mathllap {\raisebox {0.28em}{${\scriptscriptstyle  \bullet }$}}\,} A]]></fr:tex> is interpreted as a <html:em>global section</html:em> <fr:tex display="inline"><![CDATA[a \colon  1 \to  A]]></fr:tex>.</html:p>
              </fr:mainmatter>
            </fr:tree>
            <fr:tree show-metadata="false">
              <fr:frontmatter>
                <fr:authors>
                  <fr:author>
                    <fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link>
                  </fr:author>
                </fr:authors>
                <fr:date>
                  <fr:year>2025</fr:year>
                  <fr:month>3</fr:month>
                  <fr:day>19</fr:day>
                </fr:date>
                <fr:uri>https://forest.topos.site/ocl-00BM/</fr:uri>
                <fr:display-uri>https://forest.topos.site/ocl-00BM</fr:display-uri>
                <fr:route>/ocl-00BM/</fr:route>
                <fr:title text="Theories (outer types)">Theories (outer types)</fr:title>
                <fr:taxon>interpretation</fr:taxon>
              </fr:frontmatter>
              <fr:mainmatter><html:p>If we are to be consistent then, a context extension <fr:tex display="inline"><![CDATA[\Gamma  \to  \Gamma , \Delta ]]></fr:tex> must be interpreted as a lex functor. In the case that <fr:tex display="inline"><![CDATA[\Delta ]]></fr:tex> is comprised solely of inner types, then this lex functor is <html:em>etalé</html:em>. For general context extensions, we will eventually identify them with a certain presentation of lex functors (see <fr:link href="/ocl-00BU/" title="Theories are complex extensions" uri="https://forest.topos.site/ocl-00BU/" display-uri="https://forest.topos.site/ocl-00BU" type="local">interpretation <fr:contextual-number uri="https://forest.topos.site/ocl-00BU/" display-uri="https://forest.topos.site/ocl-00BU" /></fr:link>), but for now we can simply think of them as general lex functors. In other words, we interpret theories in a context <fr:tex display="inline"><![CDATA[\Gamma ]]></fr:tex> as lex functors out of <fr:tex display="inline"><![CDATA[\Gamma ]]></fr:tex>. Given a substitution <fr:tex display="inline"><![CDATA[\psi  \colon  \Gamma _1 \to  \Gamma _2]]></fr:tex> and an theory <fr:tex display="inline"><![CDATA[T]]></fr:tex> in context <fr:tex display="inline"><![CDATA[\Gamma _1]]></fr:tex>, the action of <fr:tex display="inline"><![CDATA[\psi ]]></fr:tex> is defined by <html:em>pushout</html:em>:</html:p>



<html:figure><fr:resource hash="645f2dd89b8c1e8c86107f20f4e814e0"><fr:resource-content><html:img src="https://forest.topos.site/645f2dd89b8c1e8c86107f20f4e814e0.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[

\usepackage[utf8]{inputenc}
\DeclareFontFamily{U}{min}{}
\DeclareFontShape{U}{min}{m}{n}{<-> udmj30}{}
\newcommand\yo{\!\text{\usefont{U}{min}{m}{n}\symbol{'207}}\!}
\DeclareUnicodeCharacter{3088}{\yo}


\usepackage{tikz, tikz-cd, mathtools, amssymb, stmaryrd,xcolor}
\usetikzlibrary{matrix,arrows}
\usetikzlibrary{backgrounds,fit,positioning,calc,shapes}
\usetikzlibrary{decorations.pathreplacing}
\usetikzlibrary{decorations.pathmorphing}
\usetikzlibrary{decorations.markings}

% `tikz-cd` is necessary to draw commutative diagrams.
\RequirePackage{tikz-cd}
% `amssymb` is necessary for `\lrcorner` and `\ulcorner`.
\RequirePackage{amssymb}
% `calc` is necessary to draw curved arrows.
\usetikzlibrary{calc}
% `pathmorphing` is necessary to draw squiggly arrows.
\usetikzlibrary{decorations.pathmorphing}
% `spath3` is necessary to draw shortened edges.
\usetikzlibrary{spath3}

% A TikZ style for curved arrows of a fixed height, due to AndréC.
\tikzset{curve/.style={settings={#1},to path={(\tikztostart)
    .. controls ($(\tikztostart)!\pv{pos}!(\tikztotarget)!\pv{height}!270:(\tikztotarget)$)
    and ($(\tikztostart)!1-\pv{pos}!(\tikztotarget)!\pv{height}!270:(\tikztotarget)$)
    .. (\tikztotarget)\tikztonodes}},
    settings/.code={\tikzset{quiver/.cd,#1}
        \def\pv##1{\pgfkeysvalueof{/tikz/quiver/##1}}},
    quiver/.cd,pos/.initial=0.35,height/.initial=0}

% A TikZ style for shortening paths without the poor behaviour of `shorten <' and `shorten >'.
\tikzset{between/.style n args={2}{/tikz/spath/at end path construction={
    \tikzset{spath/split at keep middle={current}{#1}{#2}}
}}}

% TikZ arrowhead/tail styles.
\tikzset{tail reversed/.code={\pgfsetarrowsstart{tikzcd to}}}
\tikzset{2tail/.code={\pgfsetarrowsstart{Implies[reversed]}}}
\tikzset{2tail reversed/.code={\pgfsetarrowsstart{Implies}}}
% TikZ arrow styles.
\tikzset{no body/.style={/tikz/dash pattern=on 0 off 1mm}}


\newcommand{\triplecolon}{%
  \mathrel{\vbox{\baselineskip=2pt \hbox{.}\hbox{.}\hbox{.}}}%
}

\DeclareUnicodeCharacter{2AF6}{\triplecolon}
\usepackage{mathpartir}

]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[
\begin {tikzcd}
	{\Gamma _1} & {\Gamma _2} \\
	{\Gamma _1, x \colon  T} & {\Gamma _2, x \colon  \psi ^\ast (T)}
	\arrow [from=1-1, to=1-2]
	\arrow [from=1-1, to=2-1]
	\arrow [from=1-2, to=2-2]
	\arrow [from=2-1, to=2-2]
	\arrow ["\lrcorner "{anchor=center, pos=0.125, rotate=180}, draw=none, from=2-2, to=1-1]
\end {tikzcd}
]]></fr:resource-source></fr:resource></html:figure>

<html:p>Of course, now the action of substitutions on outer types is by no means strict, but we will ignore that for now.</html:p></fr:mainmatter>
            </fr:tree>
            <fr:tree show-metadata="false">
              <fr:frontmatter>
                <fr:authors>
                  <fr:author>
                    <fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link>
                  </fr:author>
                </fr:authors>
                <fr:date>
                  <fr:year>2025</fr:year>
                  <fr:month>3</fr:month>
                  <fr:day>19</fr:day>
                </fr:date>
                <fr:uri>https://forest.topos.site/ocl-00BN/</fr:uri>
                <fr:display-uri>https://forest.topos.site/ocl-00BN</fr:display-uri>
                <fr:route>/ocl-00BN/</fr:route>
                <fr:title text="Models">Models</fr:title>
                <fr:taxon>interpretation</fr:taxon>
              </fr:frontmatter>
              <fr:mainmatter><html:p>If <fr:tex display="inline"><![CDATA[T]]></fr:tex> is a theory in context <fr:tex display="inline"><![CDATA[\Gamma ]]></fr:tex>, then a model is interpreted as a section:</html:p>



<html:figure><fr:resource hash="6d332909e12321a7d04fa9e8b8ec6aaa"><fr:resource-content><html:img src="https://forest.topos.site/6d332909e12321a7d04fa9e8b8ec6aaa.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[

\usepackage[utf8]{inputenc}
\DeclareFontFamily{U}{min}{}
\DeclareFontShape{U}{min}{m}{n}{<-> udmj30}{}
\newcommand\yo{\!\text{\usefont{U}{min}{m}{n}\symbol{'207}}\!}
\DeclareUnicodeCharacter{3088}{\yo}


\usepackage{tikz, tikz-cd, mathtools, amssymb, stmaryrd,xcolor}
\usetikzlibrary{matrix,arrows}
\usetikzlibrary{backgrounds,fit,positioning,calc,shapes}
\usetikzlibrary{decorations.pathreplacing}
\usetikzlibrary{decorations.pathmorphing}
\usetikzlibrary{decorations.markings}

% `tikz-cd` is necessary to draw commutative diagrams.
\RequirePackage{tikz-cd}
% `amssymb` is necessary for `\lrcorner` and `\ulcorner`.
\RequirePackage{amssymb}
% `calc` is necessary to draw curved arrows.
\usetikzlibrary{calc}
% `pathmorphing` is necessary to draw squiggly arrows.
\usetikzlibrary{decorations.pathmorphing}
% `spath3` is necessary to draw shortened edges.
\usetikzlibrary{spath3}

% A TikZ style for curved arrows of a fixed height, due to AndréC.
\tikzset{curve/.style={settings={#1},to path={(\tikztostart)
    .. controls ($(\tikztostart)!\pv{pos}!(\tikztotarget)!\pv{height}!270:(\tikztotarget)$)
    and ($(\tikztostart)!1-\pv{pos}!(\tikztotarget)!\pv{height}!270:(\tikztotarget)$)
    .. (\tikztotarget)\tikztonodes}},
    settings/.code={\tikzset{quiver/.cd,#1}
        \def\pv##1{\pgfkeysvalueof{/tikz/quiver/##1}}},
    quiver/.cd,pos/.initial=0.35,height/.initial=0}

% A TikZ style for shortening paths without the poor behaviour of `shorten <' and `shorten >'.
\tikzset{between/.style n args={2}{/tikz/spath/at end path construction={
    \tikzset{spath/split at keep middle={current}{#1}{#2}}
}}}

% TikZ arrowhead/tail styles.
\tikzset{tail reversed/.code={\pgfsetarrowsstart{tikzcd to}}}
\tikzset{2tail/.code={\pgfsetarrowsstart{Implies[reversed]}}}
\tikzset{2tail reversed/.code={\pgfsetarrowsstart{Implies}}}
% TikZ arrow styles.
\tikzset{no body/.style={/tikz/dash pattern=on 0 off 1mm}}


\newcommand{\triplecolon}{%
  \mathrel{\vbox{\baselineskip=2pt \hbox{.}\hbox{.}\hbox{.}}}%
}

\DeclareUnicodeCharacter{2AF6}{\triplecolon}
\usepackage{mathpartir}

]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[
\begin {tikzcd}
	{\Gamma } & {\Gamma , x \colon  T}
	\arrow ["{T}"', from=1-1, to=1-2]
	\arrow ["{M}"', curve={height=12pt}, from=1-2, to=1-1]
\end {tikzcd}
]]></fr:resource-source></fr:resource></html:figure>

<html:p>Specifically, a model <fr:tex display="inline"><![CDATA[M]]></fr:tex> is a functor <fr:tex display="inline"><![CDATA[\Gamma , x \colon  T \to  \Gamma ]]></fr:tex> such that <fr:tex display="inline"><![CDATA[M \circ  T = 1]]></fr:tex></html:p><html:p>As substitutions act on theories by pushout, the universal product of pushout gives them an action on models.</html:p></fr:mainmatter>
            </fr:tree>
            <html:p>We will now discuss how the various 2-theories are interpreted.</html:p>
            <fr:tree show-metadata="false">
              <fr:frontmatter>
                <fr:authors>
                  <fr:author>
                    <fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link>
                  </fr:author>
                </fr:authors>
                <fr:date>
                  <fr:year>2025</fr:year>
                  <fr:month>3</fr:month>
                  <fr:day>19</fr:day>
                </fr:date>
                <fr:uri>https://forest.topos.site/ocl-00BO/</fr:uri>
                <fr:display-uri>https://forest.topos.site/ocl-00BO</fr:display-uri>
                <fr:route>/ocl-00BO/</fr:route>
                <fr:title text="Inclusion of inner types into outer types (§ [https://forest.topos.site/ocl-00A1/])">Inclusion of inner types into outer types (<fr:link href="/ocl-00A1/" title="Inclusion of inner types into outer types" uri="https://forest.topos.site/ocl-00A1/" display-uri="https://forest.topos.site/ocl-00A1" type="local">§ <fr:contextual-number uri="https://forest.topos.site/ocl-00A1/" display-uri="https://forest.topos.site/ocl-00A1" /></fr:link>)</fr:title>
                <fr:taxon>interpretation</fr:taxon>
              </fr:frontmatter>
              <fr:mainmatter><html:p>Given an inner type <fr:tex display="inline"><![CDATA[A]]></fr:tex> of context <fr:tex display="inline"><![CDATA[\Gamma ]]></fr:tex> (that is, an object of the lex category <fr:tex display="inline"><![CDATA[\Gamma ]]></fr:tex>), we interpret the outer type <fr:tex display="inline"><![CDATA[\circ  A]]></fr:tex> as the lex functor <fr:tex display="inline"><![CDATA[\Gamma  \to  \Gamma  / A]]></fr:tex> defined by <fr:tex display="inline"><![CDATA[X \mapsto  (A \times  X \pi _1 A)]]></fr:tex>.</html:p><html:p>In order for this to satisfy the inference rules <fr:link href="/ocl-00A1/" title="Inclusion of inner types into outer types" uri="https://forest.topos.site/ocl-00A1/" display-uri="https://forest.topos.site/ocl-00A1" type="local">§ <fr:contextual-number uri="https://forest.topos.site/ocl-00A1/" display-uri="https://forest.topos.site/ocl-00A1" /></fr:link>, we need to show that for any object <fr:tex display="inline"><![CDATA[A]]></fr:tex> of a lex category <fr:tex display="inline"><![CDATA[\mathsf {L}]]></fr:tex>, sections <fr:tex display="inline"><![CDATA[\mathsf {L} \to  \mathsf {L}/A]]></fr:tex> are in bijection with morphisms <fr:tex display="inline"><![CDATA[1 \to  A]]></fr:tex>. What we will actually show is that isomorphism classes of sections are in bijection with morphisms <fr:tex display="inline"><![CDATA[1 \to  A]]></fr:tex>; we will not worry about this distinction now.</html:p><html:p>Going in one direction, given a morphism <fr:tex display="inline"><![CDATA[1 \to  A]]></fr:tex>, we may produce a functor <fr:tex display="inline"><![CDATA[\mathsf {L}/A \to  \mathsf {L}]]></fr:tex> via</html:p>



<html:figure><fr:resource hash="67a8eca6a2ba3db609d2070af79bfead"><fr:resource-content><html:img src="https://forest.topos.site/67a8eca6a2ba3db609d2070af79bfead.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[

\usepackage[utf8]{inputenc}
\DeclareFontFamily{U}{min}{}
\DeclareFontShape{U}{min}{m}{n}{<-> udmj30}{}
\newcommand\yo{\!\text{\usefont{U}{min}{m}{n}\symbol{'207}}\!}
\DeclareUnicodeCharacter{3088}{\yo}


\usepackage{tikz, tikz-cd, mathtools, amssymb, stmaryrd,xcolor}
\usetikzlibrary{matrix,arrows}
\usetikzlibrary{backgrounds,fit,positioning,calc,shapes}
\usetikzlibrary{decorations.pathreplacing}
\usetikzlibrary{decorations.pathmorphing}
\usetikzlibrary{decorations.markings}

% `tikz-cd` is necessary to draw commutative diagrams.
\RequirePackage{tikz-cd}
% `amssymb` is necessary for `\lrcorner` and `\ulcorner`.
\RequirePackage{amssymb}
% `calc` is necessary to draw curved arrows.
\usetikzlibrary{calc}
% `pathmorphing` is necessary to draw squiggly arrows.
\usetikzlibrary{decorations.pathmorphing}
% `spath3` is necessary to draw shortened edges.
\usetikzlibrary{spath3}

% A TikZ style for curved arrows of a fixed height, due to AndréC.
\tikzset{curve/.style={settings={#1},to path={(\tikztostart)
    .. controls ($(\tikztostart)!\pv{pos}!(\tikztotarget)!\pv{height}!270:(\tikztotarget)$)
    and ($(\tikztostart)!1-\pv{pos}!(\tikztotarget)!\pv{height}!270:(\tikztotarget)$)
    .. (\tikztotarget)\tikztonodes}},
    settings/.code={\tikzset{quiver/.cd,#1}
        \def\pv##1{\pgfkeysvalueof{/tikz/quiver/##1}}},
    quiver/.cd,pos/.initial=0.35,height/.initial=0}

% A TikZ style for shortening paths without the poor behaviour of `shorten <' and `shorten >'.
\tikzset{between/.style n args={2}{/tikz/spath/at end path construction={
    \tikzset{spath/split at keep middle={current}{#1}{#2}}
}}}

% TikZ arrowhead/tail styles.
\tikzset{tail reversed/.code={\pgfsetarrowsstart{tikzcd to}}}
\tikzset{2tail/.code={\pgfsetarrowsstart{Implies[reversed]}}}
\tikzset{2tail reversed/.code={\pgfsetarrowsstart{Implies}}}
% TikZ arrow styles.
\tikzset{no body/.style={/tikz/dash pattern=on 0 off 1mm}}


\newcommand{\triplecolon}{%
  \mathrel{\vbox{\baselineskip=2pt \hbox{.}\hbox{.}\hbox{.}}}%
}

\DeclareUnicodeCharacter{2AF6}{\triplecolon}
\usepackage{mathpartir}

]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[
\begin {tikzcd}
	X && \bullet  & X \\
	{A} && 1 & {A}
	\arrow [""{name=0, anchor=center, inner sep=0}, from=1-1, to=2-1]
	\arrow [from=1-3, to=1-4]
	\arrow [""{name=1, anchor=center, inner sep=0}, from=1-3, to=2-3]
	\arrow ["\lrcorner "{anchor=center, pos=0.125}, draw=none, from=1-3, to=2-4]
	\arrow [from=1-4, to=2-4]
	\arrow [from=2-3, to=2-4]
	\arrow [shorten <=14pt, shorten >=14pt, maps to, from=0, to=1]
\end {tikzcd}
]]></fr:resource-source></fr:resource></html:figure>

<html:p>This is a section, because for any <fr:tex display="inline"><![CDATA[B \colon  \mathsf {L}]]></fr:tex>, we have</html:p>



<html:figure><fr:resource hash="c9b0204d048f6bf3ccaef8783d626d32"><fr:resource-content><html:img src="https://forest.topos.site/c9b0204d048f6bf3ccaef8783d626d32.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[

\usepackage[utf8]{inputenc}
\DeclareFontFamily{U}{min}{}
\DeclareFontShape{U}{min}{m}{n}{<-> udmj30}{}
\newcommand\yo{\!\text{\usefont{U}{min}{m}{n}\symbol{'207}}\!}
\DeclareUnicodeCharacter{3088}{\yo}


\usepackage{tikz, tikz-cd, mathtools, amssymb, stmaryrd,xcolor}
\usetikzlibrary{matrix,arrows}
\usetikzlibrary{backgrounds,fit,positioning,calc,shapes}
\usetikzlibrary{decorations.pathreplacing}
\usetikzlibrary{decorations.pathmorphing}
\usetikzlibrary{decorations.markings}

% `tikz-cd` is necessary to draw commutative diagrams.
\RequirePackage{tikz-cd}
% `amssymb` is necessary for `\lrcorner` and `\ulcorner`.
\RequirePackage{amssymb}
% `calc` is necessary to draw curved arrows.
\usetikzlibrary{calc}
% `pathmorphing` is necessary to draw squiggly arrows.
\usetikzlibrary{decorations.pathmorphing}
% `spath3` is necessary to draw shortened edges.
\usetikzlibrary{spath3}

% A TikZ style for curved arrows of a fixed height, due to AndréC.
\tikzset{curve/.style={settings={#1},to path={(\tikztostart)
    .. controls ($(\tikztostart)!\pv{pos}!(\tikztotarget)!\pv{height}!270:(\tikztotarget)$)
    and ($(\tikztostart)!1-\pv{pos}!(\tikztotarget)!\pv{height}!270:(\tikztotarget)$)
    .. (\tikztotarget)\tikztonodes}},
    settings/.code={\tikzset{quiver/.cd,#1}
        \def\pv##1{\pgfkeysvalueof{/tikz/quiver/##1}}},
    quiver/.cd,pos/.initial=0.35,height/.initial=0}

% A TikZ style for shortening paths without the poor behaviour of `shorten <' and `shorten >'.
\tikzset{between/.style n args={2}{/tikz/spath/at end path construction={
    \tikzset{spath/split at keep middle={current}{#1}{#2}}
}}}

% TikZ arrowhead/tail styles.
\tikzset{tail reversed/.code={\pgfsetarrowsstart{tikzcd to}}}
\tikzset{2tail/.code={\pgfsetarrowsstart{Implies[reversed]}}}
\tikzset{2tail reversed/.code={\pgfsetarrowsstart{Implies}}}
% TikZ arrow styles.
\tikzset{no body/.style={/tikz/dash pattern=on 0 off 1mm}}


\newcommand{\triplecolon}{%
  \mathrel{\vbox{\baselineskip=2pt \hbox{.}\hbox{.}\hbox{.}}}%
}

\DeclareUnicodeCharacter{2AF6}{\triplecolon}
\usepackage{mathpartir}

]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[
\begin {tikzcd}
	{A \times  B} && B & {A \times  B} \\
	{A} && 1 & A
	\arrow [""{name=0, anchor=center, inner sep=0}, from=1-1, to=2-1]
	\arrow [from=1-3, to=1-4]
	\arrow [""{name=1, anchor=center, inner sep=0}, from=1-3, to=2-3]
	\arrow ["\lrcorner "{anchor=center, pos=0.125}, draw=none, from=1-3, to=2-4]
	\arrow [from=1-4, to=2-4]
	\arrow [from=2-3, to=2-4]
	\arrow [shorten <=15pt, shorten >=15pt, maps to, from=0, to=1]
\end {tikzcd}
]]></fr:resource-source></fr:resource></html:figure>

<html:p>In the other direction, if we have a section <fr:tex display="inline"><![CDATA[F \colon  \mathsf {L}/A \to  \mathsf {L}]]></fr:tex>, then we may apply <fr:tex display="inline"><![CDATA[F]]></fr:tex> to</html:p>



<html:figure><fr:resource hash="d341a7f73e343ef3c04f3752455888e7"><fr:resource-content><html:img src="https://forest.topos.site/d341a7f73e343ef3c04f3752455888e7.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[

\usepackage[utf8]{inputenc}
\DeclareFontFamily{U}{min}{}
\DeclareFontShape{U}{min}{m}{n}{<-> udmj30}{}
\newcommand\yo{\!\text{\usefont{U}{min}{m}{n}\symbol{'207}}\!}
\DeclareUnicodeCharacter{3088}{\yo}


\usepackage{tikz, tikz-cd, mathtools, amssymb, stmaryrd,xcolor}
\usetikzlibrary{matrix,arrows}
\usetikzlibrary{backgrounds,fit,positioning,calc,shapes}
\usetikzlibrary{decorations.pathreplacing}
\usetikzlibrary{decorations.pathmorphing}
\usetikzlibrary{decorations.markings}

% `tikz-cd` is necessary to draw commutative diagrams.
\RequirePackage{tikz-cd}
% `amssymb` is necessary for `\lrcorner` and `\ulcorner`.
\RequirePackage{amssymb}
% `calc` is necessary to draw curved arrows.
\usetikzlibrary{calc}
% `pathmorphing` is necessary to draw squiggly arrows.
\usetikzlibrary{decorations.pathmorphing}
% `spath3` is necessary to draw shortened edges.
\usetikzlibrary{spath3}

% A TikZ style for curved arrows of a fixed height, due to AndréC.
\tikzset{curve/.style={settings={#1},to path={(\tikztostart)
    .. controls ($(\tikztostart)!\pv{pos}!(\tikztotarget)!\pv{height}!270:(\tikztotarget)$)
    and ($(\tikztostart)!1-\pv{pos}!(\tikztotarget)!\pv{height}!270:(\tikztotarget)$)
    .. (\tikztotarget)\tikztonodes}},
    settings/.code={\tikzset{quiver/.cd,#1}
        \def\pv##1{\pgfkeysvalueof{/tikz/quiver/##1}}},
    quiver/.cd,pos/.initial=0.35,height/.initial=0}

% A TikZ style for shortening paths without the poor behaviour of `shorten <' and `shorten >'.
\tikzset{between/.style n args={2}{/tikz/spath/at end path construction={
    \tikzset{spath/split at keep middle={current}{#1}{#2}}
}}}

% TikZ arrowhead/tail styles.
\tikzset{tail reversed/.code={\pgfsetarrowsstart{tikzcd to}}}
\tikzset{2tail/.code={\pgfsetarrowsstart{Implies[reversed]}}}
\tikzset{2tail reversed/.code={\pgfsetarrowsstart{Implies}}}
% TikZ arrow styles.
\tikzset{no body/.style={/tikz/dash pattern=on 0 off 1mm}}


\newcommand{\triplecolon}{%
  \mathrel{\vbox{\baselineskip=2pt \hbox{.}\hbox{.}\hbox{.}}}%
}

\DeclareUnicodeCharacter{2AF6}{\triplecolon}
\usepackage{mathpartir}

]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[
\begin {tikzcd}
	A && {A \times  A} \\
	& A
	\arrow ["\Delta ", from=1-1, to=1-3]
	\arrow ["{1_A}"', from=1-1, to=2-2]
	\arrow ["{\pi _1}", from=1-3, to=2-2]
\end {tikzcd}
]]></fr:resource-source></fr:resource></html:figure>

<html:p>which produces a morphism <fr:tex display="inline"><![CDATA[1 \to  A]]></fr:tex> in <fr:tex display="inline"><![CDATA[\mathsf {L}]]></fr:tex>. One may easily check that these two operations are inverses.</html:p></fr:mainmatter>
            </fr:tree>
            <fr:tree show-metadata="false">
              <fr:frontmatter>
                <fr:authors>
                  <fr:author>
                    <fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link>
                  </fr:author>
                </fr:authors>
                <fr:date>
                  <fr:year>2025</fr:year>
                  <fr:month>3</fr:month>
                  <fr:day>19</fr:day>
                </fr:date>
                <fr:uri>https://forest.topos.site/ocl-00BP/</fr:uri>
                <fr:display-uri>https://forest.topos.site/ocl-00BP</fr:display-uri>
                <fr:route>/ocl-00BP/</fr:route>
                <fr:title text="Inner universe as outer type § [https://forest.topos.site/ocl-00AG/]">Inner universe as outer type <fr:link href="/ocl-00AG/" title="Inner universe as outer type" uri="https://forest.topos.site/ocl-00AG/" display-uri="https://forest.topos.site/ocl-00AG" type="local">§ <fr:contextual-number uri="https://forest.topos.site/ocl-00AG/" display-uri="https://forest.topos.site/ocl-00AG" /></fr:link></fr:title>
                <fr:taxon>interpretation</fr:taxon>
              </fr:frontmatter>
              <fr:mainmatter>
                <html:p>The universe theory is interpreted as the free lex category on a single object, which is <fr:tex display="inline"><![CDATA[\mathsf {Finset}^{\mathsf {op}}]]></fr:tex>. This works because the category of lex functors <fr:tex display="inline"><![CDATA[\mathsf {Finset}^{\mathsf {op}} \to  \mathsf {L}]]></fr:tex> is isomorphic to <fr:tex display="inline"><![CDATA[\mathsf {L}]]></fr:tex> itself, and so the category of sections of <fr:tex display="inline"><![CDATA[\mathsf {L} \to  \mathsf {L} + \mathsf {Finset}^{\mathsf {op}}]]></fr:tex> is likewise isomorphic to <fr:tex display="inline"><![CDATA[\mathsf {L}]]></fr:tex>.</html:p>
              </fr:mainmatter>
            </fr:tree>
            <fr:tree show-metadata="false">
              <fr:frontmatter>
                <fr:authors>
                  <fr:author>
                    <fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link>
                  </fr:author>
                </fr:authors>
                <fr:date>
                  <fr:year>2025</fr:year>
                  <fr:month>3</fr:month>
                  <fr:day>19</fr:day>
                </fr:date>
                <fr:uri>https://forest.topos.site/ocl-00BQ/</fr:uri>
                <fr:display-uri>https://forest.topos.site/ocl-00BQ</fr:display-uri>
                <fr:route>/ocl-00BQ/</fr:route>
                <fr:title text="Sigma types (inner sigma types) § [https://forest.topos.site/ocl-0085/]">Sigma types (inner sigma types) <fr:link href="/ocl-0085/" title="Single-level 2-theories" uri="https://forest.topos.site/ocl-0085/" display-uri="https://forest.topos.site/ocl-0085" type="local">§ <fr:contextual-number uri="https://forest.topos.site/ocl-0085/" display-uri="https://forest.topos.site/ocl-0085" /></fr:link></fr:title>
                <fr:taxon>interpretation</fr:taxon>
              </fr:frontmatter>
              <fr:mainmatter><html:p>A type <fr:tex display="inline"><![CDATA[B]]></fr:tex> in context <fr:tex display="inline"><![CDATA[\Gamma , x \colon  A]]></fr:tex> is identified with an object of <fr:tex display="inline"><![CDATA[\Gamma  /A]]></fr:tex>. Thus, we may simply forget the projection to <fr:tex display="inline"><![CDATA[A]]></fr:tex> to form an object of <fr:tex display="inline"><![CDATA[\Gamma ]]></fr:tex>; this object we identify with <fr:tex display="inline"><![CDATA[(x \colon  A) \times  B]]></fr:tex>. It is not hard to show that morphisms <fr:tex display="inline"><![CDATA[1 \to  (x \colon  A) \times  B]]></fr:tex> may be identified with pairs of morphisms <fr:tex display="inline"><![CDATA[1 \to  A]]></fr:tex> in <fr:tex display="inline"><![CDATA[\Gamma ]]></fr:tex> and morphisms</html:p>



<html:figure><fr:resource hash="f3fc68cc3beda226f1d021867562cf3d"><fr:resource-content><html:img src="https://forest.topos.site/f3fc68cc3beda226f1d021867562cf3d.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[

\usepackage[utf8]{inputenc}
\DeclareFontFamily{U}{min}{}
\DeclareFontShape{U}{min}{m}{n}{<-> udmj30}{}
\newcommand\yo{\!\text{\usefont{U}{min}{m}{n}\symbol{'207}}\!}
\DeclareUnicodeCharacter{3088}{\yo}


\usepackage{tikz, tikz-cd, mathtools, amssymb, stmaryrd,xcolor}
\usetikzlibrary{matrix,arrows}
\usetikzlibrary{backgrounds,fit,positioning,calc,shapes}
\usetikzlibrary{decorations.pathreplacing}
\usetikzlibrary{decorations.pathmorphing}
\usetikzlibrary{decorations.markings}

% `tikz-cd` is necessary to draw commutative diagrams.
\RequirePackage{tikz-cd}
% `amssymb` is necessary for `\lrcorner` and `\ulcorner`.
\RequirePackage{amssymb}
% `calc` is necessary to draw curved arrows.
\usetikzlibrary{calc}
% `pathmorphing` is necessary to draw squiggly arrows.
\usetikzlibrary{decorations.pathmorphing}
% `spath3` is necessary to draw shortened edges.
\usetikzlibrary{spath3}

% A TikZ style for curved arrows of a fixed height, due to AndréC.
\tikzset{curve/.style={settings={#1},to path={(\tikztostart)
    .. controls ($(\tikztostart)!\pv{pos}!(\tikztotarget)!\pv{height}!270:(\tikztotarget)$)
    and ($(\tikztostart)!1-\pv{pos}!(\tikztotarget)!\pv{height}!270:(\tikztotarget)$)
    .. (\tikztotarget)\tikztonodes}},
    settings/.code={\tikzset{quiver/.cd,#1}
        \def\pv##1{\pgfkeysvalueof{/tikz/quiver/##1}}},
    quiver/.cd,pos/.initial=0.35,height/.initial=0}

% A TikZ style for shortening paths without the poor behaviour of `shorten <' and `shorten >'.
\tikzset{between/.style n args={2}{/tikz/spath/at end path construction={
    \tikzset{spath/split at keep middle={current}{#1}{#2}}
}}}

% TikZ arrowhead/tail styles.
\tikzset{tail reversed/.code={\pgfsetarrowsstart{tikzcd to}}}
\tikzset{2tail/.code={\pgfsetarrowsstart{Implies[reversed]}}}
\tikzset{2tail reversed/.code={\pgfsetarrowsstart{Implies}}}
% TikZ arrow styles.
\tikzset{no body/.style={/tikz/dash pattern=on 0 off 1mm}}


\newcommand{\triplecolon}{%
  \mathrel{\vbox{\baselineskip=2pt \hbox{.}\hbox{.}\hbox{.}}}%
}

\DeclareUnicodeCharacter{2AF6}{\triplecolon}
\usepackage{mathpartir}

]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[
\begin {tikzcd}
	A && {(x \colon  A) \times  B} \\
	& A
	\arrow [from=1-1, to=1-3]
	\arrow [from=1-1, to=2-2]
	\arrow [from=1-3, to=2-2]
\end {tikzcd}
]]></fr:resource-source></fr:resource></html:figure>

<html:p>in <fr:tex display="inline"><![CDATA[\Gamma  /A]]></fr:tex>.</html:p></fr:mainmatter>
            </fr:tree>
            <fr:tree show-metadata="false">
              <fr:frontmatter>
                <fr:authors>
                  <fr:author>
                    <fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link>
                  </fr:author>
                </fr:authors>
                <fr:date>
                  <fr:year>2025</fr:year>
                  <fr:month>3</fr:month>
                  <fr:day>19</fr:day>
                </fr:date>
                <fr:uri>https://forest.topos.site/ocl-00BR/</fr:uri>
                <fr:display-uri>https://forest.topos.site/ocl-00BR</fr:display-uri>
                <fr:route>/ocl-00BR/</fr:route>
                <fr:title text="Sigma theories (outer sigma types) § [https://forest.topos.site/ocl-0085/]">Sigma theories (outer sigma types) <fr:link href="/ocl-0085/" title="Single-level 2-theories" uri="https://forest.topos.site/ocl-0085/" display-uri="https://forest.topos.site/ocl-0085" type="local">§ <fr:contextual-number uri="https://forest.topos.site/ocl-0085/" display-uri="https://forest.topos.site/ocl-0085" /></fr:link></fr:title>
                <fr:taxon>interpretation</fr:taxon>
              </fr:frontmatter>
              <fr:mainmatter>
                <html:p>As we have identified theories with their display maps <fr:tex display="inline"><![CDATA[\Gamma  \to  \Gamma , x \colon  T]]></fr:tex>, a sigma theory is simply the composite <fr:tex display="inline"><![CDATA[\Gamma  \to  \Gamma , x \colon  T \to  \Gamma , x \colon  T, y \colon  S]]></fr:tex>.</html:p>
              </fr:mainmatter>
            </fr:tree>
            <fr:tree show-metadata="false">
              <fr:frontmatter>
                <fr:authors>
                  <fr:author>
                    <fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link>
                  </fr:author>
                </fr:authors>
                <fr:date>
                  <fr:year>2025</fr:year>
                  <fr:month>3</fr:month>
                  <fr:day>19</fr:day>
                </fr:date>
                <fr:uri>https://forest.topos.site/ocl-00BS/</fr:uri>
                <fr:display-uri>https://forest.topos.site/ocl-00BS</fr:display-uri>
                <fr:route>/ocl-00BS/</fr:route>
                <fr:title text="Equality types (inner equality types) § [https://forest.topos.site/ocl-0081/]">Equality types (inner equality types) <fr:link href="/ocl-0081/" title="Extensional equality types" uri="https://forest.topos.site/ocl-0081/" display-uri="https://forest.topos.site/ocl-0081" type="local">§ <fr:contextual-number uri="https://forest.topos.site/ocl-0081/" display-uri="https://forest.topos.site/ocl-0081" /></fr:link></fr:title>
                <fr:taxon>interpretation</fr:taxon>
              </fr:frontmatter>
              <fr:mainmatter>
                <html:p>In order to interpret equality types, we need for every object <fr:tex display="inline"><![CDATA[A]]></fr:tex> in <fr:tex display="inline"><![CDATA[\Gamma ]]></fr:tex> to give an object of <fr:tex display="inline"><![CDATA[\Gamma , x \colon  A, y \colon  A \cong  \Gamma  /(A \times  A)]]></fr:tex>. The diagonal <fr:tex display="inline"><![CDATA[A \to  A \times  A]]></fr:tex> works perfectly for this purpose.</html:p>
              </fr:mainmatter>
            </fr:tree>
            <html:p>The only remaining 2-theory to interpret is that of pi theories (inner-outer-outer pi types). Unfortunately, the existence of pi theories requires a much more sophisticated argument than the preceding 2-theories, which will require the development of some non-trivial theory. We begin with the following lemma.</html:p>
            <fr:tree show-metadata="false">
              <fr:frontmatter>
                <fr:authors>
                  <fr:author>
                    <fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link>
                  </fr:author>
                </fr:authors>
                <fr:date>
                  <fr:year>2025</fr:year>
                  <fr:month>3</fr:month>
                  <fr:day>19</fr:day>
                </fr:date>
                <fr:uri>https://forest.topos.site/ocl-00BT/</fr:uri>
                <fr:display-uri>https://forest.topos.site/ocl-00BT</fr:display-uri>
                <fr:route>/ocl-00BT/</fr:route>
                <fr:title text="Dependent function types out of function types">Dependent function types out of function types</fr:title>
                <fr:taxon>lemma</fr:taxon>
              </fr:frontmatter>
              <fr:mainmatter><html:p>It is well-known that locally cartesian closed categories interpret (in some sense) dependent type theory with pi types. However, if we inspect the definition of locally cartesian closed categories, we see that it says only that each slice is cartesian closed, which means that slices have <html:em>function types</html:em> rather than pi types. How does one get from function types to pi types?</html:p><html:p>This is easiest to understand type theoretically. The idea is that we can identify elements of a pi type <fr:tex display="inline"><![CDATA[(x \colon  A) \to  B]]></fr:tex> with those elements of the function type <fr:tex display="inline"><![CDATA[A \to  (x \colon  A) \times  B]]></fr:tex> that are sections of the projection <fr:tex display="inline"><![CDATA[(x \colon  A) \times  B \to  A]]></fr:tex>. Specifically, <fr:tex display="inline"><![CDATA[(x \colon  A) \to  B]]></fr:tex> can be identified with the pullback</html:p>



<html:figure><fr:resource hash="4705fa4a59faa5ed3ebc9e528acd08c3"><fr:resource-content><html:img src="https://forest.topos.site/4705fa4a59faa5ed3ebc9e528acd08c3.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[

\usepackage[utf8]{inputenc}
\DeclareFontFamily{U}{min}{}
\DeclareFontShape{U}{min}{m}{n}{<-> udmj30}{}
\newcommand\yo{\!\text{\usefont{U}{min}{m}{n}\symbol{'207}}\!}
\DeclareUnicodeCharacter{3088}{\yo}


\usepackage{tikz, tikz-cd, mathtools, amssymb, stmaryrd,xcolor}
\usetikzlibrary{matrix,arrows}
\usetikzlibrary{backgrounds,fit,positioning,calc,shapes}
\usetikzlibrary{decorations.pathreplacing}
\usetikzlibrary{decorations.pathmorphing}
\usetikzlibrary{decorations.markings}

% `tikz-cd` is necessary to draw commutative diagrams.
\RequirePackage{tikz-cd}
% `amssymb` is necessary for `\lrcorner` and `\ulcorner`.
\RequirePackage{amssymb}
% `calc` is necessary to draw curved arrows.
\usetikzlibrary{calc}
% `pathmorphing` is necessary to draw squiggly arrows.
\usetikzlibrary{decorations.pathmorphing}
% `spath3` is necessary to draw shortened edges.
\usetikzlibrary{spath3}

% A TikZ style for curved arrows of a fixed height, due to AndréC.
\tikzset{curve/.style={settings={#1},to path={(\tikztostart)
    .. controls ($(\tikztostart)!\pv{pos}!(\tikztotarget)!\pv{height}!270:(\tikztotarget)$)
    and ($(\tikztostart)!1-\pv{pos}!(\tikztotarget)!\pv{height}!270:(\tikztotarget)$)
    .. (\tikztotarget)\tikztonodes}},
    settings/.code={\tikzset{quiver/.cd,#1}
        \def\pv##1{\pgfkeysvalueof{/tikz/quiver/##1}}},
    quiver/.cd,pos/.initial=0.35,height/.initial=0}

% A TikZ style for shortening paths without the poor behaviour of `shorten <' and `shorten >'.
\tikzset{between/.style n args={2}{/tikz/spath/at end path construction={
    \tikzset{spath/split at keep middle={current}{#1}{#2}}
}}}

% TikZ arrowhead/tail styles.
\tikzset{tail reversed/.code={\pgfsetarrowsstart{tikzcd to}}}
\tikzset{2tail/.code={\pgfsetarrowsstart{Implies[reversed]}}}
\tikzset{2tail reversed/.code={\pgfsetarrowsstart{Implies}}}
% TikZ arrow styles.
\tikzset{no body/.style={/tikz/dash pattern=on 0 off 1mm}}


\newcommand{\triplecolon}{%
  \mathrel{\vbox{\baselineskip=2pt \hbox{.}\hbox{.}\hbox{.}}}%
}

\DeclareUnicodeCharacter{2AF6}{\triplecolon}
\usepackage{mathpartir}

]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[
\begin {tikzcd}
	{(x \colon  A) \to  B} & {A \to  (x \colon  A) \times  B} \\
	1 & {A \to  A}
	\arrow [from=1-1, to=1-2]
	\arrow [from=1-1, to=2-1]
	\arrow ["\lrcorner "{anchor=center, pos=0.125}, draw=none, from=1-1, to=2-2]
	\arrow ["{\pi _1 \circ  -}", from=1-2, to=2-2]
	\arrow ["{\mathrm {id}_A}"', from=2-1, to=2-2]
\end {tikzcd}
]]></fr:resource-source></fr:resource></html:figure>

<html:p>Thus, to establish the existence of pi theories, we must show that for any object <fr:tex display="inline"><![CDATA[A]]></fr:tex> of a lex category <fr:tex display="inline"><![CDATA[\Gamma ]]></fr:tex>, <fr:tex display="inline"><![CDATA[\Gamma  \to  \Gamma  /A]]></fr:tex> is an exponentiable object of <fr:tex display="inline"><![CDATA[\mathcal {L}\mathsf {ex}^{\mathsf {op}} /\Gamma ]]></fr:tex>.</html:p></fr:mainmatter>
            </fr:tree>
            <html:p>The proof that <fr:tex display="inline"><![CDATA[\Gamma  \to  \Gamma  /A]]></fr:tex> is an exponentiable object is a modification of Theorem B4.3.1 of <fr:link href="/johnstone-2002-sketches/" title="Sketches of an Elephant A Topos Theory Compendium" uri="https://forest.topos.site/johnstone-2002-sketches/" display-uri="https://forest.topos.site/johnstone-2002-sketches" type="local">Reference <fr:contextual-number uri="https://forest.topos.site/johnstone-2002-sketches/" display-uri="https://forest.topos.site/johnstone-2002-sketches" /></fr:link>. This shows that an <fr:tex display="inline"><![CDATA[S]]></fr:tex>-topos <fr:tex display="inline"><![CDATA[p \colon  E \to  S]]></fr:tex> is exponentiable under certain conditions, and proves this by observing that <fr:tex display="inline"><![CDATA[E]]></fr:tex> is the classifying topos for some geometric theory and working explicitly with that geometric theory.</html:p>
            <html:p>As we are in the setting of lex categories, we must modify this proof. Specifically, rather than using geometric theories, we will use finite limit sketches. We will give a relatively self-contained account of sketches, but the reader may also refer to <fr:link href="/gray-1989-category/" title="The category of sketches as a model for algebraic semantics" uri="https://forest.topos.site/gray-1989-category/" display-uri="https://forest.topos.site/gray-1989-category" type="local">Reference <fr:contextual-number uri="https://forest.topos.site/gray-1989-category/" display-uri="https://forest.topos.site/gray-1989-category" /></fr:link>, <fr:link href="/barr-1999-notes/" title="Notes on sketches" uri="https://forest.topos.site/barr-1999-notes/" display-uri="https://forest.topos.site/barr-1999-notes" type="local">Reference <fr:contextual-number uri="https://forest.topos.site/barr-1999-notes/" display-uri="https://forest.topos.site/barr-1999-notes" /></fr:link>, or Section 4 of <fr:link href="/barr-2005-toposes/" title="Toposes, Triples and Theories" uri="https://forest.topos.site/barr-2005-toposes/" display-uri="https://forest.topos.site/barr-2005-toposes" type="local">Reference <fr:contextual-number uri="https://forest.topos.site/barr-2005-toposes/" display-uri="https://forest.topos.site/barr-2005-toposes" /></fr:link>.</html:p>
            <fr:tree show-metadata="false">
              <fr:frontmatter>
                <fr:authors>
                  <fr:author>
                    <fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link>
                  </fr:author>
                </fr:authors>
                <fr:date>
                  <fr:year>2025</fr:year>
                  <fr:month>3</fr:month>
                  <fr:day>14</fr:day>
                </fr:date>
                <fr:uri>https://forest.topos.site/ocl-00AS/</fr:uri>
                <fr:display-uri>https://forest.topos.site/ocl-00AS</fr:display-uri>
                <fr:route>/ocl-00AS/</fr:route>
                <fr:title text="Graph">Graph</fr:title>
                <fr:taxon>definition</fr:taxon>
              </fr:frontmatter>
              <fr:mainmatter>
                <html:p>A graph is a functor from the small category <fr:tex display="inline"><![CDATA[E \rightrightarrows  V]]></fr:tex> to <fr:tex display="inline"><![CDATA[\mathsf {Set}]]></fr:tex>. A finite graph is a functor from the same category to <fr:tex display="inline"><![CDATA[\mathsf {Finset}]]></fr:tex>. Let <fr:tex display="inline"><![CDATA[\mathsf {Graph}]]></fr:tex> be the category of all graphs, and <fr:tex display="inline"><![CDATA[\mathsf {FinGraph}]]></fr:tex> be the full subcategory of finite graphs.</html:p>
              </fr:mainmatter>
            </fr:tree>
            <fr:tree show-metadata="false">
              <fr:frontmatter>
                <fr:authors>
                  <fr:author>
                    <fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link>
                  </fr:author>
                </fr:authors>
                <fr:date>
                  <fr:year>2025</fr:year>
                  <fr:month>3</fr:month>
                  <fr:day>17</fr:day>
                </fr:date>
                <fr:uri>https://forest.topos.site/ocl-00BE/</fr:uri>
                <fr:display-uri>https://forest.topos.site/ocl-00BE</fr:display-uri>
                <fr:route>/ocl-00BE/</fr:route>
                <fr:title text="Free category on a graph">Free category on a graph</fr:title>
                <fr:taxon>definition</fr:taxon>
              </fr:frontmatter>
              <fr:mainmatter>
                <html:p>There is a forgetful functor from categories to graphs; the <html:strong>free category on a graph</html:strong> is given by the left adjoint to this functor. We call morphisms in the free category on a graph <html:strong>paths</html:strong> in that graph.</html:p>
              </fr:mainmatter>
            </fr:tree>
            <fr:tree show-metadata="false">
              <fr:frontmatter>
                <fr:authors>
                  <fr:author>
                    <fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link>
                  </fr:author>
                </fr:authors>
                <fr:date>
                  <fr:year>2025</fr:year>
                  <fr:month>3</fr:month>
                  <fr:day>17</fr:day>
                </fr:date>
                <fr:uri>https://forest.topos.site/ocl-00BD/</fr:uri>
                <fr:display-uri>https://forest.topos.site/ocl-00BD</fr:display-uri>
                <fr:route>/ocl-00BD/</fr:route>
                <fr:title text="Graph with equated paths">Graph with equated paths</fr:title>
                <fr:taxon>definition</fr:taxon>
              </fr:frontmatter>
              <fr:mainmatter>
                <html:p>A <html:strong>parallel path pair</html:strong> in a graph <fr:tex display="inline"><![CDATA[G]]></fr:tex> consists of a pair of paths in <fr:tex display="inline"><![CDATA[G]]></fr:tex> with the same start and end vertex.</html:p>
                <html:p>A <html:strong>graph with equated paths</html:strong> consists of a graph <fr:tex display="inline"><![CDATA[G]]></fr:tex> along with a subset of parallel path pairs called the <html:strong>equated paths</html:strong>. For short, we call this an EP-graph.</html:p>
                <html:p>There is a category <fr:tex display="inline"><![CDATA[\mathsf {EPGraph}]]></fr:tex> of EP-graphs, where the objects are
category presentations and the morphisms are graph homomorphisms which send
equated paths to equated paths.</html:p>
                <html:p>There is a forgetful functor from <fr:tex display="inline"><![CDATA[\mathsf {Cat}]]></fr:tex> to <fr:tex display="inline"><![CDATA[\mathsf {EPGraph}]]></fr:tex> which sends a category to its underlying graph equipped with the subset of parallel path pairs <fr:tex display="inline"><![CDATA[(P_1, P_2)]]></fr:tex> where the composite of <fr:tex display="inline"><![CDATA[P_1]]></fr:tex> equals the composite of <fr:tex display="inline"><![CDATA[P_2]]></fr:tex>. This forgetful functor has a left adjoint, which sends a graph with equated paths <fr:tex display="inline"><![CDATA[(G, E)]]></fr:tex> to a quotient of the free category on <fr:tex display="inline"><![CDATA[G]]></fr:tex> given by identifying the paths in <fr:tex display="inline"><![CDATA[E]]></fr:tex>.</html:p>
              </fr:mainmatter>
            </fr:tree>
            <fr:tree show-metadata="false">
              <fr:frontmatter>
                <fr:authors>
                  <fr:author>
                    <fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link>
                  </fr:author>
                </fr:authors>
                <fr:date>
                  <fr:year>2025</fr:year>
                  <fr:month>3</fr:month>
                  <fr:day>14</fr:day>
                </fr:date>
                <fr:uri>https://forest.topos.site/ocl-00AT/</fr:uri>
                <fr:display-uri>https://forest.topos.site/ocl-00AT</fr:display-uri>
                <fr:route>/ocl-00AT/</fr:route>
                <fr:title text="Diagram">Diagram</fr:title>
                <fr:taxon>definition</fr:taxon>
              </fr:frontmatter>
              <fr:mainmatter>
                <html:p>A <html:strong>diagram</html:strong> in a graph <fr:tex display="inline"><![CDATA[G]]></fr:tex> is an object of <fr:tex display="inline"><![CDATA[\mathsf {Diag}(G) := \mathsf {FinGraph} \downarrow  G]]></fr:tex>.</html:p>
              </fr:mainmatter>
            </fr:tree>
            <fr:tree show-metadata="false">
              <fr:frontmatter>
                <fr:authors>
                  <fr:author>
                    <fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link>
                  </fr:author>
                </fr:authors>
                <fr:date>
                  <fr:year>2025</fr:year>
                  <fr:month>3</fr:month>
                  <fr:day>14</fr:day>
                </fr:date>
                <fr:uri>https://forest.topos.site/ocl-00AU/</fr:uri>
                <fr:display-uri>https://forest.topos.site/ocl-00AU</fr:display-uri>
                <fr:route>/ocl-00AU/</fr:route>
                <fr:title text="Cone">Cone</fr:title>
                <fr:taxon>definition</fr:taxon>
              </fr:frontmatter>
              <fr:mainmatter>
                <html:p>Given a finite graph <fr:tex display="inline"><![CDATA[J]]></fr:tex>, let <fr:tex display="inline"><![CDATA[\mathsf {cone}(J)]]></fr:tex> be the graph defined by</html:p>
                <fr:tex display="block"><![CDATA[
\begin {aligned}
\mathsf {cone}(G)(V) &= G(V) + 1 \\
\mathsf {cone}(G)(E) &= G(E) + V \\
\mathsf {cone}(G)(\mathrm {src})(\mathsf {inl}\,(e)) &= \mathsf {inl}\,(G(\mathrm {src}(e))) \\
\mathsf {cone}(G)(\mathrm {src})(\mathsf {inr}\,(v)) &= \mathsf {inr}\,(\ast ) \\
\mathsf {cone}(G)(\mathrm {tgt})(\mathsf {inl}\,(e)) &= \mathsf {inl}\,(G(\mathrm {tgt}(e))) \\
\mathsf {cone}(G)(\mathrm {tgt})(\mathsf {inr}\,(v)) &= \mathsf {inl}\,(v)
\end {aligned}
]]></fr:tex>
                <html:p>Thus, <fr:tex display="inline"><![CDATA[\mathsf {cone}(J)]]></fr:tex> is an endofunctor on <fr:tex display="inline"><![CDATA[\mathsf {FinGraph}]]></fr:tex>. Let a <html:strong>cone</html:strong> on a graph <fr:tex display="inline"><![CDATA[G]]></fr:tex> be an object of <fr:tex display="inline"><![CDATA[\mathsf {Cone}(G) := \mathsf {cone} \downarrow  G]]></fr:tex>.</html:p>
              </fr:mainmatter>
            </fr:tree>
            <fr:tree show-metadata="false">
              <fr:frontmatter>
                <fr:authors>
                  <fr:author>
                    <fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link>
                  </fr:author>
                </fr:authors>
                <fr:date>
                  <fr:year>2025</fr:year>
                  <fr:month>3</fr:month>
                  <fr:day>14</fr:day>
                </fr:date>
                <fr:uri>https://forest.topos.site/ocl-00AW/</fr:uri>
                <fr:display-uri>https://forest.topos.site/ocl-00AW</fr:display-uri>
                <fr:route>/ocl-00AW/</fr:route>
                <fr:title text="Sketch">Sketch</fr:title>
                <fr:taxon>definition</fr:taxon>
              </fr:frontmatter>
              <fr:mainmatter>
                <html:p>A <html:strong>sketch</html:strong> consists of an EP-graph <fr:tex display="inline"><![CDATA[(S, E)]]></fr:tex> along with a subset of isomorphism classes of cones on <fr:tex display="inline"><![CDATA[S]]></fr:tex>, which we call “postulated limits”. A sketch morphism from <fr:tex display="inline"><![CDATA[S]]></fr:tex> to <fr:tex display="inline"><![CDATA[T]]></fr:tex> consists of an EP-graph morphism that sends postulated limits to postulated limits. Let <fr:tex display="inline"><![CDATA[\mathsf {Sketch}]]></fr:tex> be the category of sketches and sketch morphisms.</html:p>
                <html:p>In a more general context, some might call sketches “finite limit sketches”, but as we only consider finite limit sketches, we will simply drop the “finite limit” prefix.</html:p>
              </fr:mainmatter>
            </fr:tree>
            <fr:tree show-metadata="false">
              <fr:frontmatter>
                <fr:authors>
                  <fr:author>
                    <fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link>
                  </fr:author>
                </fr:authors>
                <fr:date>
                  <fr:year>2025</fr:year>
                  <fr:month>3</fr:month>
                  <fr:day>14</fr:day>
                </fr:date>
                <fr:uri>https://forest.topos.site/ocl-00AV/</fr:uri>
                <fr:display-uri>https://forest.topos.site/ocl-00AV</fr:display-uri>
                <fr:route>/ocl-00AV/</fr:route>
                <fr:title text="The induced sketch on a category">The induced sketch on a category</fr:title>
                <fr:taxon>definition</fr:taxon>
              </fr:frontmatter>
              <fr:mainmatter>
                <html:p>Given any category <fr:tex display="inline"><![CDATA[\mathsf {C}]]></fr:tex>, there is an induced finite limit sketch, where the graph is the underlying graph of <fr:tex display="inline"><![CDATA[\mathsf {C}]]></fr:tex>, the diagrams are the commuting diagrams, and the cones are the limit cones.</html:p>
              </fr:mainmatter>
            </fr:tree>
            <fr:tree show-metadata="false">
              <fr:frontmatter>
                <fr:authors>
                  <fr:author>
                    <fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link>
                  </fr:author>
                </fr:authors>
                <fr:date>
                  <fr:year>2025</fr:year>
                  <fr:month>3</fr:month>
                  <fr:day>14</fr:day>
                </fr:date>
                <fr:uri>https://forest.topos.site/ocl-00B0/</fr:uri>
                <fr:display-uri>https://forest.topos.site/ocl-00B0</fr:display-uri>
                <fr:route>/ocl-00B0/</fr:route>
                <fr:title text="Realization of a sketch">Realization of a sketch</fr:title>
                <fr:taxon>definition</fr:taxon>
              </fr:frontmatter>
              <fr:mainmatter>
                <html:p>There is a forgetful functor <fr:tex display="inline"><![CDATA[U]]></fr:tex> from <fr:tex display="inline"><![CDATA[\mathcal {L}\mathsf {ex}]]></fr:tex> to <fr:tex display="inline"><![CDATA[\mathsf {Sketch}]]></fr:tex>, which factors through <fr:link href="/ocl-00AV/" title="The induced sketch on a category" uri="https://forest.topos.site/ocl-00AV/" display-uri="https://forest.topos.site/ocl-00AV" type="local">definition <fr:contextual-number uri="https://forest.topos.site/ocl-00AV/" display-uri="https://forest.topos.site/ocl-00AV" /></fr:link> and the forgetful functor <fr:tex display="inline"><![CDATA[\mathcal {L}\mathsf {ex} \to  \mathcal {C}\mathsf {at}]]></fr:tex>. This forgetful functor has a left adjoint <fr:tex display="inline"><![CDATA[F]]></fr:tex>.</html:p>
                <html:p>For a sketch <fr:tex display="inline"><![CDATA[S]]></fr:tex>, we define its <html:strong>realization</html:strong> to be the composite <fr:tex display="inline"><![CDATA[UF(S)]]></fr:tex>, and denote it by <fr:tex display="inline"><![CDATA[\mathcal {R}(S)]]></fr:tex>.</html:p>
              </fr:mainmatter>
            </fr:tree>
            <fr:tree show-metadata="false">
              <fr:frontmatter>
                <fr:authors>
                  <fr:author>
                    <fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link>
                  </fr:author>
                </fr:authors>
                <fr:date>
                  <fr:year>2025</fr:year>
                  <fr:month>3</fr:month>
                  <fr:day>17</fr:day>
                </fr:date>
                <fr:uri>https://forest.topos.site/ocl-00BF/</fr:uri>
                <fr:display-uri>https://forest.topos.site/ocl-00BF</fr:display-uri>
                <fr:route>/ocl-00BF/</fr:route>
                <fr:title text="Graphs, EP-graphs, sketches, and finitely complete categories">Graphs, EP-graphs, sketches, and finitely complete categories</fr:title>
                <fr:taxon>remark</fr:taxon>
              </fr:frontmatter>
              <fr:mainmatter><html:p>There is a sequence of adjoint functors that we will use heavily for the rest of this section; we leave it to the reader to construct these adjoints.</html:p>



<html:figure><fr:resource hash="10ebcbbb9aa2eb34e634677df04067cc"><fr:resource-content><html:img src="https://forest.topos.site/10ebcbbb9aa2eb34e634677df04067cc.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[

\usepackage[utf8]{inputenc}
\DeclareFontFamily{U}{min}{}
\DeclareFontShape{U}{min}{m}{n}{<-> udmj30}{}
\newcommand\yo{\!\text{\usefont{U}{min}{m}{n}\symbol{'207}}\!}
\DeclareUnicodeCharacter{3088}{\yo}


\usepackage{tikz, tikz-cd, mathtools, amssymb, stmaryrd,xcolor}
\usetikzlibrary{matrix,arrows}
\usetikzlibrary{backgrounds,fit,positioning,calc,shapes}
\usetikzlibrary{decorations.pathreplacing}
\usetikzlibrary{decorations.pathmorphing}
\usetikzlibrary{decorations.markings}

% `tikz-cd` is necessary to draw commutative diagrams.
\RequirePackage{tikz-cd}
% `amssymb` is necessary for `\lrcorner` and `\ulcorner`.
\RequirePackage{amssymb}
% `calc` is necessary to draw curved arrows.
\usetikzlibrary{calc}
% `pathmorphing` is necessary to draw squiggly arrows.
\usetikzlibrary{decorations.pathmorphing}
% `spath3` is necessary to draw shortened edges.
\usetikzlibrary{spath3}

% A TikZ style for curved arrows of a fixed height, due to AndréC.
\tikzset{curve/.style={settings={#1},to path={(\tikztostart)
    .. controls ($(\tikztostart)!\pv{pos}!(\tikztotarget)!\pv{height}!270:(\tikztotarget)$)
    and ($(\tikztostart)!1-\pv{pos}!(\tikztotarget)!\pv{height}!270:(\tikztotarget)$)
    .. (\tikztotarget)\tikztonodes}},
    settings/.code={\tikzset{quiver/.cd,#1}
        \def\pv##1{\pgfkeysvalueof{/tikz/quiver/##1}}},
    quiver/.cd,pos/.initial=0.35,height/.initial=0}

% A TikZ style for shortening paths without the poor behaviour of `shorten <' and `shorten >'.
\tikzset{between/.style n args={2}{/tikz/spath/at end path construction={
    \tikzset{spath/split at keep middle={current}{#1}{#2}}
}}}

% TikZ arrowhead/tail styles.
\tikzset{tail reversed/.code={\pgfsetarrowsstart{tikzcd to}}}
\tikzset{2tail/.code={\pgfsetarrowsstart{Implies[reversed]}}}
\tikzset{2tail reversed/.code={\pgfsetarrowsstart{Implies}}}
% TikZ arrow styles.
\tikzset{no body/.style={/tikz/dash pattern=on 0 off 1mm}}


\newcommand{\triplecolon}{%
  \mathrel{\vbox{\baselineskip=2pt \hbox{.}\hbox{.}\hbox{.}}}%
}

\DeclareUnicodeCharacter{2AF6}{\triplecolon}
\usepackage{mathpartir}

]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[
\begin {tikzcd}
	{\mathsf {Graph}} & {\mathsf {EPGraph}} & {\mathsf {Sketch}} & {\mathcal {L}\mathsf {ex}} & {}
	\arrow [""{name=0, anchor=center, inner sep=0}, shift left=2, from=1-1, to=1-2]
	\arrow [""{name=1, anchor=center, inner sep=0}, shift left=2, from=1-2, to=1-1]
	\arrow [""{name=2, anchor=center, inner sep=0}, shift left=2, from=1-2, to=1-3]
	\arrow [""{name=3, anchor=center, inner sep=0}, shift left=2, from=1-3, to=1-2]
	\arrow [""{name=4, anchor=center, inner sep=0}, shift left=2, from=1-3, to=1-4]
	\arrow [""{name=5, anchor=center, inner sep=0}, shift left=2, from=1-4, to=1-3]
	\arrow ["\dashv "{anchor=center, rotate=-90}, draw=none, from=0, to=1]
	\arrow ["\dashv "{anchor=center, rotate=-90}, draw=none, from=2, to=3]
	\arrow ["\dashv "{anchor=center, rotate=-90}, draw=none, from=4, to=5]
\end {tikzcd}
]]></fr:resource-source></fr:resource></html:figure>

</fr:mainmatter>
            </fr:tree>
            <fr:tree show-metadata="false">
              <fr:frontmatter>
                <fr:authors>
                  <fr:author>
                    <fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link>
                  </fr:author>
                </fr:authors>
                <fr:date>
                  <fr:year>2025</fr:year>
                  <fr:month>3</fr:month>
                  <fr:day>14</fr:day>
                </fr:date>
                <fr:uri>https://forest.topos.site/ocl-00AX/</fr:uri>
                <fr:display-uri>https://forest.topos.site/ocl-00AX</fr:display-uri>
                <fr:route>/ocl-00AX/</fr:route>
                <fr:title text="Pushouts in the category of sketches">Pushouts in the category of sketches</fr:title>
                <fr:taxon>construction</fr:taxon>
              </fr:frontmatter>
              <fr:mainmatter>
                <html:p>In this construction, we compute the pushout of a span of sketches.</html:p>
                <html:p>First of all, note that the forgetful functor from sketches to graphs admits a further <html:em>right</html:em> adjoint, which sends a graph to the sketch where all parallel pairs are equated and all cones are postulated as limits. Thus, the forgetful functor preserves colimits as well as limits, so the underlying graph of a pushout is the pushout of the underlying graphs.</html:p>
                <html:p>Knowing this, it is then not difficult to show that the equated pairs and postulated limits in the pushout are the union of the induced equated pairs and postulated limits that must exist by the fact that the injections are sketch morphisms.</html:p>
              </fr:mainmatter>
            </fr:tree>
            <fr:tree show-metadata="false">
              <fr:frontmatter>
                <fr:authors>
                  <fr:author>
                    <fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link>
                  </fr:author>
                </fr:authors>
                <fr:date>
                  <fr:year>2025</fr:year>
                  <fr:month>3</fr:month>
                  <fr:day>14</fr:day>
                </fr:date>
                <fr:uri>https://forest.topos.site/ocl-00AZ/</fr:uri>
                <fr:display-uri>https://forest.topos.site/ocl-00AZ</fr:display-uri>
                <fr:route>/ocl-00AZ/</fr:route>
                <fr:title text="Sketch complex">Sketch complex</fr:title>
                <fr:taxon>definition</fr:taxon>
              </fr:frontmatter>
              <fr:mainmatter><html:p>In this definition we will define a <html:em>sketch complex</html:em>, which is a sketch built up inductively in a specific way, analogous to a CW-complex in topology.</html:p><html:p>Consider the following four classes of sketch inclusions, which we call <html:strong>generating sketch inclusions</html:strong>.</html:p><html:ol><html:li>The <html:strong>vertex generator</html:strong>, which is the sketch inclusion from the empty sketch to the singleton sketch.</html:li>
  <html:li>The <html:strong>edge generator</html:strong>, which is sketch inclusion from the two-element sketch to the walking arrow.</html:li>
  <html:li>For any <fr:tex display="inline"><![CDATA[n,m]]></fr:tex>, consider the graph built of a length <fr:tex display="inline"><![CDATA[n]]></fr:tex> path and a length <fr:tex display="inline"><![CDATA[m]]></fr:tex> path, with their source and targets identified. Then the <html:strong>equation generator</html:strong> for <fr:tex display="inline"><![CDATA[n,m]]></fr:tex> is the sketch inclusion from the free sketch on that graph to the sketch on that graph where the two paths are equated.</html:li>
  <html:li>For any finite graph <fr:tex display="inline"><![CDATA[J]]></fr:tex>, <html:strong>cone generator</html:strong> on <fr:tex display="inline"><![CDATA[J]]></fr:tex> is the sketch inclusion from the free sketch on <fr:tex display="inline"><![CDATA[\mathsf {cone}(J)]]></fr:tex> to the sketch with underlying graph <fr:tex display="inline"><![CDATA[\mathsf {cone}(J)]]></fr:tex> where the identity is a cone.</html:li></html:ol><html:p>Then a <html:strong>sketch complex</html:strong> <fr:tex display="inline"><![CDATA[P]]></fr:tex> is a sequence <fr:tex display="inline"><![CDATA[\emptyset  = P_0 \to  P_1 \to  \cdots  \to  P_n]]></fr:tex>, where each morphism <fr:tex display="inline"><![CDATA[P_i \to  P_{i + 1}]]></fr:tex> is given as a pushout against one of the generating sketch inclusions.</html:p>



<html:figure><fr:resource hash="2f4587ced0e0ba8f209ef3a416953033"><fr:resource-content><html:img src="https://forest.topos.site/2f4587ced0e0ba8f209ef3a416953033.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[

\usepackage[utf8]{inputenc}
\DeclareFontFamily{U}{min}{}
\DeclareFontShape{U}{min}{m}{n}{<-> udmj30}{}
\newcommand\yo{\!\text{\usefont{U}{min}{m}{n}\symbol{'207}}\!}
\DeclareUnicodeCharacter{3088}{\yo}


\usepackage{tikz, tikz-cd, mathtools, amssymb, stmaryrd,xcolor}
\usetikzlibrary{matrix,arrows}
\usetikzlibrary{backgrounds,fit,positioning,calc,shapes}
\usetikzlibrary{decorations.pathreplacing}
\usetikzlibrary{decorations.pathmorphing}
\usetikzlibrary{decorations.markings}

% `tikz-cd` is necessary to draw commutative diagrams.
\RequirePackage{tikz-cd}
% `amssymb` is necessary for `\lrcorner` and `\ulcorner`.
\RequirePackage{amssymb}
% `calc` is necessary to draw curved arrows.
\usetikzlibrary{calc}
% `pathmorphing` is necessary to draw squiggly arrows.
\usetikzlibrary{decorations.pathmorphing}
% `spath3` is necessary to draw shortened edges.
\usetikzlibrary{spath3}

% A TikZ style for curved arrows of a fixed height, due to AndréC.
\tikzset{curve/.style={settings={#1},to path={(\tikztostart)
    .. controls ($(\tikztostart)!\pv{pos}!(\tikztotarget)!\pv{height}!270:(\tikztotarget)$)
    and ($(\tikztostart)!1-\pv{pos}!(\tikztotarget)!\pv{height}!270:(\tikztotarget)$)
    .. (\tikztotarget)\tikztonodes}},
    settings/.code={\tikzset{quiver/.cd,#1}
        \def\pv##1{\pgfkeysvalueof{/tikz/quiver/##1}}},
    quiver/.cd,pos/.initial=0.35,height/.initial=0}

% A TikZ style for shortening paths without the poor behaviour of `shorten <' and `shorten >'.
\tikzset{between/.style n args={2}{/tikz/spath/at end path construction={
    \tikzset{spath/split at keep middle={current}{#1}{#2}}
}}}

% TikZ arrowhead/tail styles.
\tikzset{tail reversed/.code={\pgfsetarrowsstart{tikzcd to}}}
\tikzset{2tail/.code={\pgfsetarrowsstart{Implies[reversed]}}}
\tikzset{2tail reversed/.code={\pgfsetarrowsstart{Implies}}}
% TikZ arrow styles.
\tikzset{no body/.style={/tikz/dash pattern=on 0 off 1mm}}


\newcommand{\triplecolon}{%
  \mathrel{\vbox{\baselineskip=2pt \hbox{.}\hbox{.}\hbox{.}}}%
}

\DeclareUnicodeCharacter{2AF6}{\triplecolon}
\usepackage{mathpartir}

]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[
\begin {tikzcd}
	{G_i} & {P_i} \\
	{\hat {G}_i} & {P_{i+1}}
	\arrow [from=1-1, to=1-2]
	\arrow [from=1-1, to=2-1]
	\arrow [from=1-2, to=2-2]
	\arrow [from=2-1, to=2-2]
	\arrow ["\lrcorner "{anchor=center, pos=0.125, rotate=180}, draw=none, from=2-2, to=1-1]
\end {tikzcd}
]]></fr:resource-source></fr:resource></html:figure>

<html:p>The sketch presented by a sketch complex is simply the last sketch, which we denote as <fr:tex display="inline"><![CDATA[P_\blacksquare ]]></fr:tex>.</html:p></fr:mainmatter>
            </fr:tree>
            <fr:tree show-metadata="false">
              <fr:frontmatter>
                <fr:authors>
                  <fr:author>
                    <fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link>
                  </fr:author>
                </fr:authors>
                <fr:date>
                  <fr:year>2025</fr:year>
                  <fr:month>3</fr:month>
                  <fr:day>14</fr:day>
                </fr:date>
                <fr:uri>https://forest.topos.site/ocl-00B2/</fr:uri>
                <fr:display-uri>https://forest.topos.site/ocl-00B2</fr:display-uri>
                <fr:route>/ocl-00B2/</fr:route>
                <fr:title text="Complex extensions">Complex extensions</fr:title>
                <fr:taxon>definition</fr:taxon>
              </fr:frontmatter>
              <fr:mainmatter>
                <html:p>A complex extension of a sketch complex <fr:tex display="inline"><![CDATA[P = P_0 \to  \cdots  \to  P_n]]></fr:tex> is another sketch complex <fr:tex display="inline"><![CDATA[Q]]></fr:tex> with <fr:tex display="inline"><![CDATA[P_i = Q_i]]></fr:tex> for <fr:tex display="inline"><![CDATA[0 \leq  i \leq  n]]></fr:tex>. Note that complex extensions induce monomorphisms in the category of sketches.</html:p>
                <html:p>Often we will be lazy and say that a morphism of sketches <fr:tex display="inline"><![CDATA[S \to  T]]></fr:tex> is a presented extension; this means that there exists a presentation of <fr:tex display="inline"><![CDATA[S]]></fr:tex> and a presentation of <fr:tex display="inline"><![CDATA[T]]></fr:tex> such that the morphism is a presented extension. It is not hard to show that this is equivalent to <fr:tex display="inline"><![CDATA[S \to  T]]></fr:tex> being a mono.</html:p>
              </fr:mainmatter>
            </fr:tree>
            <fr:tree show-metadata="false">
              <fr:frontmatter>
                <fr:authors>
                  <fr:author>
                    <fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link>
                  </fr:author>
                </fr:authors>
                <fr:date>
                  <fr:year>2025</fr:year>
                  <fr:month>3</fr:month>
                  <fr:day>19</fr:day>
                </fr:date>
                <fr:uri>https://forest.topos.site/ocl-00BW/</fr:uri>
                <fr:display-uri>https://forest.topos.site/ocl-00BW</fr:display-uri>
                <fr:route>/ocl-00BW/</fr:route>
                <fr:title text="Finitely presented lex categories">Finitely presented lex categories</fr:title>
                <fr:taxon>definition</fr:taxon>
              </fr:frontmatter>
              <fr:mainmatter>
                <html:p>A lex category is finitely presented if it is the realization of a finite sketch.</html:p>
                <html:p>Note that the category of finite sketches and Kleisli morphisms for realization is equivalent to the category of finitely presented lex categories.</html:p>
              </fr:mainmatter>
            </fr:tree>
            <fr:tree show-metadata="false">
              <fr:frontmatter>
                <fr:authors>
                  <fr:author>
                    <fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link>
                  </fr:author>
                </fr:authors>
                <fr:date>
                  <fr:year>2025</fr:year>
                  <fr:month>3</fr:month>
                  <fr:day>19</fr:day>
                </fr:date>
                <fr:uri>https://forest.topos.site/ocl-00BV/</fr:uri>
                <fr:display-uri>https://forest.topos.site/ocl-00BV</fr:display-uri>
                <fr:route>/ocl-00BV/</fr:route>
                <fr:title text="All Kleisli morphisms of sketches are equivalent to complex extensions">All Kleisli morphisms of sketches are equivalent to complex extensions</fr:title>
                <fr:taxon>theorem</fr:taxon>
              </fr:frontmatter>
              <fr:mainmatter>
                <html:p>Given a Kleisli morphism for <fr:tex display="inline"><![CDATA[\mathcal {R}]]></fr:tex> between sketche complexes <fr:tex display="inline"><![CDATA[S_1 \to  S_2]]></fr:tex> we can produce a sketch extension <fr:tex display="inline"><![CDATA[S_2']]></fr:tex> of <fr:tex display="inline"><![CDATA[S_1]]></fr:tex> such that <fr:tex display="inline"><![CDATA[S_2]]></fr:tex> and <fr:tex display="inline"><![CDATA[S_2']]></fr:tex> are isomorphic as objects of the coslice category under <fr:tex display="inline"><![CDATA[S_1]]></fr:tex>.</html:p>
                <html:p>The idea here is similar in spirit to cylinder objects in topology. We first construct the sketch <fr:tex display="inline"><![CDATA[S_1 \sqcup  S_2]]></fr:tex>, which is a sketch extension of <fr:tex display="inline"><![CDATA[S_1]]></fr:tex>. Then, we identify the vertices in <fr:tex display="inline"><![CDATA[S_1]]></fr:tex> with their images in <fr:tex display="inline"><![CDATA[\mathcal {R}(S_2)]]></fr:tex>, which can be added to <fr:tex display="inline"><![CDATA[S_2]]></fr:tex> via finitely many cones, and we identify the edges in <fr:tex display="inline"><![CDATA[S_1]]></fr:tex> with their images in <fr:tex display="inline"><![CDATA[\mathcal {R}(S_2)]]></fr:tex>, which similarly may be added to <fr:tex display="inline"><![CDATA[S_2]]></fr:tex> by finitely many equated paths. We are done.</html:p>
              </fr:mainmatter>
            </fr:tree>
            <fr:tree show-metadata="false">
              <fr:frontmatter>
                <fr:authors>
                  <fr:author>
                    <fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link>
                  </fr:author>
                </fr:authors>
                <fr:date>
                  <fr:year>2025</fr:year>
                  <fr:month>3</fr:month>
                  <fr:day>19</fr:day>
                </fr:date>
                <fr:uri>https://forest.topos.site/ocl-00BU/</fr:uri>
                <fr:display-uri>https://forest.topos.site/ocl-00BU</fr:display-uri>
                <fr:route>/ocl-00BU/</fr:route>
                <fr:title text="Theories are complex extensions">Theories are complex extensions</fr:title>
                <fr:taxon>interpretation</fr:taxon>
              </fr:frontmatter>
              <fr:mainmatter>
                <html:p>Before, we identified theories with general lex functors out of contexts. As long as we are willing to restrict to lex categories presented by finite sketches, then <fr:link href="/ocl-00BV/" title="All Kleisli morphisms of sketches are equivalent to complex extensions" uri="https://forest.topos.site/ocl-00BV/" display-uri="https://forest.topos.site/ocl-00BV" type="local">theorem <fr:contextual-number uri="https://forest.topos.site/ocl-00BV/" display-uri="https://forest.topos.site/ocl-00BV" /></fr:link> says that it is not a significant restriction to assume that theories correspond to complex extensions.</html:p>
                <html:p>If we want to work with general lex categories, then we must be slightly more careful. We say that a morphism of lex categories is <html:em>finite</html:em> if it can be presented by a finite sequence of pushouts against the generating sketch inclusions of <fr:link href="/ocl-00AZ/" title="Sketch complex" uri="https://forest.topos.site/ocl-00AZ/" display-uri="https://forest.topos.site/ocl-00AZ" type="local">definition <fr:contextual-number uri="https://forest.topos.site/ocl-00AZ/" display-uri="https://forest.topos.site/ocl-00AZ" /></fr:link>, in <fr:tex display="inline"><![CDATA[\mathcal {L}\mathsf {ex}]]></fr:tex>, however, rather than <fr:tex display="inline"><![CDATA[\mathsf {Sketch}]]></fr:tex>. Then we interpret theories as finite morphisms out of the context. Everything essentially then works in the same way as when we assumed all lex categories were presented by finite sketches (in which case all morphisms are bounded), so we make the assumption that all lex categories are presented by finite sketches in the remainder of the paper.</html:p>
              </fr:mainmatter>
            </fr:tree>
            <fr:tree show-metadata="false">
              <fr:frontmatter>
                <fr:authors>
                  <fr:author>
                    <fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link>
                  </fr:author>
                </fr:authors>
                <fr:date>
                  <fr:year>2025</fr:year>
                  <fr:month>3</fr:month>
                  <fr:day>19</fr:day>
                </fr:date>
                <fr:uri>https://forest.topos.site/ocl-00BX/</fr:uri>
                <fr:display-uri>https://forest.topos.site/ocl-00BX</fr:display-uri>
                <fr:route>/ocl-00BX/</fr:route>
                <fr:title text="Etale objects of \mathcal {L}\mathsf {ex}^{\mathsf {op}} /\mathsf {L} are exponentiable">Etale objects of <fr:tex display="inline"><![CDATA[\mathcal {L}\mathsf {ex}^{\mathsf {op}} /\mathsf {L}]]></fr:tex> are exponentiable</fr:title>
                <fr:taxon>theorem</fr:taxon>
              </fr:frontmatter>
              <fr:mainmatter>
                <html:p>First, recale that an etale object of <fr:tex display="inline"><![CDATA[\mathcal {L}\mathsf {ex}^{\mathsf {op}} /\mathsf {L}]]></fr:tex> corresponds to the lex functor <fr:tex display="inline"><![CDATA[\mathsf {L} \to  \mathsf {L}/A]]></fr:tex> for an object <fr:tex display="inline"><![CDATA[A]]></fr:tex> of <fr:tex display="inline"><![CDATA[\mathsf {L}]]></fr:tex>.</html:p>
                <html:p>We can prove that this is exponentiable in two ways; one by an explicit construction using complex extensions, and one that follows more closely to Johnstone's proof in B4.3.1 of <fr:link href="/johnstone-2002-sketches/" title="Sketches of an Elephant A Topos Theory Compendium" uri="https://forest.topos.site/johnstone-2002-sketches/" display-uri="https://forest.topos.site/johnstone-2002-sketches" type="local">Reference <fr:contextual-number uri="https://forest.topos.site/johnstone-2002-sketches/" display-uri="https://forest.topos.site/johnstone-2002-sketches" /></fr:link>.</html:p>
                <html:p>We start with the more explicit construction.</html:p>
                <fr:tree show-metadata="false">
                  <fr:frontmatter>
                    <fr:authors>
                      <fr:author>
                        <fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link>
                      </fr:author>
                    </fr:authors>
                    <fr:date>
                      <fr:year>2025</fr:year>
                      <fr:month>3</fr:month>
                      <fr:day>19</fr:day>
                    </fr:date>
                    <fr:uri>https://forest.topos.site/ocl-00BZ/</fr:uri>
                    <fr:display-uri>https://forest.topos.site/ocl-00BZ</fr:display-uri>
                    <fr:route>/ocl-00BZ/</fr:route>
                    <fr:taxon>proof</fr:taxon>
                  </fr:frontmatter>
                  <fr:mainmatter><html:p>Given a complex extension <fr:tex display="inline"><![CDATA[P \to  Q]]></fr:tex> and an object <fr:tex display="inline"><![CDATA[A]]></fr:tex> of <fr:tex display="inline"><![CDATA[\mathcal {R}{P}]]></fr:tex>, we wish to produce a new complex extension <fr:tex display="inline"><![CDATA[P \to  Q^A]]></fr:tex> such that for any extension <fr:tex display="inline"><![CDATA[P \to  R]]></fr:tex>, there is a bijection</html:p>



<html:figure><fr:resource hash="d20f30c31705f00673a0893e4de857b8"><fr:resource-content><html:img src="https://forest.topos.site/d20f30c31705f00673a0893e4de857b8.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[

\usepackage[utf8]{inputenc}
\DeclareFontFamily{U}{min}{}
\DeclareFontShape{U}{min}{m}{n}{<-> udmj30}{}
\newcommand\yo{\!\text{\usefont{U}{min}{m}{n}\symbol{'207}}\!}
\DeclareUnicodeCharacter{3088}{\yo}


\usepackage{tikz, tikz-cd, mathtools, amssymb, stmaryrd,xcolor}
\usetikzlibrary{matrix,arrows}
\usetikzlibrary{backgrounds,fit,positioning,calc,shapes}
\usetikzlibrary{decorations.pathreplacing}
\usetikzlibrary{decorations.pathmorphing}
\usetikzlibrary{decorations.markings}

% `tikz-cd` is necessary to draw commutative diagrams.
\RequirePackage{tikz-cd}
% `amssymb` is necessary for `\lrcorner` and `\ulcorner`.
\RequirePackage{amssymb}
% `calc` is necessary to draw curved arrows.
\usetikzlibrary{calc}
% `pathmorphing` is necessary to draw squiggly arrows.
\usetikzlibrary{decorations.pathmorphing}
% `spath3` is necessary to draw shortened edges.
\usetikzlibrary{spath3}

% A TikZ style for curved arrows of a fixed height, due to AndréC.
\tikzset{curve/.style={settings={#1},to path={(\tikztostart)
    .. controls ($(\tikztostart)!\pv{pos}!(\tikztotarget)!\pv{height}!270:(\tikztotarget)$)
    and ($(\tikztostart)!1-\pv{pos}!(\tikztotarget)!\pv{height}!270:(\tikztotarget)$)
    .. (\tikztotarget)\tikztonodes}},
    settings/.code={\tikzset{quiver/.cd,#1}
        \def\pv##1{\pgfkeysvalueof{/tikz/quiver/##1}}},
    quiver/.cd,pos/.initial=0.35,height/.initial=0}

% A TikZ style for shortening paths without the poor behaviour of `shorten <' and `shorten >'.
\tikzset{between/.style n args={2}{/tikz/spath/at end path construction={
    \tikzset{spath/split at keep middle={current}{#1}{#2}}
}}}

% TikZ arrowhead/tail styles.
\tikzset{tail reversed/.code={\pgfsetarrowsstart{tikzcd to}}}
\tikzset{2tail/.code={\pgfsetarrowsstart{Implies[reversed]}}}
\tikzset{2tail reversed/.code={\pgfsetarrowsstart{Implies}}}
% TikZ arrow styles.
\tikzset{no body/.style={/tikz/dash pattern=on 0 off 1mm}}


\newcommand{\triplecolon}{%
  \mathrel{\vbox{\baselineskip=2pt \hbox{.}\hbox{.}\hbox{.}}}%
}

\DeclareUnicodeCharacter{2AF6}{\triplecolon}
\usepackage{mathpartir}

]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[
\begin {tikzcd}
	{\mathcal {R}(R)/A} && {\mathcal {R}(Q)} & {\mathcal {R}(R)} && {\mathcal {R}(Q^A)} \\
	& {\mathcal {R}(P)} &&& {\mathcal {R}(P)}
	\arrow [from=1-3, to=1-1]
	\arrow [from=1-6, to=1-4]
	\arrow [from=2-2, to=1-1]
	\arrow [""{name=0, anchor=center, inner sep=0}, from=2-2, to=1-3]
	\arrow [""{name=1, anchor=center, inner sep=0}, from=2-5, to=1-4]
	\arrow [from=2-5, to=1-6]
	\arrow ["\cong "', draw=none, from=0, to=1]
\end {tikzcd}
]]></fr:resource-source></fr:resource></html:figure>

<html:p>Here we identify <fr:tex display="inline"><![CDATA[A]]></fr:tex> with its image in lex categories under <fr:tex display="inline"><![CDATA[\mathcal {R}(P)]]></fr:tex>.</html:p><html:p>We construct <fr:tex display="inline"><![CDATA[Q^A]]></fr:tex> by carefully considering what a morphism <fr:tex display="inline"><![CDATA[\mathcal {R}(Q) \to  \mathcal {R}(R)/A]]></fr:tex> over <fr:tex display="inline"><![CDATA[\mathcal {R}(P)]]></fr:tex> consists of.</html:p><html:p>Specifically:</html:p><html:ul><html:li>For every vertex that <fr:tex display="inline"><![CDATA[Q]]></fr:tex> adds to <fr:tex display="inline"><![CDATA[P]]></fr:tex>, we must pick out an object of <fr:tex display="inline"><![CDATA[\mathcal {R}(R)]]></fr:tex> and a morphism into <fr:tex display="inline"><![CDATA[A]]></fr:tex>.</html:li>
  <html:li>For every edge that <fr:tex display="inline"><![CDATA[Q]]></fr:tex> adds to <fr:tex display="inline"><![CDATA[P]]></fr:tex>, we must pick out a triangle over <fr:tex display="inline"><![CDATA[A]]></fr:tex> in <fr:tex display="inline"><![CDATA[\mathcal {R}(R)]]></fr:tex></html:li></html:ul><html:p>Such that:</html:p><html:ul><html:li>Cones in <fr:tex display="inline"><![CDATA[Q]]></fr:tex> over the diagram shape <fr:tex display="inline"><![CDATA[I]]></fr:tex> are sent to cones in <fr:tex display="inline"><![CDATA[\mathcal {R}(R)]]></fr:tex> over the diagram shape <fr:tex display="inline"><![CDATA[\mathsf {cocone}(I)]]></fr:tex>.</html:li>
  <html:li>Equated paths in <fr:tex display="inline"><![CDATA[Q]]></fr:tex> are sent to equated paths in <fr:tex display="inline"><![CDATA[\mathcal {R}(R)]]></fr:tex> (no change)</html:li></html:ul><html:p>This can read directly into the construction of <fr:tex display="inline"><![CDATA[Q^A]]></fr:tex>.</html:p><html:p>That is, for each vertex <fr:tex display="inline"><![CDATA[v]]></fr:tex> that <fr:tex display="inline"><![CDATA[Q]]></fr:tex> adds to <fr:tex display="inline"><![CDATA[P]]></fr:tex>, we add a vertex <fr:tex display="inline"><![CDATA[v']]></fr:tex> to <fr:tex display="inline"><![CDATA[Q^A]]></fr:tex> along with an edge from that object to <fr:tex display="inline"><![CDATA[A]]></fr:tex> (which without loss of generality we may assume is already in <fr:tex display="inline"><![CDATA[P]]></fr:tex>).</html:p><html:p>Then for each vertex <fr:tex display="inline"><![CDATA[v]]></fr:tex> in <fr:tex display="inline"><![CDATA[Q]]></fr:tex>, let <fr:tex display="inline"><![CDATA[v^A]]></fr:tex> be <fr:tex display="inline"><![CDATA[A \times  v]]></fr:tex> if <fr:tex display="inline"><![CDATA[v]]></fr:tex> is in <fr:tex display="inline"><![CDATA[P]]></fr:tex>, and <fr:tex display="inline"><![CDATA[v']]></fr:tex> otherwise; there is always a canonical map <fr:tex display="inline"><![CDATA[v^A \to  A]]></fr:tex>.</html:p><html:p>For each edge <fr:tex display="inline"><![CDATA[e]]></fr:tex> that <fr:tex display="inline"><![CDATA[Q]]></fr:tex> adds to <fr:tex display="inline"><![CDATA[P]]></fr:tex> from <fr:tex display="inline"><![CDATA[v]]></fr:tex> to <fr:tex display="inline"><![CDATA[w]]></fr:tex>, then add an edge <fr:tex display="inline"><![CDATA[e^A]]></fr:tex> <fr:tex display="inline"><![CDATA[v^A \to  v_W]]></fr:tex> and an equated path making the following commute:</html:p>



<html:figure><fr:resource hash="1613b114029a0fa6d2f3d306d9805f02"><fr:resource-content><html:img src="https://forest.topos.site/1613b114029a0fa6d2f3d306d9805f02.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[

\usepackage[utf8]{inputenc}
\DeclareFontFamily{U}{min}{}
\DeclareFontShape{U}{min}{m}{n}{<-> udmj30}{}
\newcommand\yo{\!\text{\usefont{U}{min}{m}{n}\symbol{'207}}\!}
\DeclareUnicodeCharacter{3088}{\yo}


\usepackage{tikz, tikz-cd, mathtools, amssymb, stmaryrd,xcolor}
\usetikzlibrary{matrix,arrows}
\usetikzlibrary{backgrounds,fit,positioning,calc,shapes}
\usetikzlibrary{decorations.pathreplacing}
\usetikzlibrary{decorations.pathmorphing}
\usetikzlibrary{decorations.markings}

% `tikz-cd` is necessary to draw commutative diagrams.
\RequirePackage{tikz-cd}
% `amssymb` is necessary for `\lrcorner` and `\ulcorner`.
\RequirePackage{amssymb}
% `calc` is necessary to draw curved arrows.
\usetikzlibrary{calc}
% `pathmorphing` is necessary to draw squiggly arrows.
\usetikzlibrary{decorations.pathmorphing}
% `spath3` is necessary to draw shortened edges.
\usetikzlibrary{spath3}

% A TikZ style for curved arrows of a fixed height, due to AndréC.
\tikzset{curve/.style={settings={#1},to path={(\tikztostart)
    .. controls ($(\tikztostart)!\pv{pos}!(\tikztotarget)!\pv{height}!270:(\tikztotarget)$)
    and ($(\tikztostart)!1-\pv{pos}!(\tikztotarget)!\pv{height}!270:(\tikztotarget)$)
    .. (\tikztotarget)\tikztonodes}},
    settings/.code={\tikzset{quiver/.cd,#1}
        \def\pv##1{\pgfkeysvalueof{/tikz/quiver/##1}}},
    quiver/.cd,pos/.initial=0.35,height/.initial=0}

% A TikZ style for shortening paths without the poor behaviour of `shorten <' and `shorten >'.
\tikzset{between/.style n args={2}{/tikz/spath/at end path construction={
    \tikzset{spath/split at keep middle={current}{#1}{#2}}
}}}

% TikZ arrowhead/tail styles.
\tikzset{tail reversed/.code={\pgfsetarrowsstart{tikzcd to}}}
\tikzset{2tail/.code={\pgfsetarrowsstart{Implies[reversed]}}}
\tikzset{2tail reversed/.code={\pgfsetarrowsstart{Implies}}}
% TikZ arrow styles.
\tikzset{no body/.style={/tikz/dash pattern=on 0 off 1mm}}


\newcommand{\triplecolon}{%
  \mathrel{\vbox{\baselineskip=2pt \hbox{.}\hbox{.}\hbox{.}}}%
}

\DeclareUnicodeCharacter{2AF6}{\triplecolon}
\usepackage{mathpartir}

]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[
\begin {tikzcd}
	{v^A} && {w^A} \\
	& A
	\arrow ["e^A",from=1-1, to=1-3]
	\arrow [from=1-1, to=2-2]
	\arrow [from=1-3, to=2-2]
\end {tikzcd}
]]></fr:resource-source></fr:resource></html:figure>

<html:p>For each cone <fr:tex display="inline"><![CDATA[c]]></fr:tex> that <fr:tex display="inline"><![CDATA[Q]]></fr:tex> adds to <fr:tex display="inline"><![CDATA[P]]></fr:tex> of diagram shape <fr:tex display="inline"><![CDATA[I]]></fr:tex>, add a cone <fr:tex display="inline"><![CDATA[c^A]]></fr:tex> of diagram shape <fr:tex display="inline"><![CDATA[\mathsf {cocone}{I}]]></fr:tex> by adding in all of the canonical maps <fr:tex display="inline"><![CDATA[v^A \to  A]]></fr:tex> for every vertex <fr:tex display="inline"><![CDATA[v]]></fr:tex> in the original diagram.</html:p><html:p>Finally, for each equated path that <fr:tex display="inline"><![CDATA[Q]]></fr:tex> adds to <fr:tex display="inline"><![CDATA[P]]></fr:tex>, add the corresponding equated path with vertices <fr:tex display="inline"><![CDATA[v]]></fr:tex> replaced by <fr:tex display="inline"><![CDATA[v^A]]></fr:tex> and edges <fr:tex display="inline"><![CDATA[e]]></fr:tex> replaced by <fr:tex display="inline"><![CDATA[e^A]]></fr:tex>.</html:p><html:p>By the discussion earlier, one can see that a morphism from <fr:tex display="inline"><![CDATA[\mathcal {R}(Q^A)]]></fr:tex> to <fr:tex display="inline"><![CDATA[\mathcal {R}(R)]]></fr:tex> over <fr:tex display="inline"><![CDATA[\mathcal {R}(P)]]></fr:tex> is equivalent to a morphism from <fr:tex display="inline"><![CDATA[\mathcal {R}(Q)]]></fr:tex> itno <fr:tex display="inline"><![CDATA[\mathcal {R}(R)/A]]></fr:tex>, and we are done.</html:p></fr:mainmatter>
                </fr:tree>
                <fr:tree show-metadata="false">
                  <fr:frontmatter>
                    <fr:authors>
                      <fr:author>
                        <fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link>
                      </fr:author>
                    </fr:authors>
                    <fr:date>
                      <fr:year>2025</fr:year>
                      <fr:month>3</fr:month>
                      <fr:day>19</fr:day>
                    </fr:date>
                    <fr:uri>https://forest.topos.site/ocl-00C0/</fr:uri>
                    <fr:display-uri>https://forest.topos.site/ocl-00C0</fr:display-uri>
                    <fr:route>/ocl-00C0/</fr:route>
                    <fr:taxon>proof</fr:taxon>
                  </fr:frontmatter>
                  <fr:mainmatter>
                    <html:p>This proof more closely follows B4.3.1 in Johnstone.</html:p>
                    <html:p>The idea is the following. We first show given a lex category <fr:tex display="inline"><![CDATA[\mathsf {L}]]></fr:tex> and an object <fr:tex display="inline"><![CDATA[\mathsf {M} \colon  \mathcal {L}\mathsf {ex} /\mathsf {L}]]></fr:tex>, <fr:tex display="inline"><![CDATA[\mathsf {M}]]></fr:tex> is exponentiable if and only if there exists the specific exponential object <fr:tex display="inline"><![CDATA[\mathsf {L}[O]^\mathsf {M}]]></fr:tex> exists, where <fr:tex display="inline"><![CDATA[\mathsf {L}[O]]]></fr:tex> is the object classifier over <fr:tex display="inline"><![CDATA[\mathsf {L}]]></fr:tex>. We will then show that in the case <fr:tex display="inline"><![CDATA[\mathsf {M} = \mathsf {L}/A]]></fr:tex>, then this specific exponential does exist.</html:p>
                    <html:p>Now, for the first part, the only if direction is trivial, so the important direction is the if. Suppose that <fr:tex display="inline"><![CDATA[\mathsf {L}[O]^\mathsf {M}]]></fr:tex> exists, and let <fr:tex display="inline"><![CDATA[\mathsf {N}]]></fr:tex> be another lex category over <fr:tex display="inline"><![CDATA[\mathsf {L}]]></fr:tex>. Then we assume that <fr:tex display="inline"><![CDATA[\mathsf {N}]]></fr:tex> corresponds to a <fr:link href="/ocl-00B2/" title="Complex extensions" uri="https://forest.topos.site/ocl-00B2/" display-uri="https://forest.topos.site/ocl-00B2" type="local">complex extension</fr:link> of <fr:tex display="inline"><![CDATA[\mathsf {L}]]></fr:tex>, and work inductively over the elements added to <fr:tex display="inline"><![CDATA[\mathsf {L}]]></fr:tex>.</html:p>
                    <html:p>Specifically, suppose that we have an exponential object <fr:tex display="inline"><![CDATA[\mathsf {N}^\mathsf {M}]]></fr:tex>, and that <fr:tex display="inline"><![CDATA[\mathsf {N}']]></fr:tex> is a one-step extension of <fr:tex display="inline"><![CDATA[\mathsf {N}]]></fr:tex>. Then <fr:tex display="inline"><![CDATA[\mathsf {N}']]></fr:tex> is derived from <fr:tex display="inline"><![CDATA[\mathsf {N}]]></fr:tex> by a pushout along one of the <fr:link href="/ocl-00AZ/" title="Sketch complex" uri="https://forest.topos.site/ocl-00AZ/" display-uri="https://forest.topos.site/ocl-00AZ" type="local">generating sketch inclusions</fr:link>. We consider each of the generating sketch inclusions separately.</html:p>
                    <html:ul><html:li>In the case of the vertex generator, then <fr:tex display="inline"><![CDATA[\mathsf {N}' = \mathsf {N} + \mathsf {L}[O]]]></fr:tex>. As exponentials commute with limits (and coproduct is product in the opposite category), we have <fr:tex display="inline"><![CDATA[\mathsf {N}'^\mathsf {M} = \mathsf {N}^\mathsf {M} + \mathsf {L}[O]^\mathsf {M}]]></fr:tex>.</html:li>
  <html:li>In the case of the edge generator, then we can compute <fr:tex display="inline"><![CDATA[\mathsf {N}']]></fr:tex> as the coinserter of
  



<html:figure><fr:resource hash="06dc2b7ebdfc0af5578f0d99968e5249"><fr:resource-content><html:img src="https://forest.topos.site/06dc2b7ebdfc0af5578f0d99968e5249.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[

\usepackage[utf8]{inputenc}
\DeclareFontFamily{U}{min}{}
\DeclareFontShape{U}{min}{m}{n}{<-> udmj30}{}
\newcommand\yo{\!\text{\usefont{U}{min}{m}{n}\symbol{'207}}\!}
\DeclareUnicodeCharacter{3088}{\yo}


\usepackage{tikz, tikz-cd, mathtools, amssymb, stmaryrd,xcolor}
\usetikzlibrary{matrix,arrows}
\usetikzlibrary{backgrounds,fit,positioning,calc,shapes}
\usetikzlibrary{decorations.pathreplacing}
\usetikzlibrary{decorations.pathmorphing}
\usetikzlibrary{decorations.markings}

% `tikz-cd` is necessary to draw commutative diagrams.
\RequirePackage{tikz-cd}
% `amssymb` is necessary for `\lrcorner` and `\ulcorner`.
\RequirePackage{amssymb}
% `calc` is necessary to draw curved arrows.
\usetikzlibrary{calc}
% `pathmorphing` is necessary to draw squiggly arrows.
\usetikzlibrary{decorations.pathmorphing}
% `spath3` is necessary to draw shortened edges.
\usetikzlibrary{spath3}

% A TikZ style for curved arrows of a fixed height, due to AndréC.
\tikzset{curve/.style={settings={#1},to path={(\tikztostart)
    .. controls ($(\tikztostart)!\pv{pos}!(\tikztotarget)!\pv{height}!270:(\tikztotarget)$)
    and ($(\tikztostart)!1-\pv{pos}!(\tikztotarget)!\pv{height}!270:(\tikztotarget)$)
    .. (\tikztotarget)\tikztonodes}},
    settings/.code={\tikzset{quiver/.cd,#1}
        \def\pv##1{\pgfkeysvalueof{/tikz/quiver/##1}}},
    quiver/.cd,pos/.initial=0.35,height/.initial=0}

% A TikZ style for shortening paths without the poor behaviour of `shorten <' and `shorten >'.
\tikzset{between/.style n args={2}{/tikz/spath/at end path construction={
    \tikzset{spath/split at keep middle={current}{#1}{#2}}
}}}

% TikZ arrowhead/tail styles.
\tikzset{tail reversed/.code={\pgfsetarrowsstart{tikzcd to}}}
\tikzset{2tail/.code={\pgfsetarrowsstart{Implies[reversed]}}}
\tikzset{2tail reversed/.code={\pgfsetarrowsstart{Implies}}}
% TikZ arrow styles.
\tikzset{no body/.style={/tikz/dash pattern=on 0 off 1mm}}


\newcommand{\triplecolon}{%
  \mathrel{\vbox{\baselineskip=2pt \hbox{.}\hbox{.}\hbox{.}}}%
}

\DeclareUnicodeCharacter{2AF6}{\triplecolon}
\usepackage{mathpartir}

]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[
  \begin {tikzcd}
	{\mathsf {N}} & {\mathsf {L}[O]}
	\arrow ["f", curve={height=-6pt}, from=1-2, to=1-1]
	\arrow ["g"', curve={height=6pt}, from=1-2, to=1-1]
\end {tikzcd}
  ]]></fr:resource-source></fr:resource></html:figure>


  where <fr:tex display="inline"><![CDATA[f]]></fr:tex> and <fr:tex display="inline"><![CDATA[g]]></fr:tex> pick out the source and target of an edge. Thus, again as exponentials commute with limits, <fr:tex display="inline"><![CDATA[\mathsf {N}'^{\mathsf {M}}]]></fr:tex> is given by the coinserter of




<html:figure><fr:resource hash="7f72c10eea3f4afcd22028f96a37fecf"><fr:resource-content><html:img src="https://forest.topos.site/7f72c10eea3f4afcd22028f96a37fecf.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[

\usepackage[utf8]{inputenc}
\DeclareFontFamily{U}{min}{}
\DeclareFontShape{U}{min}{m}{n}{<-> udmj30}{}
\newcommand\yo{\!\text{\usefont{U}{min}{m}{n}\symbol{'207}}\!}
\DeclareUnicodeCharacter{3088}{\yo}


\usepackage{tikz, tikz-cd, mathtools, amssymb, stmaryrd,xcolor}
\usetikzlibrary{matrix,arrows}
\usetikzlibrary{backgrounds,fit,positioning,calc,shapes}
\usetikzlibrary{decorations.pathreplacing}
\usetikzlibrary{decorations.pathmorphing}
\usetikzlibrary{decorations.markings}

% `tikz-cd` is necessary to draw commutative diagrams.
\RequirePackage{tikz-cd}
% `amssymb` is necessary for `\lrcorner` and `\ulcorner`.
\RequirePackage{amssymb}
% `calc` is necessary to draw curved arrows.
\usetikzlibrary{calc}
% `pathmorphing` is necessary to draw squiggly arrows.
\usetikzlibrary{decorations.pathmorphing}
% `spath3` is necessary to draw shortened edges.
\usetikzlibrary{spath3}

% A TikZ style for curved arrows of a fixed height, due to AndréC.
\tikzset{curve/.style={settings={#1},to path={(\tikztostart)
    .. controls ($(\tikztostart)!\pv{pos}!(\tikztotarget)!\pv{height}!270:(\tikztotarget)$)
    and ($(\tikztostart)!1-\pv{pos}!(\tikztotarget)!\pv{height}!270:(\tikztotarget)$)
    .. (\tikztotarget)\tikztonodes}},
    settings/.code={\tikzset{quiver/.cd,#1}
        \def\pv##1{\pgfkeysvalueof{/tikz/quiver/##1}}},
    quiver/.cd,pos/.initial=0.35,height/.initial=0}

% A TikZ style for shortening paths without the poor behaviour of `shorten <' and `shorten >'.
\tikzset{between/.style n args={2}{/tikz/spath/at end path construction={
    \tikzset{spath/split at keep middle={current}{#1}{#2}}
}}}

% TikZ arrowhead/tail styles.
\tikzset{tail reversed/.code={\pgfsetarrowsstart{tikzcd to}}}
\tikzset{2tail/.code={\pgfsetarrowsstart{Implies[reversed]}}}
\tikzset{2tail reversed/.code={\pgfsetarrowsstart{Implies}}}
% TikZ arrow styles.
\tikzset{no body/.style={/tikz/dash pattern=on 0 off 1mm}}


\newcommand{\triplecolon}{%
  \mathrel{\vbox{\baselineskip=2pt \hbox{.}\hbox{.}\hbox{.}}}%
}

\DeclareUnicodeCharacter{2AF6}{\triplecolon}
\usepackage{mathpartir}

]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[
  \begin {tikzcd}
	{\mathsf {N}^{\mathsf {M}}} & {\mathsf {L}[O]^{\mathsf {M}}}
	\arrow ["{f^{\mathsf {M}}}", curve={height=-6pt}, from=1-2, to=1-1]
	\arrow ["{g^{\mathsf {M}}}"', curve={height=6pt}, from=1-2, to=1-1]
\end {tikzcd}
  ]]></fr:resource-source></fr:resource></html:figure></html:li>
  <html:li>Adding a cone may be seen as making the canonical morphism into the limit of a diagram an isomorphism, which is an inverter, thus the same argument as before obtains.</html:li>
  <html:li>Finally, adding an equated path corresponds to an equifier.</html:li></html:ul>
                    <html:p>This concludes the first part.</html:p>
                    <html:p>For the second part, we need to show that <fr:tex display="inline"><![CDATA[\mathsf {L}[O]^{\mathsf {L}/A}]]></fr:tex> exists. But this is just the theory of an object with a morphism into <fr:tex display="inline"><![CDATA[A]]></fr:tex>, which can be seen as a special case of the reasoning in <fr:link href="/ocl-00BZ/" title="https://forest.topos.site/ocl-00BZ/" uri="https://forest.topos.site/ocl-00BZ/" display-uri="https://forest.topos.site/ocl-00BZ" type="local">proof <fr:contextual-number uri="https://forest.topos.site/ocl-00BZ/" display-uri="https://forest.topos.site/ocl-00BZ" /></fr:link>, so we are done.</html:p>
                  </fr:mainmatter>
                </fr:tree>
              </fr:mainmatter>
            </fr:tree>
            <html:p>This concludes the technical exposition of the interpretation into lex categories and lex functors. It may be worthwhile to the reader to work out pi theories in some simple cases. For instance, show that if <fr:tex display="inline"><![CDATA[\Gamma  \,\vdash \, A \,\,\mathsf {type}^{\bullet }]]></fr:tex> and <fr:tex display="inline"><![CDATA[\Gamma  \,\vdash \, B \,\,\mathsf {type}^{\bullet }]]></fr:tex>, then the sketch for <fr:tex display="inline"><![CDATA[\Gamma , f \colon  (x \mathpunct {\,{\raisebox {-0.03em}{${\scriptscriptstyle  \bullet }$}} \mathllap {\raisebox {0.28em}{${\scriptscriptstyle  \bullet }$}}\,} A) \to  B]]></fr:tex> is precisely the sketch for <fr:tex display="inline"><![CDATA[\Gamma ]]></fr:tex> with an edge inserted between <fr:tex display="inline"><![CDATA[A]]></fr:tex> and <fr:tex display="inline"><![CDATA[B]]></fr:tex> (and <fr:tex display="inline"><![CDATA[A]]></fr:tex> and <fr:tex display="inline"><![CDATA[B]]></fr:tex> added as cones if they don't already exist).</html:p>
          </fr:mainmatter>
        </fr:tree>
        <fr:tree show-metadata="false">
          <fr:frontmatter>
            <fr:authors />
            <fr:date>
              <fr:year>2025</fr:year>
              <fr:month>2</fr:month>
              <fr:day>28</fr:day>
            </fr:date>
            <fr:uri>https://forest.topos.site/ocl-007H/</fr:uri>
            <fr:display-uri>https://forest.topos.site/ocl-007H</fr:display-uri>
            <fr:route>/ocl-007H/</fr:route>
            <fr:title text="Adapting Coquand's algorithm to the two-level setting">Adapting Coquand's algorithm to the two-level setting</fr:title>
          </fr:frontmatter>
          <fr:mainmatter>
            <html:p>Of necessity, this section is more in the style of “developer notes” than it is a full exposition. We assume familiarity with the basic algorithm for bidirectional elaboration with normalization by evaluation, tutorials for which can be found in <fr:link href="/christiansen-2018-checking/" title="Checking Dependent Types with Normalization by Evaluation: A Tutorial" uri="https://forest.topos.site/christiansen-2018-checking/" display-uri="https://forest.topos.site/christiansen-2018-checking" type="local">Reference <fr:contextual-number uri="https://forest.topos.site/christiansen-2018-checking/" display-uri="https://forest.topos.site/christiansen-2018-checking" /></fr:link> or <fr:link href="/kovacs-2026-elaborationzoo/" title="elaboration-zoo" uri="https://forest.topos.site/kovacs-2026-elaborationzoo/" display-uri="https://forest.topos.site/kovacs-2026-elaborationzoo" type="local">Reference <fr:contextual-number uri="https://forest.topos.site/kovacs-2026-elaborationzoo/" display-uri="https://forest.topos.site/kovacs-2026-elaborationzoo" /></fr:link>, and the original reference for which is <fr:link href="/coquand-1996-algorithm/" title="An algorithm for type-checking dependent types" uri="https://forest.topos.site/coquand-1996-algorithm/" display-uri="https://forest.topos.site/coquand-1996-algorithm" type="local">Reference <fr:contextual-number uri="https://forest.topos.site/coquand-1996-algorithm/" display-uri="https://forest.topos.site/coquand-1996-algorithm" /></fr:link>.</html:p>
            <html:p>This is likely not terribly different from the implementation of 2ltt in <fr:link href="/kovács-2022-staged/" title="Staged compilation with two-level type theory" uri="https://forest.topos.site/kovács-2022-staged/" display-uri="https://forest.topos.site/kovács-2022-staged" type="local">Reference <fr:contextual-number uri="https://forest.topos.site/kovács-2022-staged/" display-uri="https://forest.topos.site/kovács-2022-staged" /></fr:link>, as we are heavily influenced by Kovács' other type theory implementations, but we have not read carefully that implementation to give a careful contrast.</html:p>
            <html:p>The basic setup for Coquand's algorithm is something like the following.</html:p>
            <html:pre><![CDATA[-- the result of parsing
type RawStx = ...

-- typechecked syntax
type TmStx = ...
type TpStx = ...

-- values in a context
type TmVal = ...
type TpVal = ...

-- contexts, used for elaboration
type Ctx = [(Name, TmVal, TpVal)]

-- environments, used for evaluation
type Env = [TmVal]

-- evaluation
eval_tm : Env -> TmStx -> TmVal
eval_tp : Env -> TpStx -> TpVal

-- elaboration
tp : RawStx -> Ctx -> Maybe (TpStx, TpVal)
syn : RawStx -> Ctx -> Maybe (TmStx, TmVal, TpVal)
chk : RawStx -> Ctx -> TpVal -> Maybe (TmStx, TmVal)]]></html:pre>
            <html:p>Notice that we return <html:code>TmVal</html:code> and <html:code>TpVal</html:code> from <html:code>tp</html:code>, <html:code>syn</html:code> and <html:code>chk</html:code>, unlike the typical bidirectional elaboration setup; this corresponds to evaluating at the same time as elaborating. In theory, it would be most efficient to do this by returning a lazy value, in practice because we are in Rust we do not do this. Even though we evaluate at the same time as elaboration, we also need a separate evaluator, because we may re-evaluate typechecked syntax in different environments at other points in time.</html:p>
            <html:p>To make this into an elaborator for two-level type theory, we simply double everything.</html:p>
            <html:pre><![CDATA[type RawStx = ...

type EltStx = ...
type ModelStx = ...
type TypeStx = ...
type TheoryStx = ...

type EltVal = ...
type ModelVal = ...
type TypeVal = ...
type TheoryVal = ...

type Ctx = [(Name, ModelVal, TheoryVal)]
type Env = [ModelVal]

eval_elt : Env -> EltStx -> EltVal
eval_model : Env -> ModelStx -> ModelVal
eval_type : Env -> TypeStx -> TypeVal
eval_theory : Env -> TheoryStx -> TheoryVal

type_ : RawStx -> Ctx -> Maybe (TypeStx, TypeVal)
theory : RawStx -> Ctx -> Maybe (TheoryStx, TheoryVal)
syn_elt : RawStx -> Ctx -> Maybe (EltStx, EltVal, TypeVal)
chk_elt : RawStx -> Ctx -> TypeVal -> Maybe (EltStx, EltVal)
syn_model : RawStx -> Ctx -> Maybe (ModelStx, ModelVal, TheoryVal)
chk_model : RawStx -> Ctx -> TheoryVal -> Maybe (ModelStx, ModelVal)]]></html:pre>
            <html:p>Then we adapt various 2-theories into constructors for the various <html:code>-Val</html:code> types. For instance to handle <fr:link href="/ocl-00A1/" title="Inclusion of inner types into outer types" uri="https://forest.topos.site/ocl-00A1/" display-uri="https://forest.topos.site/ocl-00A1" type="local">§ <fr:contextual-number uri="https://forest.topos.site/ocl-00A1/" display-uri="https://forest.topos.site/ocl-00A1" /></fr:link>, we have an <html:code>Elt</html:code> constructor for <html:code>ModelVal</html:code>, which allows promotion of an element to a model, and a corresponding <html:code>Type</html:code> constructor for <html:code>TheoryVal</html:code>, which allows promotion of a type to a theory. This is what permits our definition of <html:code>Ctx</html:code> which only consists of models; we can always produce a model from an element.</html:p>
            <html:p>Similarly, we have constructors for record types, record theories, their elements and models, pi theories and lambdas, etc.</html:p>
            <html:p>Just as normal in normalization-by-evaluation, we have neutrals; the difference here is that we now have element neutrals and model neutrals.</html:p>
            <html:p>There is not much else special here, except for what we discuss in <fr:link href="/ocl-007G/" title="Integrating e-graphs into normalization-by-evaluation" uri="https://forest.topos.site/ocl-007G/" display-uri="https://forest.topos.site/ocl-007G" type="local">§ <fr:contextual-number uri="https://forest.topos.site/ocl-007G/" display-uri="https://forest.topos.site/ocl-007G" /></fr:link>.</html:p>
          </fr:mainmatter>
        </fr:tree>
        <fr:tree show-metadata="false">
          <fr:frontmatter>
            <fr:authors />
            <fr:date>
              <fr:year>2025</fr:year>
              <fr:month>2</fr:month>
              <fr:day>28</fr:day>
            </fr:date>
            <fr:uri>https://forest.topos.site/ocl-007G/</fr:uri>
            <fr:display-uri>https://forest.topos.site/ocl-007G</fr:display-uri>
            <fr:route>/ocl-007G/</fr:route>
            <fr:title text="Integrating e-graphs into normalization-by-evaluation">Integrating e-graphs into normalization-by-evaluation</fr:title>
          </fr:frontmatter>
          <fr:mainmatter><html:p>EMTT has two interesting features. The first is the two-level type theory, which we have discussed extensively. The second is the use of e-graphs to implement partial reconstruction of derivation trees in extensive type theory.</html:p><html:p>E-graphs are a data structure used to store a congruence relation over terms. We use the excellent egg implementation <fr:link href="/willsey-2021-egg/" title="egg: Fast and extensible equality saturation" uri="https://forest.topos.site/willsey-2021-egg/" display-uri="https://forest.topos.site/willsey-2021-egg" type="local">Reference <fr:contextual-number uri="https://forest.topos.site/willsey-2021-egg/" display-uri="https://forest.topos.site/willsey-2021-egg" /></fr:link>, and we encourage reading that paper to get a better introduction to e-graphs as a concept and as a data structure.</html:p><html:p>The key thing to understand here is precisely what feature of a typical type theory implementation we are forgoing in order to handle the fact that general extensive type theory is undecidable. We are forgoing <html:em>full derivation reconstruction from term syntax</html:em>. This seems like a bad thing. However, in practice this is already something that is given up in intensional type theory, because type annotations are required at certain points in order to make derivation reconstruction decidable. We claim that our approach to extensive type theory is analogous; sometimes one must bring certain equalities to the type checker's attention so that it may use them later on.</html:p><html:p>For instance, consider the following proofs of some lemmas about rings</html:p><html:pre><![CDATA[Lemmas[t: @type, R: RingOn[t]]: @theory = {
  `+ : [x: t, y: t] -> t := R.plus.op;
  zero : t := R.zero;
  neg : [x:t] -> t := R.neg;
  `* : [x: t, y: t] -> t := R.mul.op;
  one : t := R.one;

  neg_is_unique : [x: t, y: t, eq: x + y == zero] -> y == neg[x];

  mul_zero_is_zero: [x: t] -> x * zero == zero;

  negation_via_mul_neg_one: [x: t] -> neg[one] * x == neg[x];
};

LemmasImpl[t: @type, R: RingOn[t]]: Lemmas[t, R] = {
  neg_is_unique = [x, y, _] ↦ {
    nx = neg[x];
    R.plus.assoc[nx, x, y];
    R.plus.unit[nx];
    R.plus.unit[y];
    R.plus.comm[nx, zero];
    R.plus.comm[y, zero];
    R.plus.isinv[x];
    R.plus.comm[x, nx];
    @refl
  };

  mul_zero_is_zero = [x] ↦ {
    R.plus.unit[zero];
    R.dist[x, zero, zero];
    R.plus.assoc[x * zero, x * zero, neg[x * zero]];
    R.plus.isinv[x * zero];
    R.plus.unit[x * zero];
    @refl
  };

  negation_via_mul_neg_one = [x] ↦ {
    R.mul.unit[x];
    R.mul.comm[x, neg[one]];
    R.dist[x, one, neg[one]];
    R.plus.isinv[one];
    mul_zero_is_zero[x];
    neg_is_unique[x, neg[one] * x, @refl];
    @refl
  };
};]]></html:pre><html:p>In these lemmas, we cite a bunch of ring axioms (using the block/let syntax, where, for instance, <html:code>R.plus.assoc[nx, x, y]</html:code> is shorthand for <html:code>_ = R.plus.assoc[nx, x, y]</html:code>) in order to bring the corresponding equalities into the e-graph. Then type-checking <html:code>@refl</html:code> does a conversion check for the two sides of the equality we are trying to prove.</html:p><html:p>If we insert <html:code><![CDATA[%dump "neg_is_unique.svg";]]></html:code> right before <html:code>@refl</html:code>, then we can visualize the state of the e-graph before the conversion check, and it looks like the following:</html:p>
<html:img src="https://forest.topos.site/bafkrmiegjoldy4nffonnmm4gojwficgxzw7wc66fzbtyal2y6xyejjavse.svg" pdfsrc="neg_is_unique.pdf" pdfwidth="\textwidth" />
<html:p>It is somewhat hard to understand what is going on in the e-graph because the pretty-printing/layout is not great, but you can see that in the dotted box containing the <html:code>y</html:code> node, we also have <html:code>.inv</html:code> with child <html:code>x</html:code>. This says that conversion checking <html:code>neg[x] = R.plus.inv[x]</html:code> with <html:code>y</html:code> will succeed. There are also some other nodes in that same dotted box, which represent the fact that <html:code>y + zero == y</html:code> and <html:code>zero + y == y</html:code>.</html:p><html:p>The thing to note here is that conversion checks are not magical. The work happens beforehand in let-binding the relevant equations that are needed to make an equivalent program that does type-check. Currently, this is done manually, but it is not hard to imagine a tactic engine which kept applying axioms and theorems until the desired equality appeared in the e-graph; this tactic engine would implement what is known as <html:em>egraph saturation</html:em> in the e-graph literature.</html:p><html:p>Conveniently, we only have equality types for types, and we don't have pi types (only pi theories). So one of the reasons why e-graphs aren't used in conversion checking (namely, they totally fail at handling closure) does not apply for us. This is another benefit of the two-level setup.</html:p><html:p>We now discuss the specifics of how the e-graph shows up in elaboration. As mentioned before, the e-graph stores element neutrals. Neutrals in normalization by evaluation are introduced to give values for function arguments that we otherwise know nothing about. So, for instance, when type checking the body of <html:code>[x, y] ↦ b</html:code>, we do so in an environment where <html:code>x</html:code> and <html:code>y</html:code> are bound to neutrals.</html:p><html:p>Neutrals block computation. For instance, if <html:code>f</html:code> is a neutral model of a pi theory, then for any value of <html:code>x</html:code>, <html:code>f[x]</html:code> is a neutral. Similarly, if <html:code>r</html:code> is a neutral element of a record type with a field <html:code>a</html:code>, then <html:code>r.a</html:code> is a neutral.</html:p><html:p>In EMTT, we store element neutrals in an e-graph. So if <html:code>f</html:code> is a neutral model of a pi theory with type codomain, then when we make <html:code>f[x]</html:code> (which is a neutral element), we add a new e-node the the e-graph with (more or less) head given by <html:code>f</html:code> and arguments given by <html:code>x</html:code>. Then when we bring an equality into scope (for instance, while type checking the body of a function of type <html:code>[x: R, y: R, e: x*x + y*y == 1] -&gt; R</html:code>), we identify the two sides of <html:code>e</html:code> in the e-graph.</html:p><html:p>There are some subtleties around making this work correctly. For instance, if <html:code>r</html:code> is a neutral of record type, then we immediately eta-expand <html:code>r</html:code>, which adds <html:code>r.a</html:code>, <html:code>r.b</html:code>, etc. to the e-graph, and then replaces <html:code>r</html:code> with <html:code>{ a = r.a; b = r.b; ... }</html:code> (and it does this recursively, so if <html:code>r.b</html:code> is of record type, it also gets expanded).</html:p><html:p>In fact, we can think of “adding an equality to the e-graph” as a form of eta-expansion for equality types, where we replace <html:code>e : a = b</html:code> with <html:code>@refl</html:code> after identifying <html:code>a</html:code> and <html:code>b</html:code> in the e-graph. Technically, <html:code>a</html:code> and <html:code>b</html:code> may not be e-ids, they may be themselves either records or <html:code>@refl</html:code>. In the case of <html:code>@refl</html:code>, they are already the same, so we need not do anything; in the case of records, we recursively identify their fields.</html:p><html:p>The other subtlety is that after we bring an equality into scope while type checking a function (e.g. by adding a neutral for one of that function's arguments), and we finish type checking that function, we need to “remove” that equality from scope. This is not something supported by e-graphs, so instead what we do is we wrap the e-graph in a reference-counted pointer and use Rust's support for copy-on-write with reference-counted pointers. Before we type-check a function we save a clone of the reference-counted pointer, and this will ensure that the next modification to the e-graph will copy it rather than mutating it in-place. Once we've finished type-checking the function, we can go back to the old e-graph.</html:p><html:p>Overall, e-graphs do not change the core normalization by evaluation algorithm drastically. We are unsure how e-graphs will scale to larger proofs, or whether a good UI can be made for e-graph guided proofs, but the initial results are promising and show that there are viable approaches to extensive type theory via e-graphs.</html:p></fr:mainmatter>
        </fr:tree>
      </fr:mainmatter>
    </fr:tree>
    <fr:tree show-metadata="false">
      <fr:frontmatter>
        <fr:authors />
        <fr:date>
          <fr:year>2025</fr:year>
          <fr:month>2</fr:month>
          <fr:day>28</fr:day>
        </fr:date>
        <fr:uri>https://forest.topos.site/ocl-0077/</fr:uri>
        <fr:display-uri>https://forest.topos.site/ocl-0077</fr:display-uri>
        <fr:route>/ocl-0077/</fr:route>
        <fr:title text="Directions for future research">Directions for future research</fr:title>
      </fr:frontmatter>
      <fr:mainmatter>
        <fr:tree show-metadata="false">
          <fr:frontmatter>
            <fr:authors />
            <fr:date>
              <fr:year>2025</fr:year>
              <fr:month>2</fr:month>
              <fr:day>28</fr:day>
            </fr:date>
            <fr:uri>https://forest.topos.site/ocl-007E/</fr:uri>
            <fr:display-uri>https://forest.topos.site/ocl-007E</fr:display-uri>
            <fr:route>/ocl-007E/</fr:route>
            <fr:title text="Observational homomorphism theories and initial models">Observational homomorphism theories and initial models</fr:title>
          </fr:frontmatter>
          <fr:mainmatter><html:p>Given a theory in EMTT, it is not hard to write down a theory of homomorphisms between two models of that theory. For instance, if we have the theory for monoids:</html:p><html:pre><![CDATA[Monoid: @theory = {
  t: @type;
  op: [x: t, y: t] -> t;
  zero: t;
  assoc: [x: t, y: t, z: t] -> op[x, op[y, z]] == op[op[x, y], z];
  unit: [x: t] -> op[x, zero] == x;
}]]></html:pre><html:p>we can write down the corresponding theory for a monoid homomorphism</html:p><html:pre><![CDATA[MonoidHom[M: Monoid, N: Monoid]: @theory = {
  t: [x: M.t] -> N.t;
  op: [x: M.t, y: M.t] -> t[M.op[x, y]] == N.op[t[x], t[y]];
  zero: t[M.zero] == N.zero;
  assoc: [x: M.t, y: M.t, z: M.t] -> %ap[t, op, zero, M.assoc[x, y, z]] == N.assoc[t[x], t[y], t[z]];
  unit: [x: M.t] -> %ap[t, op, zero, assoc, M.unit[x]] == N.unit[t[x]];
}]]></html:pre><html:p>We use some pseudo-code in the above, where <html:code><![CDATA[%ap[t, op, zero, M.assoc[x,y,z]]]]></html:code> produces an equality <html:code>N.op[t[x], N.op[t[y], t[z]]] == N.op[N.op[t[x], t[y]], t[z]]</html:code> by using <html:code>M.assoc</html:code> and <html:code>t, op, zero</html:code>. Of course, because equality types are contractible, <html:code>assoc</html:code> and <html:code>unit</html:code> are redundant, but we keep them in for completeness.</html:p><html:p>Any mathematician would have no trouble taking the definition of a <html:code>@theory</html:code> and producing a definition of homomorphism for that theory. So the natural question to ask is whether we can automate this process?</html:p><html:p>In <fr:link href="/altenkirch-2007-observational/" title="Observational equality, now!" uri="https://forest.topos.site/altenkirch-2007-observational/" display-uri="https://forest.topos.site/altenkirch-2007-observational" type="local">Reference <fr:contextual-number uri="https://forest.topos.site/altenkirch-2007-observational/" display-uri="https://forest.topos.site/altenkirch-2007-observational" /></fr:link>, Altenkirch, McBride and Swierstra construct “observational type theory”, in which the equality type between two elements <fr:tex display="inline"><![CDATA[a, a']]></fr:tex> of a type <fr:tex display="inline"><![CDATA[A]]></fr:tex> is defined by induction on the structure of <fr:tex display="inline"><![CDATA[A]]></fr:tex>. For instance, if <fr:tex display="inline"><![CDATA[A]]></fr:tex> is a record type, then <fr:tex display="inline"><![CDATA[a =\hspace {-0.2em} =_A a']]></fr:tex> is definitionally a record of equalities.</html:p><html:p>A recent research project has been <html:em>higher</html:em> observational type theory. In the original observational type theory, equality types were always propositions. However, in order to handle homotopy type theory, this is relaxed in higher observational type theory. The benefit of this is that the univalence axiom, which identifies equalities between two types with isomorphisms between them, can be <html:em>definitionally</html:em> true.</html:p><html:p>We propose to do something morally quite similar; an “observational homomorphism theory”, which computes based on the structure of a theory, so that we could have <html:code>@Hom[Monoid, M, N] = MonoidHom[M, N]</html:code>. We expect that we might be able to skirt much of the difficulty of higher observational type theory in doing this, because we don't have a universe of theories. Thus, everything can remain strictly 2-categorical, corresponding to semantics in <fr:tex display="inline"><![CDATA[\mathcal {L}\mathsf {ex}]]></fr:tex> where a homomorphism is a natural transformation between two models, seen as sections of the display map for the theory. Homomorphisms between elements of types are propositions, and likewise homomorphisms between homomorphisms themselves are also propositions.</html:p><html:p>Then building on top of functionality for observational homomorphisms, we propose to add the ability to take <html:em>initial models</html:em> of theories.</html:p><html:p>To understand why this is desirable, consider the following example.</html:p><html:pre><![CDATA[Gr : @theory = {
  V: @type;
  E: [v1: V, v2: V] -> @type;
};

TwoPath[G: Gr] : [x: G.V, z: G.V] -> @type = [x, z] ↦ {
  y: G.V;
  e1: G.E[x,y];
  e2: G.E[y,z];
};

Joined[G: Gr] : @type = {
  x: G.V;
  z: G.V;
  p1: TwoPath[G][x,z];
  p2: TwoPath[G][z,x];
  p1.y == p2.y;
};

Dump[G: Gr, g: Joined[G]]: {} = {
  %dump "joined.svg";
  {}
};]]></html:pre><html:p>We include the <html:code>Dump</html:code> model in order to show the state of the e-graph when we have introduced <html:code>G: Gr</html:code> and <html:code>g: Joined[G]</html:code>:</html:p>
<html:img src="https://forest.topos.site/bafkrmif6tuhcas4c53inrt26dufor3n7c4bm4vbvrsovazyexuc4llwwga.svg" pdfsrc="joined.pdf" pdfwidth="\textwidth" />
<html:p>We can see that there are three vertices (<html:code>g.x</html:code>, <html:code>g.y</html:code>, and <html:code>g.p1.y = g.p2.y</html:code>) and four edges (<html:code>g.p1.e1</html:code>, <html:code>g.p1.e2</html:code>, <html:code>g.p2.e1</html:code>, <html:code>g.p2.e2</html:code>), which looks like:</html:p>



<html:figure><fr:resource hash="70595e67fb823cd6f490c373fe7b9998"><fr:resource-content><html:img src="https://forest.topos.site/70595e67fb823cd6f490c373fe7b9998.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[

\usepackage[utf8]{inputenc}
\DeclareFontFamily{U}{min}{}
\DeclareFontShape{U}{min}{m}{n}{<-> udmj30}{}
\newcommand\yo{\!\text{\usefont{U}{min}{m}{n}\symbol{'207}}\!}
\DeclareUnicodeCharacter{3088}{\yo}


\usepackage{tikz, tikz-cd, mathtools, amssymb, stmaryrd,xcolor}
\usetikzlibrary{matrix,arrows}
\usetikzlibrary{backgrounds,fit,positioning,calc,shapes}
\usetikzlibrary{decorations.pathreplacing}
\usetikzlibrary{decorations.pathmorphing}
\usetikzlibrary{decorations.markings}

% `tikz-cd` is necessary to draw commutative diagrams.
\RequirePackage{tikz-cd}
% `amssymb` is necessary for `\lrcorner` and `\ulcorner`.
\RequirePackage{amssymb}
% `calc` is necessary to draw curved arrows.
\usetikzlibrary{calc}
% `pathmorphing` is necessary to draw squiggly arrows.
\usetikzlibrary{decorations.pathmorphing}
% `spath3` is necessary to draw shortened edges.
\usetikzlibrary{spath3}

% A TikZ style for curved arrows of a fixed height, due to AndréC.
\tikzset{curve/.style={settings={#1},to path={(\tikztostart)
    .. controls ($(\tikztostart)!\pv{pos}!(\tikztotarget)!\pv{height}!270:(\tikztotarget)$)
    and ($(\tikztostart)!1-\pv{pos}!(\tikztotarget)!\pv{height}!270:(\tikztotarget)$)
    .. (\tikztotarget)\tikztonodes}},
    settings/.code={\tikzset{quiver/.cd,#1}
        \def\pv##1{\pgfkeysvalueof{/tikz/quiver/##1}}},
    quiver/.cd,pos/.initial=0.35,height/.initial=0}

% A TikZ style for shortening paths without the poor behaviour of `shorten <' and `shorten >'.
\tikzset{between/.style n args={2}{/tikz/spath/at end path construction={
    \tikzset{spath/split at keep middle={current}{#1}{#2}}
}}}

% TikZ arrowhead/tail styles.
\tikzset{tail reversed/.code={\pgfsetarrowsstart{tikzcd to}}}
\tikzset{2tail/.code={\pgfsetarrowsstart{Implies[reversed]}}}
\tikzset{2tail reversed/.code={\pgfsetarrowsstart{Implies}}}
% TikZ arrow styles.
\tikzset{no body/.style={/tikz/dash pattern=on 0 off 1mm}}


\newcommand{\triplecolon}{%
  \mathrel{\vbox{\baselineskip=2pt \hbox{.}\hbox{.}\hbox{.}}}%
}

\DeclareUnicodeCharacter{2AF6}{\triplecolon}
\usepackage{mathpartir}

]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[
\begin {tikzcd}
	\bullet  & \bullet  & \bullet 
	\arrow [curve={height=-6pt}, from=1-1, to=1-2]
	\arrow [curve={height=-6pt}, from=1-2, to=1-1]
	\arrow [curve={height=-6pt}, from=1-2, to=1-3]
	\arrow [curve={height=-6pt}, from=1-3, to=1-2]
\end {tikzcd}
]]></fr:resource-source></fr:resource></html:figure>

<html:p>If we consider the theory <html:code>{G: Gr, g: Joined[G]}</html:code>, this graph, along with its canonical element of <html:code>Joined[G]</html:code>, is precisely the initial model, which we denote as <html:code>@init[{G: Gr; g: Joined[G];}]</html:code>. As a consequence, homomorphisms from <html:code>@init[{G: Gr; g: Joined[G];}].G</html:code> into another graph <html:code>H</html:code> are in bijection with elements of <html:code>Joined[H]</html:code>. To see why this is true, if we have an element <html:code>h</html:code> of <html:code>Joined[H]</html:code>, then we may form the model <html:code>{G = H; g = h;}</html:code> of <html:code>{G: Gr, g: Joined[G]}</html:code>, there is then a unique homomorphism <html:code>f : @Hom[{G: Gr, g: Joined[G]}, @init[{G: Gr; g: Joined[G]}], {G = H; g = h;}]</html:code>, and we may take <html:code>f.G : @Hom[Gr, @init[{G: Gr; g: Joined[G]}].G, H]</html:code>.</html:p><html:p>More generally, a judgment <html:code>Q[G: Gr]: @type</html:code> may be seen as a <html:em>conjunctive query</html:em>, and (due to an observation by David Dalrymple), the initial model of <html:code>{G: Gr; q: Q[G];}</html:code> is the initial object of the category of “graphs equipped with a result of the conjunctive query”. In database theory, this is known as the “natural model”, which may be found in the relational case as early as <fr:link href="/chandra-1977-optimal/" title="Optimal implementation of conjunctive queries in relational data bases" uri="https://forest.topos.site/chandra-1977-optimal/" display-uri="https://forest.topos.site/chandra-1977-optimal" type="local">Reference <fr:contextual-number uri="https://forest.topos.site/chandra-1977-optimal/" display-uri="https://forest.topos.site/chandra-1977-optimal" /></fr:link>.</html:p><html:p>Another application of initial models is that although we only have records and pi theories in EMTT, the ability to ask for initial models gives us coproducts and inductive types as well! For instance, we can make binary coproducts via:</html:p><html:pre><![CDATA[Cocone[t: @type, s: @type]: @theory = {
  apex: @type;
  inl: [x: t] -> apex;
  inr: [y: s] -> apex;
};

Either[t: @type, s: @type]: @type = @init[Cocone[t, s]].apex;]]></html:pre><html:p>Now, we can show that any theory in the empty context has an initial model, but this is not necessarily true in an arbitrary context. We conjecture that a theory in a context <fr:tex display="inline"><![CDATA[\Gamma ]]></fr:tex> has an initial model if the theory only postulates elements of types that the theory introduces. For instance, in context <html:code>A: @type</html:code>, the theory <html:code>{ x: A; }</html:code> does not have an initial model. But the theory <html:code>{ B: @type; f: [x: A] -&gt; B; }</html:code> does have an initial model, namely <html:code>{ B = A; f[x] = x; }</html:code>. We expect that this check will not be so hard to implement, so that <html:code>@init[T]</html:code> will fail at compile time if <html:code>T</html:code> tries to introduce an element of an already-existing type.</html:p><html:p>This conjecture is supported by the fact that the category of sections of a lex functor <fr:tex display="inline"><![CDATA[F \colon  \mathsf {C} \to  \mathsf {D}]]></fr:tex> has an initial object if and only if <fr:tex display="inline"><![CDATA[F]]></fr:tex> is fully faithful.</html:p><html:p>If a facility for taking initial models can be successfully added to EMTT, then we will witness in a single system the well-known connection between initial models of generalized algebraic theories and quotient inductive-inductive types as given in <fr:link href="/altenkirch-2018-quotient/" title="Quotient Inductive-Inductive Types" uri="https://forest.topos.site/altenkirch-2018-quotient/" display-uri="https://forest.topos.site/altenkirch-2018-quotient" type="local">Reference <fr:contextual-number uri="https://forest.topos.site/altenkirch-2018-quotient/" display-uri="https://forest.topos.site/altenkirch-2018-quotient" /></fr:link>.</html:p><html:p>Of course, this facility will complicate the semantics of EMTT. This is because as we now have non-trivial models of <html:code>@type</html:code> in the empty context, we can no longer give semantics in <fr:tex display="inline"><![CDATA[\mathcal {L}\mathsf {ex}^{\mathsf {op}}]]></fr:tex>.</html:p><html:p>Fortunately, we can identify <fr:tex display="inline"><![CDATA[\mathcal {L}\mathsf {ex}^{\mathsf {op}}]]></fr:tex> with a sub-2-category of the category of topoi, by sending a lex category to the category of presheaves on it. This is not a full sub-2-category, and we conjecture that by taking more general classes of morphisms here we may be able to interpret initial models successfully; we leave the details of this to future work.</html:p></fr:mainmatter>
        </fr:tree>
        <fr:tree show-metadata="false">
          <fr:frontmatter>
            <fr:authors />
            <fr:date>
              <fr:year>2025</fr:year>
              <fr:month>2</fr:month>
              <fr:day>28</fr:day>
            </fr:date>
            <fr:uri>https://forest.topos.site/ocl-007F/</fr:uri>
            <fr:display-uri>https://forest.topos.site/ocl-007F</fr:display-uri>
            <fr:route>/ocl-007F/</fr:route>
            <fr:title text="Composition patterns for open systems">Composition patterns for open systems</fr:title>
          </fr:frontmatter>
          <fr:mainmatter><html:p>In <fr:link href="/ocl-00AR/" title="Lens-based systems theory" uri="https://forest.topos.site/ocl-00AR/" display-uri="https://forest.topos.site/ocl-00AR" type="local">example <fr:contextual-number uri="https://forest.topos.site/ocl-00AR/" display-uri="https://forest.topos.site/ocl-00AR" /></fr:link>, we touched on using EMTT to do lens-based systems theory. In this section, we connect EMTT to span/cospan-based systems theory, and specifically to the kind of systems that <fr:link href="https://github.com/ToposInstitute/CatColab" type="external">CatColab</fr:link> works with.</html:p><html:p>One of the more basic “systems theories” in catcolab is that of causal loop diagrams. We can write down this theory as:</html:p><html:pre><![CDATA[CausalLoop: @theory = {
  # vertices
  V: @type;
  # positive edges
  P: [x: V, y: V] -> @type;
  # negative edges
  N: [x: V, y: V] -> @type;
};]]></html:pre><html:p>Then we should be able to present models of <html:code>CausalLoop</html:code> by using the initial model trick from <fr:link href="/ocl-007E/" title="Observational homomorphism theories and initial models" uri="https://forest.topos.site/ocl-007E/" display-uri="https://forest.topos.site/ocl-007E" type="local">§ <fr:contextual-number uri="https://forest.topos.site/ocl-007E/" display-uri="https://forest.topos.site/ocl-007E" /></fr:link>. For instance, here is a causal loop diagram for a very basic infection model, where we have a population of infected people, a population of susceptible people, and an infection process. Susceptible people and infected people both increase the rate of infection, and infection decreases the population of susceptible people while increasing the population of infected people.</html:p><html:pre><![CDATA[SI[M: CausalLoop]: @type = {
  susceptible: M.V;
  infected: M.V;
  infection: M.V;
  susceptible_promotes_infection: M.P[susceptible, infection];
  infected_promotes_infection: M.P[infected, infection];
  infection_decreases_susceptible: M.N[infection, susceptible];
  infection_promotes_infected: M.P[infection, infected];
};]]></html:pre><html:p>Notice that this looks precisely like a CatColab notebook; each line is a cell that declares a vertex, positive edge, or negative edge!</html:p><html:p>The initial model of <html:code>{M: CausalLoop; si: SI[M];}</html:code> has underlying causal loop diagram that looks like:</html:p>



<html:figure><fr:resource hash="349c7374fbd44296befa8cc324a27c95"><fr:resource-content><html:img src="https://forest.topos.site/349c7374fbd44296befa8cc324a27c95.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[

\usepackage[utf8]{inputenc}
\DeclareFontFamily{U}{min}{}
\DeclareFontShape{U}{min}{m}{n}{<-> udmj30}{}
\newcommand\yo{\!\text{\usefont{U}{min}{m}{n}\symbol{'207}}\!}
\DeclareUnicodeCharacter{3088}{\yo}


\usepackage{tikz, tikz-cd, mathtools, amssymb, stmaryrd,xcolor}
\usetikzlibrary{matrix,arrows}
\usetikzlibrary{backgrounds,fit,positioning,calc,shapes}
\usetikzlibrary{decorations.pathreplacing}
\usetikzlibrary{decorations.pathmorphing}
\usetikzlibrary{decorations.markings}

% `tikz-cd` is necessary to draw commutative diagrams.
\RequirePackage{tikz-cd}
% `amssymb` is necessary for `\lrcorner` and `\ulcorner`.
\RequirePackage{amssymb}
% `calc` is necessary to draw curved arrows.
\usetikzlibrary{calc}
% `pathmorphing` is necessary to draw squiggly arrows.
\usetikzlibrary{decorations.pathmorphing}
% `spath3` is necessary to draw shortened edges.
\usetikzlibrary{spath3}

% A TikZ style for curved arrows of a fixed height, due to AndréC.
\tikzset{curve/.style={settings={#1},to path={(\tikztostart)
    .. controls ($(\tikztostart)!\pv{pos}!(\tikztotarget)!\pv{height}!270:(\tikztotarget)$)
    and ($(\tikztostart)!1-\pv{pos}!(\tikztotarget)!\pv{height}!270:(\tikztotarget)$)
    .. (\tikztotarget)\tikztonodes}},
    settings/.code={\tikzset{quiver/.cd,#1}
        \def\pv##1{\pgfkeysvalueof{/tikz/quiver/##1}}},
    quiver/.cd,pos/.initial=0.35,height/.initial=0}

% A TikZ style for shortening paths without the poor behaviour of `shorten <' and `shorten >'.
\tikzset{between/.style n args={2}{/tikz/spath/at end path construction={
    \tikzset{spath/split at keep middle={current}{#1}{#2}}
}}}

% TikZ arrowhead/tail styles.
\tikzset{tail reversed/.code={\pgfsetarrowsstart{tikzcd to}}}
\tikzset{2tail/.code={\pgfsetarrowsstart{Implies[reversed]}}}
\tikzset{2tail reversed/.code={\pgfsetarrowsstart{Implies}}}
% TikZ arrow styles.
\tikzset{no body/.style={/tikz/dash pattern=on 0 off 1mm}}


\newcommand{\triplecolon}{%
  \mathrel{\vbox{\baselineskip=2pt \hbox{.}\hbox{.}\hbox{.}}}%
}

\DeclareUnicodeCharacter{2AF6}{\triplecolon}
\usepackage{mathpartir}

]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[
\begin {tikzcd}
	S & {\mathrm {inf}} & I
	\arrow [color={rgb,255:red,92;green,92;blue,214}, curve={height=-6pt}, from=1-1, to=1-2]
	\arrow [color={rgb,255:red,214;green,92;blue,92}, curve={height=-6pt}, from=1-2, to=1-1]
	\arrow [color={rgb,255:red,92;green,92;blue,214}, curve={height=-6pt}, from=1-2, to=1-3]
	\arrow [color={rgb,255:red,92;green,92;blue,214}, curve={height=-6pt}, from=1-3, to=1-2]
\end {tikzcd}
]]></fr:resource-source></fr:resource></html:figure>

<html:p>where we put positive edges in blue and negative edges in red, which is precisely what we expect.</html:p><html:p>However, with EMTT, when we produce a derivation of <html:code>D[M: CausalLoop]: @type</html:code> we are not restricted to making each field in the record a primitive type. We can also use other, previously defined types. For instance, if we want a infection model with two diseases on the same population of susceptible people, we can do the following.</html:p><html:pre><![CDATA[SI2[M: CausalLoop]: @type = {
  disease1: SI[M];
  disease2: SI[M];
  disease1.susceptible == disease2.susceptible;
};]]></html:pre><html:p>This would be visualized by:</html:p>



<html:figure><fr:resource hash="1e84e86a227e87023892a74b35401bc7"><fr:resource-content><html:img src="https://forest.topos.site/1e84e86a227e87023892a74b35401bc7.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[

\usepackage[utf8]{inputenc}
\DeclareFontFamily{U}{min}{}
\DeclareFontShape{U}{min}{m}{n}{<-> udmj30}{}
\newcommand\yo{\!\text{\usefont{U}{min}{m}{n}\symbol{'207}}\!}
\DeclareUnicodeCharacter{3088}{\yo}


\usepackage{tikz, tikz-cd, mathtools, amssymb, stmaryrd,xcolor}
\usetikzlibrary{matrix,arrows}
\usetikzlibrary{backgrounds,fit,positioning,calc,shapes}
\usetikzlibrary{decorations.pathreplacing}
\usetikzlibrary{decorations.pathmorphing}
\usetikzlibrary{decorations.markings}

% `tikz-cd` is necessary to draw commutative diagrams.
\RequirePackage{tikz-cd}
% `amssymb` is necessary for `\lrcorner` and `\ulcorner`.
\RequirePackage{amssymb}
% `calc` is necessary to draw curved arrows.
\usetikzlibrary{calc}
% `pathmorphing` is necessary to draw squiggly arrows.
\usetikzlibrary{decorations.pathmorphing}
% `spath3` is necessary to draw shortened edges.
\usetikzlibrary{spath3}

% A TikZ style for curved arrows of a fixed height, due to AndréC.
\tikzset{curve/.style={settings={#1},to path={(\tikztostart)
    .. controls ($(\tikztostart)!\pv{pos}!(\tikztotarget)!\pv{height}!270:(\tikztotarget)$)
    and ($(\tikztostart)!1-\pv{pos}!(\tikztotarget)!\pv{height}!270:(\tikztotarget)$)
    .. (\tikztotarget)\tikztonodes}},
    settings/.code={\tikzset{quiver/.cd,#1}
        \def\pv##1{\pgfkeysvalueof{/tikz/quiver/##1}}},
    quiver/.cd,pos/.initial=0.35,height/.initial=0}

% A TikZ style for shortening paths without the poor behaviour of `shorten <' and `shorten >'.
\tikzset{between/.style n args={2}{/tikz/spath/at end path construction={
    \tikzset{spath/split at keep middle={current}{#1}{#2}}
}}}

% TikZ arrowhead/tail styles.
\tikzset{tail reversed/.code={\pgfsetarrowsstart{tikzcd to}}}
\tikzset{2tail/.code={\pgfsetarrowsstart{Implies[reversed]}}}
\tikzset{2tail reversed/.code={\pgfsetarrowsstart{Implies}}}
% TikZ arrow styles.
\tikzset{no body/.style={/tikz/dash pattern=on 0 off 1mm}}


\newcommand{\triplecolon}{%
  \mathrel{\vbox{\baselineskip=2pt \hbox{.}\hbox{.}\hbox{.}}}%
}

\DeclareUnicodeCharacter{2AF6}{\triplecolon}
\usepackage{mathpartir}

]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[
\begin {tikzcd}
	& {\mathrm {inf}_1} & {I_1} \\
	S \\
	& {\mathrm {inf}_2} & {I_2}
	\arrow [color={rgb,255:red,92;green,92;blue,214}, curve={height=-6pt}, from=1-2, to=1-3]
	\arrow [color={rgb,255:red,214;green,92;blue,92}, curve={height=-6pt}, from=1-2, to=2-1]
	\arrow [color={rgb,255:red,92;green,92;blue,214}, curve={height=-6pt}, from=1-3, to=1-2]
	\arrow [color={rgb,255:red,92;green,92;blue,214}, curve={height=-6pt}, from=2-1, to=1-2]
	\arrow [color={rgb,255:red,92;green,92;blue,214}, curve={height=6pt}, from=2-1, to=3-2]
	\arrow [color={rgb,255:red,214;green,92;blue,92}, curve={height=6pt}, from=3-2, to=2-1]
	\arrow [color={rgb,255:red,92;green,92;blue,214}, curve={height=-6pt}, from=3-2, to=3-3]
	\arrow [color={rgb,255:red,92;green,92;blue,214}, curve={height=-6pt}, from=3-3, to=3-2]
\end {tikzcd}
]]></fr:resource-source></fr:resource></html:figure>

<html:p>And one can imagine iterating this indefinitely to produce causal loop diagrams of greater and greater complexity.</html:p><html:p>But that is not all we can do with EMTT. We can also express a <html:em>composition pattern</html:em> of causal loop diagrams, without having specific causal loop diagrams to compose.</html:p><html:p>For instance, we might express the previous composite abstractly as</html:p><html:pre><![CDATA[Two[M: CausalLoop, X: [s: M.V] -> @type]: @type = {
  s: M.V;
  first: X[s];
  second: X[s];
};

SI2[M: CausalLoop]: @type =
  Two[M, [s] ↦ { si: SI[M]; si.susceptible == s; }];]]></html:pre><html:p>We can think of <html:code>X: [s: M.V] -&gt; @type</html:code> as a causal loop diagram that exposes a single vertex as its interface. The fact that this vertex has been “exposed” is what allows us to join together two causal lopp diagrams in <html:code>Two</html:code>.</html:p><html:p>Under the hood, this is all essentially just colimits of causal loop diagrams. But the framework of EMTT provides a solution to the problem of naming in iterated colimits, by using the <html:code>x.y.z</html:code> syntax that programmers are familiar with.</html:p><html:p>One final thing to note is that the ability to take initial models means that a derivation of <html:code>SI[M: CausalLoop]: @type</html:code> can no longer be identified with a conjunctive query on causal loop diagrams, as there are many types in the empty context now. So we may want to carefully restrict where initial models are allowed to be used, so that we can prove the metatheorem that a derivation of <html:code>SI[M: CausalLoop]: @type</html:code> is in fact a conjunctive query (as it is in EMTT without initial models).</html:p></fr:mainmatter>
        </fr:tree>
        <fr:tree show-metadata="false">
          <fr:frontmatter>
            <fr:authors />
            <fr:date>
              <fr:year>2025</fr:year>
              <fr:month>2</fr:month>
              <fr:day>28</fr:day>
            </fr:date>
            <fr:uri>https://forest.topos.site/ocl-007K/</fr:uri>
            <fr:display-uri>https://forest.topos.site/ocl-007K</fr:display-uri>
            <fr:route>/ocl-007K/</fr:route>
            <fr:title text="Hyperdoctrines, refinement types, abstract interpretation, and egglog">Hyperdoctrines, refinement types, abstract interpretation, and egglog</fr:title>
          </fr:frontmatter>
          <fr:mainmatter><html:p>E-graphs support a very general form of analysis, where each e-class is annotated with an element of a meet-semilattice. When e-classes are merged, their corresponding annotations are meet-ed.</html:p><html:p>This has been used to compute interval bounds on arithmetic operators. For instance, if we know that <fr:tex display="inline"><![CDATA[x \in  [a,b]]]></fr:tex> and <fr:tex display="inline"><![CDATA[y \in  [c,d]]]></fr:tex>, then we can derive that <fr:tex display="inline"><![CDATA[x + y \in  [a + c, b + d]]]></fr:tex>, and if we know that <fr:tex display="inline"><![CDATA[x + y = z]]></fr:tex> where <fr:tex display="inline"><![CDATA[z \in  [e, f]]]></fr:tex>, then we have <fr:tex display="inline"><![CDATA[x + y = z \in  [\max (a+c, e), \min (f, b + d)]]]></fr:tex>. Such analyses often come under the name “abstract interpretation”; e-graphs are one tool for abstract interpretation but by no means the only one.</html:p><html:p>More generally, if <fr:tex display="inline"><![CDATA[P_1,\ldots ,P_n]]></fr:tex> are unary predicate symbols, then we may consider the meet-semilattice of conjunctions of the <fr:tex display="inline"><![CDATA[P_i]]></fr:tex>. This would allow us to track whether certain propositions (like “<fr:tex display="inline"><![CDATA[x]]></fr:tex> is positive” held of e-classes in an e-graph).</html:p><html:p>This could allow for a kind of “extensional propositional reasoning”, where just as we store equations in the e-graph, we also store propositions. So we could have something like:</html:p><html:pre><![CDATA[PosNeg[t: @type]: @theory = {
  pos: [x: t] -> @prop;
  neg: [x: t] -> @prop;
  zero: t;
  posneg_is_zero: [x: t, pos[x], neg[x]] -> x == zero;
  example1: [x: t, y: t, x == y, pos[x], neg[y]]: y == zero :=
    [x,y,_,_,_] ↦ {
      posneg_is_zero[x, @it_is_known, @it_is_known];
      @refl
    };
};]]></html:pre><html:p>where <html:code>@it_is_known</html:code> is a constructor like <html:code>@refl</html:code>, which typechecks at a proposition if that proposition is true according to the analysis data stored in the e-graph.</html:p><html:p>This would correspond to typing rules</html:p>
<fr:resource hash="46dd3a70c7225eac1aa3e82c3e31ffb7"><fr:resource-content><html:img src="https://forest.topos.site/46dd3a70c7225eac1aa3e82c3e31ffb7.svg" /></fr:resource-content><fr:resource-source type="latex" part="preamble"><![CDATA[\usepackage {mathpartir, amssymb, amsmath, mathtools}]]></fr:resource-source><fr:resource-source type="latex" part="body"><![CDATA[
\begin {mathpar}

\inferrule {\Gamma  \,\vdash \, P \,\,\mathsf {true}}{\Gamma  \,\vdash \, \mathbf {it\text {-}is\text {-}known} \colon  P} \and 
\inferrule {\Gamma  \,\vdash \, p \colon  P}{\Gamma  \,\vdash \, P \,\,\mathsf {true}}

\end {mathpar}
]]></fr:resource-source></fr:resource>
<html:p>Again, this makes derivation reconstruction undecidable, but we can get partial derivation reconstruction in a similar way to how we already deal with equality.</html:p><html:p>We could analyze the addition of propositions to EMTT as modeling some kind of hyperdoctrine over types, as expressed type-theoretically in Chapter 4 of <fr:link href="/shulman-2016-catlog/" title="Categorical logic from a categorical point of view" uri="https://forest.topos.site/shulman-2016-catlog/" display-uri="https://forest.topos.site/shulman-2016-catlog" type="local">Reference <fr:contextual-number uri="https://forest.topos.site/shulman-2016-catlog/" display-uri="https://forest.topos.site/shulman-2016-catlog" /></fr:link>.</html:p><html:p>Then the ability to take dependent records that involve propositions would be akin to refinement types as expressed in <fr:link href="/freeman-1991-refinement/" title="Refinement types for ML" uri="https://forest.topos.site/freeman-1991-refinement/" display-uri="https://forest.topos.site/freeman-1991-refinement" type="local">Reference <fr:contextual-number uri="https://forest.topos.site/freeman-1991-refinement/" display-uri="https://forest.topos.site/freeman-1991-refinement" /></fr:link>; in this paper they even say explicitly:</html:p><html:blockquote>We can think of the refinement type inference algorithm as performing abstract interpretation over a programmer-specified finite lattice of refinements of each ML type.</html:blockquote><html:p>Finally, the language that corresponds to the most basic setup for a hyperdoctrine, with no forall or exists quantifiers, is datalog. We would express a basic datalog program (taken from <fr:link href="https://en.wikipedia.org/wiki/Datalog" type="external">the wikipedia article</fr:link>) in the following way in (prop-enhanced) EMTT:</html:p><html:pre><![CDATA[Ancestry: @theory = {
  person: @type;
  parent: [x: person, y: person] -> @prop;
  ancestor: [x: person, y: person] -> @prop;
  parent_is_ancestor: [x: person, y: person, parent[x, y]] -> ancestor[x, y];
  ancestor_transitive:
    [x: person, y: person, z: person, parent[x, y], ancestor[y, z]]
      -> ancestor[x,z];
  xerces: person;
  brooke: person;
  damocles: person;
  _: parent[xerces, brooke];
  _: parent[brooke, damocles];
}]]></html:pre><html:p>Recent research has shown that the bottom-up evaluation model for datalog may be productively combined with equality saturation of an e-graph; the result is a language called egglog <fr:link href="/zhang-2023-better/" title="Better Together: Unifying Datalog and Equality Saturation" uri="https://forest.topos.site/zhang-2023-better/" display-uri="https://forest.topos.site/zhang-2023-better" type="local">Reference <fr:contextual-number uri="https://forest.topos.site/zhang-2023-better/" display-uri="https://forest.topos.site/zhang-2023-better" /></fr:link>. We propose that EMTT+props could form a type-theoretic interface for egglog, in the same way that base EMTT forms a type-theoretic interface for e-graphs themselves.</html:p></fr:mainmatter>
        </fr:tree>
        <fr:tree show-metadata="false">
          <fr:frontmatter>
            <fr:authors />
            <fr:date>
              <fr:year>2025</fr:year>
              <fr:month>2</fr:month>
              <fr:day>28</fr:day>
            </fr:date>
            <fr:uri>https://forest.topos.site/ocl-007L/</fr:uri>
            <fr:display-uri>https://forest.topos.site/ocl-007L</fr:display-uri>
            <fr:route>/ocl-007L/</fr:route>
            <fr:title text="Extensions to 1ML-style module systems">Extensions to 1ML-style module systems</fr:title>
          </fr:frontmatter>
          <fr:mainmatter>
            <html:p>One of the original inspirations for EMTT was 1ML <fr:link href="/rossberg-2015-ml/" title="1ML – core and modules united (F-ing first-class modules)" uri="https://forest.topos.site/rossberg-2015-ml/" display-uri="https://forest.topos.site/rossberg-2015-ml" type="local">Reference <fr:contextual-number uri="https://forest.topos.site/rossberg-2015-ml/" display-uri="https://forest.topos.site/rossberg-2015-ml" /></fr:link>. In 1ML, the observation that “modules are just big record types” is taken seriously, and the heavyweight syntactic distinction in typical ML implementations between records and modules is eliminated, to be replaced with a semantic distinction between “big types” and “little types”.</html:p>
            <html:p>The semantics for 1ML are given in the original paper by elaboration to System F. We propose that a 1ML-esque system should be understood under the general heading of two-level type theory, and given semantics in this manner from the start. Specifically, the “theories” in EMTT could serve as a module system for a real programming language (just as the module systems for ML were originally inspired by algebraic theories).</html:p>
            <html:p>In this vein, elements of a “pi theory” might be seen as a module which depended upon some kind of runtime data. To understand what this means, we give an example. In OCaml, one can write down a module signature for graphs in the following way.</html:p>
            <html:pre><![CDATA[module type Graph = sig
  type v
  type e

  val src : e -> v
  val tgt : e -> v
end]]></html:pre>
            <html:p>However, this is only appropriate for graphs which can be specified at compile time. In Rust, there is a trait system instead of a module system, and trait implementations get to use a “self” parameters which can hold runtime data.</html:p>
            <html:pre><![CDATA[trait Graph {
  type V;
  type E;

  fn has_vertex(&self, v: &Self::V) -> bool;
  fn has_edge(&self, e: &Self::E) -> bool;

  fn src(&self, e: &Self::E) -> Self::V;
  fn tgt(&self, e: &Self::E) -> Self::V;
}]]></html:pre>
            <html:p>We can then implement this trait using a data structure, as in the following:</html:p>
            <html:pre><![CDATA[#[derive(Clone, Copy)]
struct Vertex(usize);

#[derive(Clone, Copy)]
struct Edge(usize);

struct FinGraph {
  vertices: HashSet<Vertex>,
  edges: HashSet<Edge>,
  src: HashMap<Edge, Vertex>,
  tgt: HashMap<Edge, Vertex>,
}

impl Graph for FinGraph {
  type V = Vertex;
  type E = Edge;

  fn has_vertex(&self, v: &Vertex) -> bool {
    self.vertices.contains(v)
  }

  fn has_edge(&self, e: &Edge) -> bool {
    self.edges.contains(e)
  }

  fn src(&self, e: &Edge) -> Vertex {
    *self.src.get(e).unwrap()
  }

  fn tgt(&self, e: &Edge) -> Vertex {
    *self.tgt.get(e).unwrap()
  }
}]]></html:pre>
            <html:p>We could replicate this in OCaml with something like</html:p>
            <html:pre><![CDATA[module type Graph = sig
  type self
  type v
  type e

  val has_vertex : self -> v -> bool
  val has_edge : self -> e -> bool
  val src : self -> e -> v
  val tgt : self -> e -> v
end]]></html:pre>
            <html:p>But this is less idiomatic than it is in Rust, because in Rust if <html:code>G</html:code> implements <html:code>Graph</html:code>, then we can use <html:code>G.src(e)</html:code>, etc., whereas in OCaml one must do <html:code>GraphImpl.src G e</html:code>.</html:p>
            <html:p>In a language with an EMTT-inspired module system, using pi theories we can get the best of both worlds: use the original OCaml-style presentation of the signature for graphs, and then have Rust-style implementations using runtime data:</html:p>
            <html:pre><![CDATA[Graph: @theory {
  v: @type;
  e: @type;
  src: [x: e] -> v;
  tgt: [x: e] -> v;
};

FinGraph: @type = ...;

FinGraphImplGraph: [self: FinGraph] -> Graph = ...;]]></html:pre>
            <html:p>And indeed the semantics for pi theories in sketches, which essentially “adds an extra argument to each function and type constructor in the theory”, is precisely the translation between the first and second presentations of the theory of graphs (modulo the fact that we must simulate a self-dependent type in Rust by a fixed type along with self-dependent predicate).</html:p>
            <html:p>This would codify in the type system a common pattern that is found in both <fr:link href="https://github.com/ToposInstitute/CatColab" type="external">CatColab</fr:link> and <fr:link href="https://github.com/AlgebraicJulia/GATlab.jl" type="external">GATlab.jl</fr:link> for implementations of theories.</html:p>
            <html:p>We hope in future work to understand precisely how this could work in a setting where we want to compile to high-performance code (more monomorphized than OCaml, but still with a garbage collector unlike Rust).</html:p>
          </fr:mainmatter>
        </fr:tree>
      </fr:mainmatter>
    </fr:tree>
  </fr:mainmatter>
  <fr:backmatter>
    <fr:tree show-metadata="false" hidden-when-empty="true">
      <fr:frontmatter>
        <fr:authors />
        <fr:title text="References">References</fr:title>
      </fr:frontmatter>
      <fr:mainmatter>
        <fr:tree show-metadata="true" expanded="false" toc="false" numbered="false">
          <fr:frontmatter>
            <fr:authors>
              <fr:author>
                <fr:link href="/andrás-kovács/" title="András Kovács" uri="https://forest.topos.site/andrás-kovács/" display-uri="https://forest.topos.site/andrás-kovács" type="local">András Kovács</fr:link>
              </fr:author>
            </fr:authors>
            <fr:date>
              <fr:year>2026</fr:year>
            </fr:date>
            <fr:uri>https://forest.topos.site/kovacs-2026-elaborationzoo/</fr:uri>
            <fr:display-uri>https://forest.topos.site/kovacs-2026-elaborationzoo</fr:display-uri>
            <fr:route>/kovacs-2026-elaborationzoo/</fr:route>
            <fr:title text="elaboration-zoo">elaboration-zoo</fr:title>
            <fr:taxon>Reference</fr:taxon>
            <fr:meta name="external">https://github.com/AndrasKovacs/elaboration-zoo</fr:meta>
            <fr:meta name="bibtex"><![CDATA[@misc{kovacs-2026-elaborationzoo,
  title = {elaboration-zoo},
  author = {Kov{\'a}cs, Andr{\'a}s},
  year = 2026,
  month = jan,
  url = {https://github.com/AndrasKovacs/elaboration-zoo},
  copyright = {BSD-3-Clause}
}]]></fr:meta>
          </fr:frontmatter>
          <fr:mainmatter />
        </fr:tree>
        <fr:tree show-metadata="true" expanded="false" toc="false" numbered="false">
          <fr:frontmatter>
            <fr:authors>
              <fr:author>
                <fr:link href="/michael-lambert/" title="Michael Lambert" uri="https://forest.topos.site/michael-lambert/" display-uri="https://forest.topos.site/michael-lambert" type="local">Michael Lambert</fr:link>
              </fr:author>
              <fr:author>
                <fr:link href="/evan-patterson/" title="Evan Patterson" uri="https://forest.topos.site/evan-patterson/" display-uri="https://forest.topos.site/evan-patterson" type="local">Evan Patterson</fr:link>
              </fr:author>
            </fr:authors>
            <fr:date>
              <fr:year>2024</fr:year>
            </fr:date>
            <fr:uri>https://forest.topos.site/lambert-2024-cartesian/</fr:uri>
            <fr:display-uri>https://forest.topos.site/lambert-2024-cartesian</fr:display-uri>
            <fr:route>/lambert-2024-cartesian/</fr:route>
            <fr:title text="Cartesian double theories: A double-categorical framework for categorical doctrines">Cartesian double theories: A double-categorical framework for categorical doctrines</fr:title>
            <fr:taxon>Reference</fr:taxon>
            <fr:meta name="doi">10.1016/j.aim.2024.109630</fr:meta>
            <fr:meta name="bibtex"><![CDATA[@article{lambert-2024-cartesian,
	title = {Cartesian double theories: A double-categorical framework for categorical doctrines},
	volume = {444},
	ISSN = {0001-8708},
	url = {http://dx.doi.org/10.1016/j.aim.2024.109630},
	DOI = {10.1016/j.aim.2024.109630},
	journal = {Advances in Mathematics},
	publisher = {Elsevier BV},
	author = {Lambert, Michael and Patterson, Evan},
	year = {2024},
	month = {may},
	pages = {109630}
}]]></fr:meta>
          </fr:frontmatter>
          <fr:mainmatter />
        </fr:tree>
        <fr:tree show-metadata="true" expanded="false" toc="false" numbered="false">
          <fr:frontmatter>
            <fr:authors>
              <fr:author>
                <fr:link href="/andrás-kovács/" title="András Kovács" uri="https://forest.topos.site/andrás-kovács/" display-uri="https://forest.topos.site/andrás-kovács" type="local">András Kovács</fr:link>
              </fr:author>
            </fr:authors>
            <fr:date>
              <fr:year>2024</fr:year>
            </fr:date>
            <fr:uri>https://forest.topos.site/kovács-2024-closurefree/</fr:uri>
            <fr:display-uri>https://forest.topos.site/kovács-2024-closurefree</fr:display-uri>
            <fr:route>/kovács-2024-closurefree/</fr:route>
            <fr:title text="Closure-Free Functional Programming in a Two-Level Type Theory">Closure-Free Functional Programming in a Two-Level Type Theory</fr:title>
            <fr:taxon>Reference</fr:taxon>
            <fr:meta name="doi">10.1145/3674648</fr:meta>
            <fr:meta name="bibtex"><![CDATA[@article{kovács-2024-closurefree,
	title = {Closure-Free Functional Programming in a Two-Level Type Theory},
	volume = {8},
	ISSN = {2475-1421},
	url = {http://dx.doi.org/10.1145/3674648},
	DOI = {10.1145/3674648},
	number = {ICFP},
	journal = {Proceedings of the ACM on Programming Languages},
	publisher = {Association for Computing Machinery (ACM)},
	author = {Kovács, András},
	year = {2024},
	month = {aug},
	pages = {659–692}
}]]></fr:meta>
          </fr:frontmatter>
          <fr:mainmatter />
        </fr:tree>
        <fr:tree show-metadata="true" expanded="false" toc="false" numbered="false">
          <fr:frontmatter>
            <fr:authors>
              <fr:author>
                <fr:link href="/tobias-fritz/" title="Tobias Fritz" uri="https://forest.topos.site/tobias-fritz/" display-uri="https://forest.topos.site/tobias-fritz" type="local">Tobias Fritz</fr:link>
              </fr:author>
            </fr:authors>
            <fr:date>
              <fr:year>2024</fr:year>
            </fr:date>
            <fr:uri>https://forest.topos.site/fritz-2024-differential/</fr:uri>
            <fr:display-uri>https://forest.topos.site/fritz-2024-differential</fr:display-uri>
            <fr:route>/fritz-2024-differential/</fr:route>
            <fr:title text="Differential geometry and general relativity with algebraifolds">Differential geometry and general relativity with algebraifolds</fr:title>
            <fr:taxon>Reference</fr:taxon>
            <fr:meta name="doi">10.1016/j.geomphys.2024.105327</fr:meta>
            <fr:meta name="bibtex"><![CDATA[@article{fritz-2024-differential,
	title = {Differential geometry and general relativity with algebraifolds},
	volume = {206},
	ISSN = {0393-0440},
	url = {http://dx.doi.org/10.1016/j.geomphys.2024.105327},
	DOI = {10.1016/j.geomphys.2024.105327},
	journal = {Journal of Geometry and Physics},
	publisher = {Elsevier BV},
	author = {Fritz, Tobias},
	year = {2024},
	month = {dec},
	pages = {105327}
}]]></fr:meta>
          </fr:frontmatter>
          <fr:mainmatter />
        </fr:tree>
        <fr:tree show-metadata="true" expanded="false" toc="false" numbered="false">
          <fr:frontmatter>
            <fr:authors>
              <fr:author>
                <fr:link href="/owen-lynch/" title="Owen Lynch" uri="https://forest.topos.site/owen-lynch/" display-uri="https://forest.topos.site/owen-lynch" type="local">Owen Lynch</fr:link>
              </fr:author>
              <fr:author>
                <fr:link href="/kris-brown/" title="Kris Brown" uri="https://forest.topos.site/kris-brown/" display-uri="https://forest.topos.site/kris-brown" type="local">Kris Brown</fr:link>
              </fr:author>
              <fr:author>
                <fr:link href="/james-fairbanks/" title="James Fairbanks" uri="https://forest.topos.site/james-fairbanks/" display-uri="https://forest.topos.site/james-fairbanks" type="local">James Fairbanks</fr:link>
              </fr:author>
              <fr:author>
                <fr:link href="/evan-patterson/" title="Evan Patterson" uri="https://forest.topos.site/evan-patterson/" display-uri="https://forest.topos.site/evan-patterson" type="local">Evan Patterson</fr:link>
              </fr:author>
            </fr:authors>
            <fr:date>
              <fr:year>2024</fr:year>
            </fr:date>
            <fr:uri>https://forest.topos.site/lynch-2024-gatlab/</fr:uri>
            <fr:display-uri>https://forest.topos.site/lynch-2024-gatlab</fr:display-uri>
            <fr:route>/lynch-2024-gatlab/</fr:route>
            <fr:title text="GATlab: Modeling and Programming with Generalized Algebraic Theories">GATlab: Modeling and Programming with Generalized Algebraic Theories</fr:title>
            <fr:taxon>Reference</fr:taxon>
            <fr:meta name="doi">10.46298/entics.14666</fr:meta>
            <fr:meta name="bibtex"><![CDATA[@article{lynch-2024-gatlab,
	title = {GATlab: Modeling and Programming with Generalized Algebraic Theories},
	volume = {Volume 4-Proceedings of...},
	ISSN = {2969-2431},
	url = {http://dx.doi.org/10.46298/entics.14666},
	DOI = {10.46298/entics.14666},
	journal = {Electronic Notes in Theoretical Informatics and Computer Science},
	publisher = {Centre pour la Communication Scientifique Directe (CCSD)},
	author = {Lynch, Owen and Brown, Kris and Fairbanks, James and Patterson, Evan},
	year = {2024},
	month = {dec}
}]]></fr:meta>
          </fr:frontmatter>
          <fr:mainmatter />
        </fr:tree>
        <fr:tree show-metadata="true" expanded="false" toc="false" numbered="false">
          <fr:frontmatter>
            <fr:authors>
              <fr:author>
                <fr:link href="/sophie-libkind/" title="Sophie Libkind" uri="https://forest.topos.site/sophie-libkind/" display-uri="https://forest.topos.site/sophie-libkind" type="local">Sophie Libkind</fr:link>
              </fr:author>
              <fr:author>
                <fr:link href="/david-spivak/" title="David I. Spivak" uri="https://forest.topos.site/david-spivak/" display-uri="https://forest.topos.site/david-spivak" type="local">David I. Spivak</fr:link>
              </fr:author>
            </fr:authors>
            <fr:date>
              <fr:year>2024</fr:year>
            </fr:date>
            <fr:uri>https://forest.topos.site/libkind-2024-pattern/</fr:uri>
            <fr:display-uri>https://forest.topos.site/libkind-2024-pattern</fr:display-uri>
            <fr:route>/libkind-2024-pattern/</fr:route>
            <fr:title text="Pattern runs on matter: The free monad monad as a module over the cofree comonad comonad">Pattern runs on matter: The free monad monad as a module over the cofree comonad comonad</fr:title>
            <fr:taxon>Reference</fr:taxon>
            <fr:meta name="doi">10.48550/ARXIV.2404.16321</fr:meta>
            <fr:meta name="bibtex"><![CDATA[@misc{libkind-2024-pattern,
	doi = {10.48550/ARXIV.2404.16321},
	url = {https://arxiv.org/abs/2404.16321},
	author = {Libkind, Sophie and Spivak, David I.},
	keywords = {Category Theory (math.CT), FOS: Mathematics, FOS: Mathematics},
	title = {Pattern runs on matter: The free monad monad as a module over the cofree comonad comonad},
	publisher = {arXiv},
	year = {2024},
	copyright = {Creative Commons Attribution 4.0 International}
}]]></fr:meta>
          </fr:frontmatter>
          <fr:mainmatter />
        </fr:tree>
        <fr:tree show-metadata="true" expanded="false" toc="false" numbered="false">
          <fr:frontmatter>
            <fr:authors>
              <fr:author>
                <fr:link href="/c-aberlé/" title="C. B. Aberlé" uri="https://forest.topos.site/c-aberlé/" display-uri="https://forest.topos.site/c-aberlé" type="local">C. B. Aberlé</fr:link>
              </fr:author>
              <fr:author>
                <fr:link href="/david-spivak/" title="David I. Spivak" uri="https://forest.topos.site/david-spivak/" display-uri="https://forest.topos.site/david-spivak" type="local">David I. Spivak</fr:link>
              </fr:author>
            </fr:authors>
            <fr:date>
              <fr:year>2024</fr:year>
            </fr:date>
            <fr:uri>https://forest.topos.site/aberlé-2024-polynomial/</fr:uri>
            <fr:display-uri>https://forest.topos.site/aberlé-2024-polynomial</fr:display-uri>
            <fr:route>/aberlé-2024-polynomial/</fr:route>
            <fr:title text="Polynomial Universes and Dependent Types">Polynomial Universes and Dependent Types</fr:title>
            <fr:taxon>Reference</fr:taxon>
            <fr:meta name="doi">10.48550/ARXIV.2409.19176</fr:meta>
            <fr:meta name="bibtex"><![CDATA[@misc{aberlé-2024-polynomial,
	doi = {10.48550/ARXIV.2409.19176},
	url = {https://arxiv.org/abs/2409.19176},
	author = {Aberlé, C. B. and Spivak, David I.},
	keywords = {Logic in Computer Science (cs.LO), Programming Languages (cs.PL), Category Theory (math.CT), FOS: Computer and information sciences, FOS: Computer and information sciences, FOS: Mathematics, FOS: Mathematics},
	title = {Polynomial Universes and Dependent Types},
	publisher = {arXiv},
	year = {2024},
	copyright = {Creative Commons Attribution 4.0 International}
}]]></fr:meta>
          </fr:frontmatter>
          <fr:mainmatter />
        </fr:tree>
        <fr:tree show-metadata="true" expanded="false" toc="false" numbered="false">
          <fr:frontmatter>
            <fr:authors>
              <fr:author>
                <fr:link href="/taichi-uemura/" title="Taichi Uemura" uri="https://forest.topos.site/taichi-uemura/" display-uri="https://forest.topos.site/taichi-uemura" type="local">Taichi Uemura</fr:link>
              </fr:author>
            </fr:authors>
            <fr:date>
              <fr:year>2023</fr:year>
            </fr:date>
            <fr:uri>https://forest.topos.site/uemura-2023-general/</fr:uri>
            <fr:display-uri>https://forest.topos.site/uemura-2023-general</fr:display-uri>
            <fr:route>/uemura-2023-general/</fr:route>
            <fr:title text="A general framework for the semantics of type theory">A general framework for the semantics of type theory</fr:title>
            <fr:taxon>Reference</fr:taxon>
            <fr:meta name="doi">10.1017/s0960129523000208</fr:meta>
            <fr:meta name="bibtex"><![CDATA[@article{uemura-2023-general,
	title = {A general framework for the semantics of type theory},
	volume = {33},
	ISSN = {1469-8072},
	url = {http://dx.doi.org/10.1017/S0960129523000208},
	DOI = {10.1017/s0960129523000208},
	number = {3},
	journal = {Mathematical Structures in Computer Science},
	publisher = {Cambridge University Press (CUP)},
	author = {Uemura, Taichi},
	year = {2023},
	month = {mar},
	pages = {134–179}
}]]></fr:meta>
          </fr:frontmatter>
          <fr:mainmatter />
        </fr:tree>
        <fr:tree show-metadata="true" expanded="false" toc="false" numbered="false">
          <fr:frontmatter>
            <fr:authors>
              <fr:author>
                <fr:link href="/yihong-zhang/" title="Yihong Zhang" uri="https://forest.topos.site/yihong-zhang/" display-uri="https://forest.topos.site/yihong-zhang" type="local">Yihong Zhang</fr:link>
              </fr:author>
              <fr:author>
                <fr:link href="/yisu-wang/" title="Yisu Remy Wang" uri="https://forest.topos.site/yisu-wang/" display-uri="https://forest.topos.site/yisu-wang" type="local">Yisu Remy Wang</fr:link>
              </fr:author>
              <fr:author>
                <fr:link href="/oliver-flatt/" title="Oliver Flatt" uri="https://forest.topos.site/oliver-flatt/" display-uri="https://forest.topos.site/oliver-flatt" type="local">Oliver Flatt</fr:link>
              </fr:author>
              <fr:author>
                <fr:link href="/david-cao/" title="David Cao" uri="https://forest.topos.site/david-cao/" display-uri="https://forest.topos.site/david-cao" type="local">David Cao</fr:link>
              </fr:author>
              <fr:author>
                <fr:link href="/philip-zucker/" title="Philip Zucker" uri="https://forest.topos.site/philip-zucker/" display-uri="https://forest.topos.site/philip-zucker" type="local">Philip Zucker</fr:link>
              </fr:author>
              <fr:author>
                <fr:link href="/eli-rosenthal/" title="Eli Rosenthal" uri="https://forest.topos.site/eli-rosenthal/" display-uri="https://forest.topos.site/eli-rosenthal" type="local">Eli Rosenthal</fr:link>
              </fr:author>
              <fr:author>
                <fr:link href="/zachary-tatlock/" title="Zachary Tatlock" uri="https://forest.topos.site/zachary-tatlock/" display-uri="https://forest.topos.site/zachary-tatlock" type="local">Zachary Tatlock</fr:link>
              </fr:author>
              <fr:author>
                <fr:link href="/max-willsey/" title="Max Willsey" uri="https://forest.topos.site/max-willsey/" display-uri="https://forest.topos.site/max-willsey" type="local">Max Willsey</fr:link>
              </fr:author>
            </fr:authors>
            <fr:date>
              <fr:year>2023</fr:year>
            </fr:date>
            <fr:uri>https://forest.topos.site/zhang-2023-better/</fr:uri>
            <fr:display-uri>https://forest.topos.site/zhang-2023-better</fr:display-uri>
            <fr:route>/zhang-2023-better/</fr:route>
            <fr:title text="Better Together: Unifying Datalog and Equality Saturation">Better Together: Unifying Datalog and Equality Saturation</fr:title>
            <fr:taxon>Reference</fr:taxon>
            <fr:meta name="doi">10.1145/3591239</fr:meta>
            <fr:meta name="bibtex"><![CDATA[@article{zhang-2023-better,
	title = {Better Together: Unifying Datalog and Equality Saturation},
	volume = {7},
	ISSN = {2475-1421},
	url = {http://dx.doi.org/10.1145/3591239},
	DOI = {10.1145/3591239},
	number = {PLDI},
	journal = {Proceedings of the ACM on Programming Languages},
	publisher = {Association for Computing Machinery (ACM)},
	author = {Zhang, Yihong and Wang, Yisu Remy and Flatt, Oliver and Cao, David and Zucker, Philip and Rosenthal, Eli and Tatlock, Zachary and Willsey, Max},
	year = {2023},
	month = {jun},
	pages = {468–492}
}]]></fr:meta>
          </fr:frontmatter>
          <fr:mainmatter />
        </fr:tree>
        <fr:tree show-metadata="true" expanded="false" toc="false" numbered="false">
          <fr:frontmatter>
            <fr:authors>
              <fr:author>
                <fr:link href="/danil-annenkov/" title="Danil Annenkov" uri="https://forest.topos.site/danil-annenkov/" display-uri="https://forest.topos.site/danil-annenkov" type="local">Danil Annenkov</fr:link>
              </fr:author>
              <fr:author>
                <fr:link href="/paolo-capriotti/" title="Paolo Capriotti" uri="https://forest.topos.site/paolo-capriotti/" display-uri="https://forest.topos.site/paolo-capriotti" type="local">Paolo Capriotti</fr:link>
              </fr:author>
              <fr:author>
                <fr:link href="/nicolai-kraus/" title="Nicolai Kraus" uri="https://forest.topos.site/nicolai-kraus/" display-uri="https://forest.topos.site/nicolai-kraus" type="local">Nicolai Kraus</fr:link>
              </fr:author>
              <fr:author>
                <fr:link href="/christian-sattler/" title="Christian Sattler" uri="https://forest.topos.site/christian-sattler/" display-uri="https://forest.topos.site/christian-sattler" type="local">Christian Sattler</fr:link>
              </fr:author>
            </fr:authors>
            <fr:date>
              <fr:year>2023</fr:year>
            </fr:date>
            <fr:uri>https://forest.topos.site/annenkov-2023-twolevel/</fr:uri>
            <fr:display-uri>https://forest.topos.site/annenkov-2023-twolevel</fr:display-uri>
            <fr:route>/annenkov-2023-twolevel/</fr:route>
            <fr:title text="Two-level type theory and applications">Two-level type theory and applications</fr:title>
            <fr:taxon>Reference</fr:taxon>
            <fr:meta name="doi">10.1017/s0960129523000130</fr:meta>
            <fr:meta name="bibtex"><![CDATA[@article{annenkov-2023-twolevel,
	title = {Two-level type theory and applications},
	volume = {33},
	ISSN = {1469-8072},
	url = {http://dx.doi.org/10.1017/S0960129523000130},
	DOI = {10.1017/s0960129523000130},
	number = {8},
	journal = {Mathematical Structures in Computer Science},
	publisher = {Cambridge University Press (CUP)},
	author = {Annenkov, Danil and Capriotti, Paolo and Kraus, Nicolai and Sattler, Christian},
	year = {2023},
	month = {may},
	pages = {688–743}
}]]></fr:meta>
          </fr:frontmatter>
          <fr:mainmatter />
        </fr:tree>
        <fr:tree show-metadata="true" expanded="false" toc="false" numbered="false">
          <fr:frontmatter>
            <fr:authors>
              <fr:author>
                <fr:link href="/andrás-kovács/" title="András Kovács" uri="https://forest.topos.site/andrás-kovács/" display-uri="https://forest.topos.site/andrás-kovács" type="local">András Kovács</fr:link>
              </fr:author>
            </fr:authors>
            <fr:date>
              <fr:year>2022</fr:year>
            </fr:date>
            <fr:uri>https://forest.topos.site/kovács-2022-staged/</fr:uri>
            <fr:display-uri>https://forest.topos.site/kovács-2022-staged</fr:display-uri>
            <fr:route>/kovács-2022-staged/</fr:route>
            <fr:title text="Staged compilation with two-level type theory">Staged compilation with two-level type theory</fr:title>
            <fr:taxon>Reference</fr:taxon>
            <fr:meta name="doi">10.1145/3547641</fr:meta>
            <fr:meta name="bibtex"><![CDATA[@article{kovács-2022-staged,
	title = {Staged compilation with two-level type theory},
	volume = {6},
	ISSN = {2475-1421},
	url = {http://dx.doi.org/10.1145/3547641},
	DOI = {10.1145/3547641},
	number = {ICFP},
	journal = {Proceedings of the ACM on Programming Languages},
	publisher = {Association for Computing Machinery (ACM)},
	author = {Kovács, András},
	year = {2022},
	month = {aug},
	pages = {540–569}
}]]></fr:meta>
          </fr:frontmatter>
          <fr:mainmatter />
        </fr:tree>
        <fr:tree show-metadata="true" expanded="false" toc="false" numbered="false">
          <fr:frontmatter>
            <fr:authors>
              <fr:author>
                <fr:link href="/andrás-kovács/" title="András Kovács" uri="https://forest.topos.site/andrás-kovács/" display-uri="https://forest.topos.site/andrás-kovács" type="local">András Kovács</fr:link>
              </fr:author>
            </fr:authors>
            <fr:date>
              <fr:year>2022</fr:year>
            </fr:date>
            <fr:uri>https://forest.topos.site/kovács-2022-type/</fr:uri>
            <fr:display-uri>https://forest.topos.site/kovács-2022-type</fr:display-uri>
            <fr:route>/kovács-2022-type/</fr:route>
            <fr:title text="Type-Theoretic Signatures for Algebraic Theories and Inductive Types">Type-Theoretic Signatures for Algebraic Theories and Inductive Types</fr:title>
            <fr:taxon>Reference</fr:taxon>
            <fr:meta name="external">https://andraskovacs.github.io/pdfs/phdthesis_compact.pdf</fr:meta>
            <fr:meta name="bibtex">
@phdthesis{kovács-2022-type,
  title = {Type-Theoretic Signatures for Algebraic Theories and Inductive Types},
  author = {Kovács, András},
  school = {Eötvös Loránd University},
  year = {2022}
}
</fr:meta>
          </fr:frontmatter>
          <fr:mainmatter />
        </fr:tree>
        <fr:tree show-metadata="true" expanded="false" toc="false" numbered="false">
          <fr:frontmatter>
            <fr:authors>
              <fr:author>
                <fr:link href="/hoang-nguyen/" title="Hoang Kim Nguyen" uri="https://forest.topos.site/hoang-nguyen/" display-uri="https://forest.topos.site/hoang-nguyen" type="local">Hoang Kim Nguyen</fr:link>
              </fr:author>
              <fr:author>
                <fr:link href="/taichi-uemura/" title="Taichi Uemura" uri="https://forest.topos.site/taichi-uemura/" display-uri="https://forest.topos.site/taichi-uemura" type="local">Taichi Uemura</fr:link>
              </fr:author>
            </fr:authors>
            <fr:date>
              <fr:year>2022</fr:year>
            </fr:date>
            <fr:uri>https://forest.topos.site/nguyen-2022-inftytype/</fr:uri>
            <fr:display-uri>https://forest.topos.site/nguyen-2022-inftytype</fr:display-uri>
            <fr:route>/nguyen-2022-inftytype/</fr:route>
            <fr:title text="\infty -type theories"><fr:tex display="inline"><![CDATA[\infty ]]></fr:tex>-type theories</fr:title>
            <fr:taxon>Reference</fr:taxon>
            <fr:meta name="doi">10.48550/ARXIV.2205.00798</fr:meta>
            <fr:meta name="bibtex"><![CDATA[@misc{nguyen-2022-inftytype,
	doi = {10.48550/ARXIV.2205.00798},
	url = {https://arxiv.org/abs/2205.00798},
	author = {Nguyen, Hoang Kim and Uemura, Taichi},
	keywords = {Category Theory (math.CT), Logic (math.LO), FOS: Mathematics, FOS: Mathematics, 18N60 (Primary) 03B38 (Secondary)},
	title = {$\infty$-type theories},
	publisher = {arXiv},
	year = {2022},
	copyright = {Creative Commons Attribution 4.0 International}
}]]></fr:meta>
          </fr:frontmatter>
          <fr:mainmatter />
        </fr:tree>
        <fr:tree show-metadata="true" expanded="false" toc="false" numbered="false">
          <fr:frontmatter>
            <fr:authors>
              <fr:author>
                <fr:link href="/clive-newstead/" title="Clive Newstead" uri="https://forest.topos.site/clive-newstead/" display-uri="https://forest.topos.site/clive-newstead" type="local">Clive Newstead</fr:link>
              </fr:author>
            </fr:authors>
            <fr:date>
              <fr:year>2021</fr:year>
            </fr:date>
            <fr:uri>https://forest.topos.site/newstead-2021-algebraic/</fr:uri>
            <fr:display-uri>https://forest.topos.site/newstead-2021-algebraic</fr:display-uri>
            <fr:route>/newstead-2021-algebraic/</fr:route>
            <fr:title text="Algebraic models of dependent type theory">Algebraic models of dependent type theory</fr:title>
            <fr:taxon>Reference</fr:taxon>
            <fr:meta name="doi">10.48550/ARXIV.2103.06155</fr:meta>
            <fr:meta name="bibtex"><![CDATA[@misc{newstead-2021-algebraic,
	doi = {10.48550/ARXIV.2103.06155},
	url = {https://arxiv.org/abs/2103.06155},
	author = {Newstead, Clive},
	keywords = {Category Theory (math.CT), FOS: Mathematics, FOS: Mathematics, F.4.1, 18C50},
	title = {Algebraic models of dependent type theory},
	publisher = {arXiv},
	year = {2021},
	copyright = {Creative Commons Attribution Non Commercial Share Alike 4.0 International}
}]]></fr:meta>
          </fr:frontmatter>
          <fr:mainmatter />
        </fr:tree>
        <fr:tree show-metadata="true" expanded="false" toc="false" numbered="false">
          <fr:frontmatter>
            <fr:authors>
              <fr:author>
                <fr:link href="/max-willsey/" title="Max Willsey" uri="https://forest.topos.site/max-willsey/" display-uri="https://forest.topos.site/max-willsey" type="local">Max Willsey</fr:link>
              </fr:author>
              <fr:author>
                <fr:link href="/chandrakana-nandi/" title="Chandrakana Nandi" uri="https://forest.topos.site/chandrakana-nandi/" display-uri="https://forest.topos.site/chandrakana-nandi" type="local">Chandrakana Nandi</fr:link>
              </fr:author>
              <fr:author>
                <fr:link href="/yisu-wang/" title="Yisu Remy Wang" uri="https://forest.topos.site/yisu-wang/" display-uri="https://forest.topos.site/yisu-wang" type="local">Yisu Remy Wang</fr:link>
              </fr:author>
              <fr:author>
                <fr:link href="/oliver-flatt/" title="Oliver Flatt" uri="https://forest.topos.site/oliver-flatt/" display-uri="https://forest.topos.site/oliver-flatt" type="local">Oliver Flatt</fr:link>
              </fr:author>
              <fr:author>
                <fr:link href="/zachary-tatlock/" title="Zachary Tatlock" uri="https://forest.topos.site/zachary-tatlock/" display-uri="https://forest.topos.site/zachary-tatlock" type="local">Zachary Tatlock</fr:link>
              </fr:author>
              <fr:author>
                <fr:link href="/pavel-panchekha/" title="Pavel Panchekha" uri="https://forest.topos.site/pavel-panchekha/" display-uri="https://forest.topos.site/pavel-panchekha" type="local">Pavel Panchekha</fr:link>
              </fr:author>
            </fr:authors>
            <fr:date>
              <fr:year>2021</fr:year>
            </fr:date>
            <fr:uri>https://forest.topos.site/willsey-2021-egg/</fr:uri>
            <fr:display-uri>https://forest.topos.site/willsey-2021-egg</fr:display-uri>
            <fr:route>/willsey-2021-egg/</fr:route>
            <fr:title text="egg: Fast and extensible equality saturation">egg: Fast and extensible equality saturation</fr:title>
            <fr:taxon>Reference</fr:taxon>
            <fr:meta name="doi">10.1145/3434304</fr:meta>
            <fr:meta name="bibtex"><![CDATA[@article{willsey-2021-egg,
	title = {egg: Fast and extensible equality saturation},
	volume = {5},
	ISSN = {2475-1421},
	url = {http://dx.doi.org/10.1145/3434304},
	DOI = {10.1145/3434304},
	number = {POPL},
	journal = {Proceedings of the ACM on Programming Languages},
	publisher = {Association for Computing Machinery (ACM)},
	author = {Willsey, Max and Nandi, Chandrakana and Wang, Yisu Remy and Flatt, Oliver and Tatlock, Zachary and Panchekha, Pavel},
	year = {2021},
	month = {jan},
	pages = {1–29}
}]]></fr:meta>
          </fr:frontmatter>
          <fr:mainmatter />
        </fr:tree>
        <fr:tree show-metadata="true" expanded="false" toc="false" numbered="false">
          <fr:frontmatter>
            <fr:authors>
              <fr:author>
                <fr:link href="/jet-nestruev/" title="Jet Nestruev" uri="https://forest.topos.site/jet-nestruev/" display-uri="https://forest.topos.site/jet-nestruev" type="local">Jet Nestruev</fr:link>
              </fr:author>
            </fr:authors>
            <fr:date>
              <fr:year>2020</fr:year>
            </fr:date>
            <fr:uri>https://forest.topos.site/nestruev-2020-smooth/</fr:uri>
            <fr:display-uri>https://forest.topos.site/nestruev-2020-smooth</fr:display-uri>
            <fr:route>/nestruev-2020-smooth/</fr:route>
            <fr:title text="Smooth Manifolds and Observables">Smooth Manifolds and Observables</fr:title>
            <fr:taxon>Reference</fr:taxon>
            <fr:meta name="doi">10.1007/978-3-030-45650-4</fr:meta>
            <fr:meta name="bibtex"><![CDATA[@book{nestruev-2020-smooth,
  title = {Smooth {{Manifolds}} and {{Observables}}},
  author = {Nestruev, Jet},
  year = 2020,
  series = {Graduate {{Texts}} in {{Mathematics}}},
  volume = {220},
  publisher = {Springer International Publishing},
  address = {Cham},
  doi = {10.1007/978-3-030-45650-4},
  isbn = {978-3-030-45649-8 978-3-030-45650-4}
}]]></fr:meta>
          </fr:frontmatter>
          <fr:mainmatter />
        </fr:tree>
        <fr:tree show-metadata="true" expanded="false" toc="false" numbered="false">
          <fr:frontmatter>
            <fr:authors>
              <fr:author>
                <fr:link href="/david-christiansen/" title="David Thrane Christiansen" uri="https://forest.topos.site/david-christiansen/" display-uri="https://forest.topos.site/david-christiansen" type="local">David Thrane Christiansen</fr:link>
              </fr:author>
            </fr:authors>
            <fr:date>
              <fr:year>2018</fr:year>
            </fr:date>
            <fr:uri>https://forest.topos.site/christiansen-2018-checking/</fr:uri>
            <fr:display-uri>https://forest.topos.site/christiansen-2018-checking</fr:display-uri>
            <fr:route>/christiansen-2018-checking/</fr:route>
            <fr:title text="Checking Dependent Types with Normalization by Evaluation: A Tutorial">Checking Dependent Types with Normalization by Evaluation: A Tutorial</fr:title>
            <fr:taxon>Reference</fr:taxon>
            <fr:meta name="external">https://davidchristiansen.dk/tutorials/nbe/</fr:meta>
            <fr:meta name="bibtex"><![CDATA[@misc{christiansen-2018-checking,
  title = {Checking {{Dependent Types}} with {{Normalization}} by {{Evaluation}}: {{A Tutorial}}},
  author = {Christiansen, David},
  year = 2018,
  url = {https://davidchristiansen.dk/tutorials/nbe/}
}]]></fr:meta>
          </fr:frontmatter>
          <fr:mainmatter />
        </fr:tree>
        <fr:tree show-metadata="true" expanded="false" toc="false" numbered="false">
          <fr:frontmatter>
            <fr:authors>
              <fr:author>
                <fr:link href="/steve-awodey/" title="Steve Awodey" uri="https://forest.topos.site/steve-awodey/" display-uri="https://forest.topos.site/steve-awodey" type="local">Steve Awodey</fr:link>
              </fr:author>
              <fr:author>
                <fr:link href="/clive-newstead/" title="Clive Newstead" uri="https://forest.topos.site/clive-newstead/" display-uri="https://forest.topos.site/clive-newstead" type="local">Clive Newstead</fr:link>
              </fr:author>
            </fr:authors>
            <fr:date>
              <fr:year>2018</fr:year>
            </fr:date>
            <fr:uri>https://forest.topos.site/awodey-2018-polynomial/</fr:uri>
            <fr:display-uri>https://forest.topos.site/awodey-2018-polynomial</fr:display-uri>
            <fr:route>/awodey-2018-polynomial/</fr:route>
            <fr:title text="Polynomial pseudomonads and dependent type theory">Polynomial pseudomonads and dependent type theory</fr:title>
            <fr:taxon>Reference</fr:taxon>
            <fr:meta name="doi">10.48550/ARXIV.1802.00997</fr:meta>
            <fr:meta name="bibtex"><![CDATA[@misc{awodey-2018-polynomial,
	doi = {10.48550/ARXIV.1802.00997},
	url = {https://arxiv.org/abs/1802.00997},
	author = {Awodey, Steve and Newstead, Clive},
	keywords = {Category Theory (math.CT), Logic (math.LO), FOS: Mathematics, FOS: Mathematics, 03G30, 18C15 (Primary), 18D05, 18D15, 18D25 (Secondary)},
	title = {Polynomial pseudomonads and dependent type theory},
	publisher = {arXiv},
	year = {2018},
	copyright = {arXiv.org perpetual, non-exclusive license}
}]]></fr:meta>
          </fr:frontmatter>
          <fr:mainmatter />
        </fr:tree>
        <fr:tree show-metadata="true" expanded="false" toc="false" numbered="false">
          <fr:frontmatter>
            <fr:authors>
              <fr:author>
                <fr:link href="/thorsten-altenkirch/" title="Thorsten Altenkirch" uri="https://forest.topos.site/thorsten-altenkirch/" display-uri="https://forest.topos.site/thorsten-altenkirch" type="local">Thorsten Altenkirch</fr:link>
              </fr:author>
              <fr:author>
                <fr:link href="/paolo-capriotti/" title="Paolo Capriotti" uri="https://forest.topos.site/paolo-capriotti/" display-uri="https://forest.topos.site/paolo-capriotti" type="local">Paolo Capriotti</fr:link>
              </fr:author>
              <fr:author>
                <fr:link href="/gabe-dijkstra/" title="Gabe Dijkstra" uri="https://forest.topos.site/gabe-dijkstra/" display-uri="https://forest.topos.site/gabe-dijkstra" type="local">Gabe Dijkstra</fr:link>
              </fr:author>
              <fr:author>
                <fr:link href="/nicolai-kraus/" title="Nicolai Kraus" uri="https://forest.topos.site/nicolai-kraus/" display-uri="https://forest.topos.site/nicolai-kraus" type="local">Nicolai Kraus</fr:link>
              </fr:author>
              <fr:author>
                <fr:link href="/fredrik-nordvall/" title="Fredrik Nordvall Forsberg" uri="https://forest.topos.site/fredrik-nordvall/" display-uri="https://forest.topos.site/fredrik-nordvall" type="local">Fredrik Nordvall Forsberg</fr:link>
              </fr:author>
            </fr:authors>
            <fr:date>
              <fr:year>2018</fr:year>
            </fr:date>
            <fr:uri>https://forest.topos.site/altenkirch-2018-quotient/</fr:uri>
            <fr:display-uri>https://forest.topos.site/altenkirch-2018-quotient</fr:display-uri>
            <fr:route>/altenkirch-2018-quotient/</fr:route>
            <fr:title text="Quotient Inductive-Inductive Types">Quotient Inductive-Inductive Types</fr:title>
            <fr:taxon>Reference</fr:taxon>
            <fr:meta name="doi">10.1007/978-3-319-89366-2_16</fr:meta>
            <fr:meta name="bibtex"><![CDATA[@inbook{altenkirch-2018-quotient,
	title = {Quotient Inductive-Inductive Types},
	ISBN = {9783319893662},
	ISSN = {1611-3349},
	url = {http://dx.doi.org/10.1007/978-3-319-89366-2_16},
	DOI = {10.1007/978-3-319-89366-2_16},
	booktitle = {Foundations of Software Science and Computation Structures},
	publisher = {Springer International Publishing},
	author = {Altenkirch, Thorsten and Capriotti, Paolo and Dijkstra, Gabe and Kraus, Nicolai and Nordvall Forsberg, Fredrik},
	year = {2018},
	pages = {293–310}
}]]></fr:meta>
          </fr:frontmatter>
          <fr:mainmatter />
        </fr:tree>
        <fr:tree show-metadata="true" expanded="false" toc="false" numbered="false">
          <fr:frontmatter>
            <fr:authors>
              <fr:author>
                <fr:link href="/mike-shulman/" title="Mike Shulman" uri="https://forest.topos.site/mike-shulman/" display-uri="https://forest.topos.site/mike-shulman" type="local">Mike Shulman</fr:link>
              </fr:author>
            </fr:authors>
            <fr:date>
              <fr:year>2018</fr:year>
            </fr:date>
            <fr:uri>https://forest.topos.site/shulman-2018-type/</fr:uri>
            <fr:display-uri>https://forest.topos.site/shulman-2018-type</fr:display-uri>
            <fr:route>/shulman-2018-type/</fr:route>
            <fr:title text="Type 2-theories">Type 2-theories</fr:title>
            <fr:taxon>Reference</fr:taxon>
            <fr:meta name="external">https://www.math.uwo.ca/faculty/kapulkin/seminars/hottestfiles/Shulman-2018-04-12-HoTTEST.pdf</fr:meta>
            <fr:meta name="bibtex"><![CDATA[@misc{shulman-2018-type,
  title = {Type 2-Theories},
  author = {Shulman, Michael},
  year = 2018,
  url = {https://www.math.uwo.ca/faculty/kapulkin/seminars/hottestfiles/Shulman-2018-04-12-HoTTEST.pdf}
}]]></fr:meta>
          </fr:frontmatter>
          <fr:mainmatter />
        </fr:tree>
        <fr:tree show-metadata="true" expanded="false" toc="false" numbered="false">
          <fr:frontmatter>
            <fr:authors>
              <fr:author>
                <fr:link href="/andre-joyal/" title="Andre Joyal" uri="https://forest.topos.site/andre-joyal/" display-uri="https://forest.topos.site/andre-joyal" type="local">Andre Joyal</fr:link>
              </fr:author>
            </fr:authors>
            <fr:date>
              <fr:year>2017</fr:year>
            </fr:date>
            <fr:uri>https://forest.topos.site/joyal-2017-notes/</fr:uri>
            <fr:display-uri>https://forest.topos.site/joyal-2017-notes</fr:display-uri>
            <fr:route>/joyal-2017-notes/</fr:route>
            <fr:title text="Notes on Clans and Tribes">Notes on Clans and Tribes</fr:title>
            <fr:taxon>Reference</fr:taxon>
            <fr:meta name="doi">10.48550/ARXIV.1710.10238</fr:meta>
            <fr:meta name="bibtex"><![CDATA[@misc{joyal-2017-notes,
	doi = {10.48550/ARXIV.1710.10238},
	url = {https://arxiv.org/abs/1710.10238},
	author = {Joyal, Andre},
	keywords = {Category Theory (math.CT), Algebraic Topology (math.AT), Logic (math.LO), FOS: Mathematics, FOS: Mathematics},
	title = {Notes on Clans and Tribes},
	publisher = {arXiv},
	year = {2017},
	copyright = {arXiv.org perpetual, non-exclusive license}
}]]></fr:meta>
          </fr:frontmatter>
          <fr:mainmatter />
        </fr:tree>
        <fr:tree show-metadata="true" expanded="false" toc="false" numbered="false">
          <fr:frontmatter>
            <fr:authors>
              <fr:author>
                <fr:link href="/michael-shulman/" title="Michael A. Shulman" uri="https://forest.topos.site/michael-shulman/" display-uri="https://forest.topos.site/michael-shulman" type="local">Michael A. Shulman</fr:link>
              </fr:author>
            </fr:authors>
            <fr:date>
              <fr:year>2016</fr:year>
            </fr:date>
            <fr:uri>https://forest.topos.site/shulman-2016-catlog/</fr:uri>
            <fr:display-uri>https://forest.topos.site/shulman-2016-catlog</fr:display-uri>
            <fr:route>/shulman-2016-catlog/</fr:route>
            <fr:title text="Categorical logic from a categorical point of view">Categorical logic from a categorical point of view</fr:title>
            <fr:taxon>Reference</fr:taxon>
            <fr:meta name="external">https://mikeshulman.github.io/catlog/catlog.pdf</fr:meta>
            <fr:meta name="bibtex"><![CDATA[@misc{shulman-2016-catlog,
  title={Categorical logic from a categorical point of view},
  author={Shulman, Mike},
  date={2016},
  url={https://mikeshulman.github.io/catlog/catlog.pdf}
}]]></fr:meta>
          </fr:frontmatter>
          <fr:mainmatter />
        </fr:tree>
        <fr:tree show-metadata="true" expanded="false" toc="false" numbered="false">
          <fr:frontmatter>
            <fr:authors>
              <fr:author>
                <fr:link href="/steve-awodey/" title="Steve Awodey" uri="https://forest.topos.site/steve-awodey/" display-uri="https://forest.topos.site/steve-awodey" type="local">Steve Awodey</fr:link>
              </fr:author>
            </fr:authors>
            <fr:date>
              <fr:year>2016</fr:year>
            </fr:date>
            <fr:uri>https://forest.topos.site/awodey-2016-natural/</fr:uri>
            <fr:display-uri>https://forest.topos.site/awodey-2016-natural</fr:display-uri>
            <fr:route>/awodey-2016-natural/</fr:route>
            <fr:title text="Natural models of homotopy type theory">Natural models of homotopy type theory</fr:title>
            <fr:taxon>Reference</fr:taxon>
            <fr:meta name="doi">10.1017/s0960129516000268</fr:meta>
            <fr:meta name="bibtex"><![CDATA[@article{awodey-2016-natural,
	title = {Natural models of homotopy type theory},
	volume = {28},
	ISSN = {1469-8072},
	url = {http://dx.doi.org/10.1017/S0960129516000268},
	DOI = {10.1017/s0960129516000268},
	number = {2},
	journal = {Mathematical Structures in Computer Science},
	publisher = {Cambridge University Press (CUP)},
	author = {Awodey, Steve},
	year = {2016},
	month = {nov},
	pages = {241–286}
}]]></fr:meta>
          </fr:frontmatter>
          <fr:mainmatter />
        </fr:tree>
        <fr:tree show-metadata="true" expanded="false" toc="false" numbered="false">
          <fr:frontmatter>
            <fr:authors>
              <fr:author>
                <fr:link href="/andreas-rossberg/" title="Andreas Rossberg" uri="https://forest.topos.site/andreas-rossberg/" display-uri="https://forest.topos.site/andreas-rossberg" type="local">Andreas Rossberg</fr:link>
              </fr:author>
            </fr:authors>
            <fr:date>
              <fr:year>2015</fr:year>
            </fr:date>
            <fr:uri>https://forest.topos.site/rossberg-2015-ml/</fr:uri>
            <fr:display-uri>https://forest.topos.site/rossberg-2015-ml</fr:display-uri>
            <fr:route>/rossberg-2015-ml/</fr:route>
            <fr:title text="1ML – core and modules united (F-ing first-class modules)">1ML – core and modules united (F-ing first-class modules)</fr:title>
            <fr:taxon>Reference</fr:taxon>
            <fr:meta name="doi">10.1145/2858949.2784738</fr:meta>
            <fr:meta name="bibtex"><![CDATA[@article{rossberg-2015-ml,
	title = {1ML – core and modules united (F-ing first-class modules)},
	volume = {50},
	ISSN = {1558-1160},
	url = {http://dx.doi.org/10.1145/2858949.2784738},
	DOI = {10.1145/2858949.2784738},
	number = {9},
	journal = {ACM SIGPLAN Notices},
	publisher = {Association for Computing Machinery (ACM)},
	author = {Rossberg, Andreas},
	year = {2015},
	month = {aug},
	pages = {35–47}
}]]></fr:meta>
          </fr:frontmatter>
          <fr:mainmatter />
        </fr:tree>
        <fr:tree show-metadata="true" expanded="false" toc="false" numbered="false">
          <fr:frontmatter>
            <fr:authors>
              <fr:author>
                <fr:link href="/stephen-lack/" title="Stephen Lack" uri="https://forest.topos.site/stephen-lack/" display-uri="https://forest.topos.site/stephen-lack" type="local">Stephen Lack</fr:link>
              </fr:author>
            </fr:authors>
            <fr:date>
              <fr:year>2009</fr:year>
            </fr:date>
            <fr:uri>https://forest.topos.site/lack-2009-categories/</fr:uri>
            <fr:display-uri>https://forest.topos.site/lack-2009-categories</fr:display-uri>
            <fr:route>/lack-2009-categories/</fr:route>
            <fr:title text="A 2-Categories Companion">A 2-Categories Companion</fr:title>
            <fr:taxon>Reference</fr:taxon>
            <fr:meta name="doi">10.1007/978-1-4419-1524-5_4</fr:meta>
            <fr:meta name="bibtex"><![CDATA[@inbook{lack-2009-categories,
	title = {A 2-Categories Companion},
	ISBN = {9781441915245},
	ISSN = {0940-6573},
	url = {http://dx.doi.org/10.1007/978-1-4419-1524-5_4},
	DOI = {10.1007/978-1-4419-1524-5_4},
	booktitle = {Towards Higher Categories},
	publisher = {Springer New York},
	author = {Lack, Stephen},
	year = {2009},
	month = {sep},
	pages = {105–191}
}]]></fr:meta>
          </fr:frontmatter>
          <fr:mainmatter />
        </fr:tree>
        <fr:tree show-metadata="true" expanded="false" toc="false" numbered="false">
          <fr:frontmatter>
            <fr:authors>
              <fr:author>
                <fr:link href="/oleksandr-manzyuk/" title="Oleksandr Manzyuk" uri="https://forest.topos.site/oleksandr-manzyuk/" display-uri="https://forest.topos.site/oleksandr-manzyuk" type="local">Oleksandr Manzyuk</fr:link>
              </fr:author>
            </fr:authors>
            <fr:date>
              <fr:year>2009</fr:year>
            </fr:date>
            <fr:uri>https://forest.topos.site/manzyuk-2009-closed/</fr:uri>
            <fr:display-uri>https://forest.topos.site/manzyuk-2009-closed</fr:display-uri>
            <fr:route>/manzyuk-2009-closed/</fr:route>
            <fr:title text="Closed categories vs. closed multicategories">Closed categories vs. closed multicategories</fr:title>
            <fr:taxon>Reference</fr:taxon>
            <fr:meta name="external">http://www.tac.mta.ca/tac/volumes/26/5/26-05.pdf</fr:meta>
            <fr:meta name="bibtex"><![CDATA[@article{manzyuk-2009-closed,
	author = {Manzyuk, Oleksandr},
	title = {Closed categories vs. closed multicategories},
	journal = {Theory and Applications of Categories},
	year = {2012},
  volume = {26},
  number = {5},
  pages = {132--175}
}]]></fr:meta>
          </fr:frontmatter>
          <fr:mainmatter />
        </fr:tree>
        <fr:tree show-metadata="true" expanded="false" toc="false" numbered="false">
          <fr:frontmatter>
            <fr:authors>
              <fr:author>
                <fr:link href="/thorsten-altenkirch/" title="Thorsten Altenkirch" uri="https://forest.topos.site/thorsten-altenkirch/" display-uri="https://forest.topos.site/thorsten-altenkirch" type="local">Thorsten Altenkirch</fr:link>
              </fr:author>
              <fr:author>
                <fr:link href="/conor-mcbride/" title="Conor McBride" uri="https://forest.topos.site/conor-mcbride/" display-uri="https://forest.topos.site/conor-mcbride" type="local">Conor McBride</fr:link>
              </fr:author>
              <fr:author>
                <fr:link href="/wouter-swierstra/" title="Wouter Swierstra" uri="https://forest.topos.site/wouter-swierstra/" display-uri="https://forest.topos.site/wouter-swierstra" type="local">Wouter Swierstra</fr:link>
              </fr:author>
            </fr:authors>
            <fr:date>
              <fr:year>2007</fr:year>
            </fr:date>
            <fr:uri>https://forest.topos.site/altenkirch-2007-observational/</fr:uri>
            <fr:display-uri>https://forest.topos.site/altenkirch-2007-observational</fr:display-uri>
            <fr:route>/altenkirch-2007-observational/</fr:route>
            <fr:title text="Observational equality, now!">Observational equality, now!</fr:title>
            <fr:taxon>Reference</fr:taxon>
            <fr:meta name="doi">10.1145/1292597.1292608</fr:meta>
            <fr:meta name="bibtex"><![CDATA[@inproceedings{altenkirch-2007-observational,
	series = {ICFP07},
	title = {Observational equality, now!},
	url = {http://dx.doi.org/10.1145/1292597.1292608},
	DOI = {10.1145/1292597.1292608},
	booktitle = {Proceedings of the 2007 workshop on Programming languages meets program verification},
	publisher = {ACM},
	author = {Altenkirch, Thorsten and McBride, Conor and Swierstra, Wouter},
	year = {2007},
	month = {oct},
	pages = {57–68},
	collection = {ICFP07}
}]]></fr:meta>
          </fr:frontmatter>
          <fr:mainmatter />
        </fr:tree>
        <fr:tree show-metadata="true" expanded="false" toc="false" numbered="false">
          <fr:frontmatter>
            <fr:authors>
              <fr:author>
                <fr:link href="/tom-leinster/" title="Tom Leinster" uri="https://forest.topos.site/tom-leinster/" display-uri="https://forest.topos.site/tom-leinster" type="local">Tom Leinster</fr:link>
              </fr:author>
            </fr:authors>
            <fr:date>
              <fr:year>2004</fr:year>
            </fr:date>
            <fr:uri>https://forest.topos.site/leinster-2004-higher/</fr:uri>
            <fr:display-uri>https://forest.topos.site/leinster-2004-higher</fr:display-uri>
            <fr:route>/leinster-2004-higher/</fr:route>
            <fr:title text="Higher Operads, Higher Categories">Higher Operads, Higher Categories</fr:title>
            <fr:taxon>Reference</fr:taxon>
            <fr:meta name="doi">10.1017/cbo9780511525896</fr:meta>
            <fr:meta name="bibtex"><![CDATA[@book{leinster-2004-higher,
	title = {Higher Operads, Higher Categories},
	ISBN = {9780511525896},
	url = {http://dx.doi.org/10.1017/CBO9780511525896},
	DOI = {10.1017/cbo9780511525896},
	publisher = {Cambridge University Press},
	author = {Leinster, Tom},
	year = {2004},
	month = {jul}
}]]></fr:meta>
          </fr:frontmatter>
          <fr:mainmatter />
        </fr:tree>
        <fr:tree show-metadata="true" expanded="false" toc="false" numbered="false">
          <fr:frontmatter>
            <fr:authors>
              <fr:author>
                <fr:link href="/peter-johnstone/" title="Peter T Johnstone" uri="https://forest.topos.site/peter-johnstone/" display-uri="https://forest.topos.site/peter-johnstone" type="local">Peter T Johnstone</fr:link>
              </fr:author>
            </fr:authors>
            <fr:date>
              <fr:year>2002</fr:year>
            </fr:date>
            <fr:uri>https://forest.topos.site/johnstone-2002-sketches/</fr:uri>
            <fr:display-uri>https://forest.topos.site/johnstone-2002-sketches</fr:display-uri>
            <fr:route>/johnstone-2002-sketches/</fr:route>
            <fr:title text="Sketches of an Elephant A Topos Theory Compendium">Sketches of an Elephant A Topos Theory Compendium</fr:title>
            <fr:taxon>Reference</fr:taxon>
            <fr:meta name="doi">10.1093/oso/9780198515982.001.0001</fr:meta>
            <fr:meta name="bibtex"><![CDATA[@book{johnstone-2002-sketches,
	title = {Sketches of an Elephant A Topos Theory Compendium},
	ISBN = {9781383022872},
	url = {http://dx.doi.org/10.1093/oso/9780198515982.001.0001},
	DOI = {10.1093/oso/9780198515982.001.0001},
	publisher = {Oxford University PressOxford},
	author = {Johnstone, Peter T},
	year = {2002},
	month = {sep}
}]]></fr:meta>
          </fr:frontmatter>
          <fr:mainmatter />
        </fr:tree>
        <fr:tree show-metadata="true" expanded="false" toc="false" numbered="false">
          <fr:frontmatter>
            <fr:authors>
              <fr:author>
                <fr:link href="/noson-yanofsky/" title="Noson S. Yanofsky" uri="https://forest.topos.site/noson-yanofsky/" display-uri="https://forest.topos.site/noson-yanofsky" type="local">Noson S. Yanofsky</fr:link>
              </fr:author>
            </fr:authors>
            <fr:date>
              <fr:year>2000</fr:year>
            </fr:date>
            <fr:uri>https://forest.topos.site/yanofsky-2000-coherence/</fr:uri>
            <fr:display-uri>https://forest.topos.site/yanofsky-2000-coherence</fr:display-uri>
            <fr:route>/yanofsky-2000-coherence/</fr:route>
            <fr:title text="Coherence, Homotopy and 2-Theories">Coherence, Homotopy and 2-Theories</fr:title>
            <fr:taxon>Reference</fr:taxon>
            <fr:meta name="doi">10.48550/ARXIV.MATH/0007033</fr:meta>
            <fr:meta name="bibtex"><![CDATA[@misc{yanofsky-2000-coherence,
	doi = {10.48550/ARXIV.MATH/0007033},
	url = {https://arxiv.org/abs/math/0007033},
	author = {Yanofsky, Noson S.},
	keywords = {Category Theory (math.CT), Quantum Algebra (math.QA), FOS: Mathematics, FOS: Mathematics, 18D10; 18C10; 55U35},
	title = {Coherence, Homotopy and 2-Theories},
	publisher = {arXiv},
	year = {2000},
	copyright = {Assumed arXiv.org perpetual, non-exclusive license to distribute this article for submissions made before January 2004}
}]]></fr:meta>
          </fr:frontmatter>
          <fr:mainmatter />
        </fr:tree>
        <fr:tree show-metadata="true" expanded="false" toc="false" numbered="false">
          <fr:frontmatter>
            <fr:authors>
              <fr:author>
                <fr:link href="/michael-barr/" title="Michael Barr" uri="https://forest.topos.site/michael-barr/" display-uri="https://forest.topos.site/michael-barr" type="local">Michael Barr</fr:link>
              </fr:author>
            </fr:authors>
            <fr:date>
              <fr:year>1999</fr:year>
            </fr:date>
            <fr:uri>https://forest.topos.site/barr-1999-notes/</fr:uri>
            <fr:display-uri>https://forest.topos.site/barr-1999-notes</fr:display-uri>
            <fr:route>/barr-1999-notes/</fr:route>
            <fr:title text="Notes on sketches">Notes on sketches</fr:title>
            <fr:taxon>Reference</fr:taxon>
            <fr:meta name="external">https://www.math.mcgill.ca/barr/papers/sketch.pdf</fr:meta>
            <fr:meta name="bibtex"><![CDATA[@unpublished{barr-1999-notes,
  title = {Notes on Sketches},
  author = {Barr, Michael},
  year = 1999,
  url = {https://www.math.mcgill.ca/barr/papers/sketch.pdf}
}]]></fr:meta>
          </fr:frontmatter>
          <fr:mainmatter />
        </fr:tree>
        <fr:tree show-metadata="true" expanded="false" toc="false" numbered="false">
          <fr:frontmatter>
            <fr:authors>
              <fr:author>
                <fr:link href="/j-adamek/" title="J. Adamek" uri="https://forest.topos.site/j-adamek/" display-uri="https://forest.topos.site/j-adamek" type="local">J. Adamek</fr:link>
              </fr:author>
              <fr:author>
                <fr:link href="/m-hubert/" title="M. Hubert" uri="https://forest.topos.site/m-hubert/" display-uri="https://forest.topos.site/m-hubert" type="local">M. Hubert</fr:link>
              </fr:author>
              <fr:author>
                <fr:link href="/j-rosicky/" title="J. Rosicky" uri="https://forest.topos.site/j-rosicky/" display-uri="https://forest.topos.site/j-rosicky" type="local">J. Rosicky</fr:link>
              </fr:author>
            </fr:authors>
            <fr:date>
              <fr:year>1999</fr:year>
            </fr:date>
            <fr:uri>https://forest.topos.site/adamek-1999-essentially/</fr:uri>
            <fr:display-uri>https://forest.topos.site/adamek-1999-essentially</fr:display-uri>
            <fr:route>/adamek-1999-essentially/</fr:route>
            <fr:title text="On essentially algebraic theorries and their generalizations">On essentially algebraic theorries and their generalizations</fr:title>
            <fr:taxon>Reference</fr:taxon>
            <fr:meta name="doi">10.1007/s000120050111</fr:meta>
            <fr:meta name="bibtex"><![CDATA[@article{adamek-1999-essentially,
	title = {On essentially algebraic theorries and their generalizations},
	volume = {41},
	ISSN = {1420-8911},
	url = {http://dx.doi.org/10.1007/s000120050111},
	DOI = {10.1007/s000120050111},
	number = {3},
	journal = {Algebra Universalis},
	publisher = {Springer Science and Business Media LLC},
	author = {Adamek, J. and Hubert, M. and Rosicky, J.},
	year = {1999},
	month = {aug},
	pages = {213–227}
}]]></fr:meta>
          </fr:frontmatter>
          <fr:mainmatter />
        </fr:tree>
        <fr:tree show-metadata="true" expanded="false" toc="false" numbered="false">
          <fr:frontmatter>
            <fr:authors>
              <fr:author>
                <fr:link href="/thierry-coquand/" title="Thierry Coquand" uri="https://forest.topos.site/thierry-coquand/" display-uri="https://forest.topos.site/thierry-coquand" type="local">Thierry Coquand</fr:link>
              </fr:author>
            </fr:authors>
            <fr:date>
              <fr:year>1996</fr:year>
            </fr:date>
            <fr:uri>https://forest.topos.site/coquand-1996-algorithm/</fr:uri>
            <fr:display-uri>https://forest.topos.site/coquand-1996-algorithm</fr:display-uri>
            <fr:route>/coquand-1996-algorithm/</fr:route>
            <fr:title text="An algorithm for type-checking dependent types">An algorithm for type-checking dependent types</fr:title>
            <fr:taxon>Reference</fr:taxon>
            <fr:meta name="doi">10.1016/0167-6423(95)00021-6</fr:meta>
            <fr:meta name="bibtex"><![CDATA[@article{coquand-1996-algorithm,
	title = {An algorithm for type-checking dependent types},
	volume = {26},
	ISSN = {0167-6423},
	url = {http://dx.doi.org/10.1016/0167-6423(95)00021-6},
	DOI = {10.1016/0167-6423(95)00021-6},
	number = {1–3},
	journal = {Science of Computer Programming},
	publisher = {Elsevier BV},
	author = {Coquand, Thierry},
	year = {1996},
	month = {may},
	pages = {167–177}
}]]></fr:meta>
          </fr:frontmatter>
          <fr:mainmatter />
        </fr:tree>
        <fr:tree show-metadata="true" expanded="false" toc="false" numbered="false">
          <fr:frontmatter>
            <fr:authors>
              <fr:author>
                <fr:link href="/j-adamek/" title="J. Adamek" uri="https://forest.topos.site/j-adamek/" display-uri="https://forest.topos.site/j-adamek" type="local">J. Adamek</fr:link>
              </fr:author>
              <fr:author>
                <fr:link href="/j-rosicky/" title="J. Rosicky" uri="https://forest.topos.site/j-rosicky/" display-uri="https://forest.topos.site/j-rosicky" type="local">J. Rosicky</fr:link>
              </fr:author>
            </fr:authors>
            <fr:date>
              <fr:year>1994</fr:year>
            </fr:date>
            <fr:uri>https://forest.topos.site/adamek-1994-locally/</fr:uri>
            <fr:display-uri>https://forest.topos.site/adamek-1994-locally</fr:display-uri>
            <fr:route>/adamek-1994-locally/</fr:route>
            <fr:title text="Locally Presentable and Accessible Categories">Locally Presentable and Accessible Categories</fr:title>
            <fr:taxon>Reference</fr:taxon>
            <fr:meta name="doi">10.1017/cbo9780511600579</fr:meta>
            <fr:meta name="bibtex"><![CDATA[@book{adamek-1994-locally,
	title = {Locally Presentable and Accessible Categories},
	ISBN = {9780511600579},
	url = {http://dx.doi.org/10.1017/CBO9780511600579},
	DOI = {10.1017/cbo9780511600579},
	publisher = {Cambridge University Press},
	author = {Adamek, J. and Rosicky, J.},
	year = {1994},
	month = {mar}
}]]></fr:meta>
          </fr:frontmatter>
          <fr:mainmatter />
        </fr:tree>
        <fr:tree show-metadata="true" expanded="false" toc="false" numbered="false">
          <fr:frontmatter>
            <fr:authors>
              <fr:author>
                <fr:link href="/tim-freeman/" title="Tim Freeman" uri="https://forest.topos.site/tim-freeman/" display-uri="https://forest.topos.site/tim-freeman" type="local">Tim Freeman</fr:link>
              </fr:author>
              <fr:author>
                <fr:link href="/frank-pfenning/" title="Frank Pfenning" uri="https://forest.topos.site/frank-pfenning/" display-uri="https://forest.topos.site/frank-pfenning" type="local">Frank Pfenning</fr:link>
              </fr:author>
            </fr:authors>
            <fr:date>
              <fr:year>1991</fr:year>
            </fr:date>
            <fr:uri>https://forest.topos.site/freeman-1991-refinement/</fr:uri>
            <fr:display-uri>https://forest.topos.site/freeman-1991-refinement</fr:display-uri>
            <fr:route>/freeman-1991-refinement/</fr:route>
            <fr:title text="Refinement types for ML">Refinement types for ML</fr:title>
            <fr:taxon>Reference</fr:taxon>
            <fr:meta name="doi">10.1145/113445.113468</fr:meta>
            <fr:meta name="bibtex"><![CDATA[@inproceedings{freeman-1991-refinement,
	series = {PLDI ’91},
	title = {Refinement types for ML},
	url = {http://dx.doi.org/10.1145/113445.113468},
	DOI = {10.1145/113445.113468},
	booktitle = {Proceedings of the ACM SIGPLAN 1991 conference on Programming language design and implementation  - PLDI ’91},
	publisher = {ACM Press},
	author = {Freeman, Tim and Pfenning, Frank},
	year = {1991},
	pages = {268–277},
	collection = {PLDI ’91}
}]]></fr:meta>
          </fr:frontmatter>
          <fr:mainmatter />
        </fr:tree>
        <fr:tree show-metadata="true" expanded="false" toc="false" numbered="false">
          <fr:frontmatter>
            <fr:authors>
              <fr:author>
                <fr:link href="/john-gray/" title="John W. Gray" uri="https://forest.topos.site/john-gray/" display-uri="https://forest.topos.site/john-gray" type="local">John W. Gray</fr:link>
              </fr:author>
            </fr:authors>
            <fr:date>
              <fr:year>1989</fr:year>
            </fr:date>
            <fr:uri>https://forest.topos.site/gray-1989-category/</fr:uri>
            <fr:display-uri>https://forest.topos.site/gray-1989-category</fr:display-uri>
            <fr:route>/gray-1989-category/</fr:route>
            <fr:title text="The category of sketches as a model for algebraic semantics">The category of sketches as a model for algebraic semantics</fr:title>
            <fr:taxon>Reference</fr:taxon>
            <fr:meta name="doi">10.1090/conm/092/1003198</fr:meta>
            <fr:meta name="bibtex"><![CDATA[@misc{gray-1989-category,
	title = {The category of sketches as a model for algebraic semantics},
	ISSN = {0271-4132},
	url = {http://dx.doi.org/10.1090/conm/092/1003198},
	DOI = {10.1090/conm/092/1003198},
	journal = {Categories in Computer Science and Logic},
	publisher = {American Mathematical Society},
	author = {Gray, John W.},
	year = {1989},
	pages = {109–135}
}]]></fr:meta>
          </fr:frontmatter>
          <fr:mainmatter />
        </fr:tree>
        <fr:tree show-metadata="true" expanded="false" toc="false" numbered="false">
          <fr:frontmatter>
            <fr:authors>
              <fr:author>
                <fr:link href="/john-cartmell/" title="John Cartmell" uri="https://forest.topos.site/john-cartmell/" display-uri="https://forest.topos.site/john-cartmell" type="local">John Cartmell</fr:link>
              </fr:author>
            </fr:authors>
            <fr:date>
              <fr:year>1986</fr:year>
            </fr:date>
            <fr:uri>https://forest.topos.site/cartmell-1986-generalised/</fr:uri>
            <fr:display-uri>https://forest.topos.site/cartmell-1986-generalised</fr:display-uri>
            <fr:route>/cartmell-1986-generalised/</fr:route>
            <fr:title text="Generalised algebraic theories and contextual categories">Generalised algebraic theories and contextual categories</fr:title>
            <fr:taxon>Reference</fr:taxon>
            <fr:meta name="doi">10.1016/0168-0072(86)90053-9</fr:meta>
            <fr:meta name="bibtex"><![CDATA[@article{cartmell-1986-generalised,
	title = {Generalised algebraic theories and contextual categories},
	volume = {32},
	ISSN = {0168-0072},
	url = {http://dx.doi.org/10.1016/0168-0072(86)90053-9},
	DOI = {10.1016/0168-0072(86)90053-9},
	journal = {Annals of Pure and Applied Logic},
	publisher = {Elsevier BV},
	author = {Cartmell, John},
	year = {1986},
	pages = {209–243}
}]]></fr:meta>
          </fr:frontmatter>
          <fr:mainmatter />
        </fr:tree>
        <fr:tree show-metadata="true" expanded="false" toc="false" numbered="false">
          <fr:frontmatter>
            <fr:authors>
              <fr:author>
                <fr:link href="/joachim-lambek/" title="Joachim Lambek" uri="https://forest.topos.site/joachim-lambek/" display-uri="https://forest.topos.site/joachim-lambek" type="local">Joachim Lambek</fr:link>
              </fr:author>
              <fr:author>
                <fr:link href="/phil-scott/" title="Phil Scott" uri="https://forest.topos.site/phil-scott/" display-uri="https://forest.topos.site/phil-scott" type="local">Phil Scott</fr:link>
              </fr:author>
            </fr:authors>
            <fr:date>
              <fr:year>1986</fr:year>
            </fr:date>
            <fr:uri>https://forest.topos.site/lambek-1986-introduction/</fr:uri>
            <fr:display-uri>https://forest.topos.site/lambek-1986-introduction</fr:display-uri>
            <fr:route>/lambek-1986-introduction/</fr:route>
            <fr:title text="Introduction to higher-order categorical logic">Introduction to higher-order categorical logic</fr:title>
            <fr:taxon>Reference</fr:taxon>
            <fr:meta name="bibtex"><![CDATA[@book{lambek-1986-introduction,
	title = {Introduction to higher-order categorical logic},
	author = {Lambek, Joachim and Scott, Phil},
	publisher = {Cambridge University Press},
	series = {Cambridge studies in advanced mathematics},
	year = {1986},
	address = {Cambridge, England},
  number = {7}
}]]></fr:meta>
          </fr:frontmatter>
          <fr:mainmatter />
        </fr:tree>
        <fr:tree show-metadata="true" expanded="false" toc="false" numbered="false">
          <fr:frontmatter>
            <fr:authors>
              <fr:author>
                <fr:link href="/paul-taylor/" title="Paul Taylor" uri="https://forest.topos.site/paul-taylor/" display-uri="https://forest.topos.site/paul-taylor" type="local">Paul Taylor</fr:link>
              </fr:author>
            </fr:authors>
            <fr:date>
              <fr:year>1986</fr:year>
            </fr:date>
            <fr:uri>https://forest.topos.site/taylor-1986-recursive/</fr:uri>
            <fr:display-uri>https://forest.topos.site/taylor-1986-recursive</fr:display-uri>
            <fr:route>/taylor-1986-recursive/</fr:route>
            <fr:title text="Recursive Domains, Indexed Category Theory and Polymorphism">Recursive Domains, Indexed Category Theory and Polymorphism</fr:title>
            <fr:taxon>Reference</fr:taxon>
            <fr:meta name="external">https://ncatlab.org/nlab/files/Taylor-IndexedCategoryTheory.pdf</fr:meta>
            <fr:meta name="bibtex"><![CDATA[@phdthesis{taylor-1986-recursive,
  title = {Recursive Domains, Indexed Category Theory and Polymorphism},
  author = {Taylor, Paul},
  school = {University of Cambridge},
  year = {1986}
}]]></fr:meta>
          </fr:frontmatter>
          <fr:mainmatter />
        </fr:tree>
        <fr:tree show-metadata="true" expanded="false" toc="false" numbered="false">
          <fr:frontmatter>
            <fr:authors>
              <fr:author>
                <fr:link href="/anders-kock/" title="Anders Kock" uri="https://forest.topos.site/anders-kock/" display-uri="https://forest.topos.site/anders-kock" type="local">Anders Kock</fr:link>
              </fr:author>
              <fr:author>
                <fr:link href="/gonzalo-e-reyes/" title="Gonzalo E. Reyes" uri="https://forest.topos.site/gonzalo-e-reyes/" display-uri="https://forest.topos.site/gonzalo-e-reyes" type="local">Gonzalo E. Reyes</fr:link>
              </fr:author>
            </fr:authors>
            <fr:date>
              <fr:year>1977</fr:year>
            </fr:date>
            <fr:uri>https://forest.topos.site/kock-1977-doctrines/</fr:uri>
            <fr:display-uri>https://forest.topos.site/kock-1977-doctrines</fr:display-uri>
            <fr:route>/kock-1977-doctrines/</fr:route>
            <fr:title text="Doctrines in Categorical Logic">Doctrines in Categorical Logic</fr:title>
            <fr:taxon>Reference</fr:taxon>
            <fr:meta name="doi">10.1016/s0049-237x(08)71104-2</fr:meta>
            <fr:meta name="bibtex"><![CDATA[@inbook{kock-1977-doctrines,
	title = {Doctrines in Categorical Logic},
	ISSN = {0049-237X},
	url = {http://dx.doi.org/10.1016/S0049-237X(08)71104-2},
	DOI = {10.1016/s0049-237x(08)71104-2},
	booktitle = {HANDBOOK OF MATHEMATICAL LOGIC},
	publisher = {Elsevier},
	author = {Kock, A. and Reyes, G.E.},
	year = {1977},
	pages = {283–313}
}]]></fr:meta>
          </fr:frontmatter>
          <fr:mainmatter />
        </fr:tree>
        <fr:tree show-metadata="true" expanded="false" toc="false" numbered="false">
          <fr:frontmatter>
            <fr:authors>
              <fr:author>
                <fr:link href="/ashok-chandra/" title="Ashok K. Chandra" uri="https://forest.topos.site/ashok-chandra/" display-uri="https://forest.topos.site/ashok-chandra" type="local">Ashok K. Chandra</fr:link>
              </fr:author>
              <fr:author>
                <fr:link href="/philip-merlin/" title="Philip M. Merlin" uri="https://forest.topos.site/philip-merlin/" display-uri="https://forest.topos.site/philip-merlin" type="local">Philip M. Merlin</fr:link>
              </fr:author>
            </fr:authors>
            <fr:date>
              <fr:year>1977</fr:year>
            </fr:date>
            <fr:uri>https://forest.topos.site/chandra-1977-optimal/</fr:uri>
            <fr:display-uri>https://forest.topos.site/chandra-1977-optimal</fr:display-uri>
            <fr:route>/chandra-1977-optimal/</fr:route>
            <fr:title text="Optimal implementation of conjunctive queries in relational data bases">Optimal implementation of conjunctive queries in relational data bases</fr:title>
            <fr:taxon>Reference</fr:taxon>
            <fr:meta name="doi">10.1145/800105.803397</fr:meta>
            <fr:meta name="bibtex"><![CDATA[@inproceedings{chandra-1977-optimal,
	series = {STOC ’77},
	title = {Optimal implementation of conjunctive queries in relational data bases},
	url = {http://dx.doi.org/10.1145/800105.803397},
	DOI = {10.1145/800105.803397},
	booktitle = {Proceedings of the ninth annual ACM symposium on Theory of computing  - STOC ’77},
	publisher = {ACM Press},
	author = {Chandra, Ashok K. and Merlin, Philip M.},
	year = {1977},
	pages = {77–90},
	collection = {STOC ’77}
}]]></fr:meta>
          </fr:frontmatter>
          <fr:mainmatter />
        </fr:tree>
        <fr:tree show-metadata="true" expanded="false" toc="false" numbered="false">
          <fr:frontmatter>
            <fr:authors>
              <fr:author>
                <fr:link href="/f-william-lawvere/" title="F. William Lawvere" uri="https://forest.topos.site/f-william-lawvere/" display-uri="https://forest.topos.site/f-william-lawvere" type="local">F. William Lawvere</fr:link>
              </fr:author>
            </fr:authors>
            <fr:date>
              <fr:year>1969</fr:year>
            </fr:date>
            <fr:uri>https://forest.topos.site/lawvere-1969-ordinal/</fr:uri>
            <fr:display-uri>https://forest.topos.site/lawvere-1969-ordinal</fr:display-uri>
            <fr:route>/lawvere-1969-ordinal/</fr:route>
            <fr:title text="Ordinal sums and equational doctrines">Ordinal sums and equational doctrines</fr:title>
            <fr:taxon>Reference</fr:taxon>
            <fr:meta name="doi">10.1007/bfb0083085</fr:meta>
            <fr:meta name="external">https://github.com/mattearnshaw/lawvere/blob/master/pdfs/1969-ordinal-sums-and-equational-doctrines.pdf</fr:meta>
            <fr:meta name="bibtex"><![CDATA[@inbook{lawvere-1969-ordinal,
	title = {Ordinal sums and equational doctrines},
	ISBN = {9783540360919},
	ISSN = {1617-9692},
	url = {http://dx.doi.org/10.1007/BFb0083085},
	DOI = {10.1007/bfb0083085},
	booktitle = {Seminar on Triples and Categorical Homology Theory},
	publisher = {Springer Berlin Heidelberg},
	author = {Lawvere, F. William},
	year = {1969},
	pages = {141–155}
}]]></fr:meta>
          </fr:frontmatter>
          <fr:mainmatter />
        </fr:tree>
        <fr:tree show-metadata="true" expanded="false" toc="false" numbered="false">
          <fr:frontmatter>
            <fr:authors>
              <fr:author>
                <fr:link href="/f-william-lawvere/" title="F. William Lawvere" uri="https://forest.topos.site/f-william-lawvere/" display-uri="https://forest.topos.site/f-william-lawvere" type="local">F. William Lawvere</fr:link>
              </fr:author>
            </fr:authors>
            <fr:date>
              <fr:year>1963</fr:year>
            </fr:date>
            <fr:uri>https://forest.topos.site/lawvere-1963-functorial/</fr:uri>
            <fr:display-uri>https://forest.topos.site/lawvere-1963-functorial</fr:display-uri>
            <fr:route>/lawvere-1963-functorial/</fr:route>
            <fr:title text="Functorial Semantics of Algebraic Theories and Some Algebraic Problems in the context of Functorial Semantics of Algebraic Theories">Functorial Semantics of Algebraic Theories and Some Algebraic Problems in the context of Functorial Semantics of Algebraic Theories</fr:title>
            <fr:taxon>Reference</fr:taxon>
            <fr:meta name="external">http://www.tac.mta.ca/tac/reprints/articles/5/tr5abs.html</fr:meta>
            <fr:meta name="bibtex"><![CDATA[@phdthesis{lawvere-1963-functorial,
	author = {Lawvere, F. William},
	title = {Functorial Semantics of Algebraic Theories and Some Algebraic Problems in the context of Functorial Semantics of Algebraic Theories},
	year = {1963},
	school = {Columbia University},
	url = {http://www.tac.mta.ca/tac/reprints/articles/5/tr5abs.html}
}]]></fr:meta>
          </fr:frontmatter>
          <fr:mainmatter />
        </fr:tree>
        <fr:tree show-metadata="true" expanded="false" toc="false" numbered="false">
          <fr:frontmatter>
            <fr:authors>
              <fr:author>
                <fr:link href="/david-jaz-myers/" title="David Jaz Myers" uri="https://forest.topos.site/david-jaz-myers/" display-uri="https://forest.topos.site/david-jaz-myers" type="local">David Jaz Myers</fr:link>
              </fr:author>
            </fr:authors>
            <fr:uri>https://forest.topos.site/myers-2021-book/</fr:uri>
            <fr:display-uri>https://forest.topos.site/myers-2021-book</fr:display-uri>
            <fr:route>/myers-2021-book/</fr:route>
            <fr:title text="Categorical Systems Theory">Categorical Systems Theory</fr:title>
            <fr:taxon>Reference</fr:taxon>
            <fr:meta name="url">http://davidjaz.com/Papers/DynamicalBook.pdf</fr:meta>
            <fr:meta name="bibtex"><![CDATA[@misc{myers-2021-book,
  title={Categorical Systems Theory},
  author={Myers, David Jaz},
  year={2021},
  url={http://davidjaz.com/Papers/DynamicalBook.pdf}
}]]></fr:meta>
          </fr:frontmatter>
          <fr:mainmatter />
        </fr:tree>
        <fr:tree show-metadata="true" expanded="false" toc="false" numbered="false">
          <fr:frontmatter>
            <fr:authors>
              <fr:author>
                <fr:link href="/ohad-kammar/" title="Ohad Kammar" uri="https://forest.topos.site/ohad-kammar/" display-uri="https://forest.topos.site/ohad-kammar" type="local">Ohad Kammar</fr:link>
              </fr:author>
              <fr:author>
                <fr:link href="/robert-wright/" title="Robert Wright" uri="https://forest.topos.site/robert-wright/" display-uri="https://forest.topos.site/robert-wright" type="local">Robert Wright</fr:link>
              </fr:author>
            </fr:authors>
            <fr:uri>https://forest.topos.site/kammar-2024-firstclass/</fr:uri>
            <fr:display-uri>https://forest.topos.site/kammar-2024-firstclass</fr:display-uri>
            <fr:route>/kammar-2024-firstclass/</fr:route>
            <fr:title text="First-class Algebraic Presentations with Elaborator Reflection">First-class Algebraic Presentations with Elaborator Reflection</fr:title>
            <fr:taxon>Reference</fr:taxon>
            <fr:meta name="external">https://icfp24.sigplan.org/details/tyde-2024-papers/5/First-class-Algebraic-Presentations-with-Elaborator-Reflection-Extended-Abstract-</fr:meta>
            <fr:meta name="bibtex"><![CDATA[@misc{kammar-2024-firstclass,
  title = {First-Class {{Algebraic Presentations}} with {{Elaborator Reflection}} ({{Extended Abstract}})},
  author = {Kammar, Ohad and Wright, Robert},
  year = 2024,
  url = {https://icfp24.sigplan.org/details/tyde-2024-papers/5/First-class-Algebraic-Presentations-with-Elaborator-Reflection-Extended-Abstract-}
}]]></fr:meta>
          </fr:frontmatter>
          <fr:mainmatter />
        </fr:tree>
        <fr:tree show-metadata="true" expanded="false" toc="false" numbered="false">
          <fr:frontmatter>
            <fr:authors>
              <fr:author>
                <fr:link href="/michael-barr/" title="Michael Barr" uri="https://forest.topos.site/michael-barr/" display-uri="https://forest.topos.site/michael-barr" type="local">Michael Barr</fr:link>
              </fr:author>
              <fr:author>
                <fr:link href="https://forest.topos.site/charles-wells/" type="external">https://forest.topos.site/charles-wells</fr:link>
              </fr:author>
            </fr:authors>
            <fr:uri>https://forest.topos.site/barr-2005-toposes/</fr:uri>
            <fr:display-uri>https://forest.topos.site/barr-2005-toposes</fr:display-uri>
            <fr:route>/barr-2005-toposes/</fr:route>
            <fr:title text="Toposes, Triples and Theories">Toposes, Triples and Theories</fr:title>
            <fr:taxon>Reference</fr:taxon>
            <fr:meta name="external">http://www.tac.mta.ca/tac/reprints/articles/12/tr12.pdf</fr:meta>
            <fr:meta name="bibtex"><![CDATA[@article{barr-2005-toposes,
	author = {Barr, Michael and Wells, Charles},
	title = {Toposes, Triples and Theories},
	journal = {Reprints in Theory and Applications of Categories},
	year = {2005},
  number = {12},
  pages = {1-288}
}]]></fr:meta>
          </fr:frontmatter>
          <fr:mainmatter />
        </fr:tree>
      </fr:mainmatter>
    </fr:tree>
    <fr:tree show-metadata="false" hidden-when-empty="true">
      <fr:frontmatter>
        <fr:authors />
        <fr:title text="Context">Context</fr:title>
      </fr:frontmatter>
      <fr:mainmatter />
    </fr:tree>
    <fr:tree show-metadata="false" hidden-when-empty="true">
      <fr:frontmatter>
        <fr:authors />
        <fr:title text="Backlinks">Backlinks</fr:title>
      </fr:frontmatter>
      <fr:mainmatter />
    </fr:tree>
    <fr:tree show-metadata="false" hidden-when-empty="true">
      <fr:frontmatter>
        <fr:authors />
        <fr:title text="Related">Related</fr:title>
      </fr:frontmatter>
      <fr:mainmatter />
    </fr:tree>
    <fr:tree show-metadata="false" hidden-when-empty="true">
      <fr:frontmatter>
        <fr:authors />
        <fr:title text="Contributions">Contributions</fr:title>
      </fr:frontmatter>
      <fr:mainmatter />
    </fr:tree>
  </fr:backmatter>
</fr:tree>
