<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="/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="/">
  <fr:frontmatter>
    <fr:authors>
      <fr:author>
        <fr:link href="/eigil-rischel/" title="Eigil Fjeldgren Rischel" uri="https://erischel.com/eigil-rischel/" display-uri="eigil-rischel" type="local">Eigil Fjeldgren Rischel</fr:link>
      </fr:author>
    </fr:authors>
    <fr:date>
      <fr:year>2024</fr:year>
      <fr:month>6</fr:month>
      <fr:day>5</fr:day>
    </fr:date>
    <fr:uri>https://erischel.com/efr-0008/</fr:uri>
    <fr:display-uri>efr-0008</fr:display-uri>
    <fr:route>/efr-0008/</fr:route>
    <fr:title text="Acknowledgements">Acknowledgements</fr:title>
  </fr:frontmatter>
  <fr:mainmatter>
    <html:p>
  I would like to extend a great thanks to the Mathematically Structured Programming group at the University of Strathclyde, my fellow PhD students in particular, for making my time there such a great one. A good chunk of this work was completed while I worked at the Compositional Systems Laboratory at the Tallinn University of Technology---I owe everyone there a great thanks as well.
</html:p>
    <html:p>
  For conversations which contributed to this work, and to my mathematical development in general, I would like to thank Dylan Braithwaite, Matteo Capucci, Elena di Lavore, Tobias Fritz, Davidad, Tomáš Gonda, Bruno Gavranović, Diana Kessler, Owen Lynch, Jade Master, David Jaz Myers, Riu Nakamura, Chad Nester, Evan Patterson, Paolo Perrone, Mario Roman, Brandon Shapiro, Toby Smithe, Pawel Sobocinski, David Spivak, and Andre Videla. A special thanks to Dylan, Matteo, and Bruno, for serving their time with me in the dependent optics mines.
</html:p>
    <html:p>
  To Neil Ghani, Radu Mardare, and Jules Hedges, a massive thanks for serving as my advisors during the somewhat tumultuous process that was the production of this thesis.
</html:p>
    <html:p>
  Finally, I thank my wonderful family. Now you can stop asking me about it.
</html:p>
  </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>
    <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 show-metadata="true" expanded="false" toc="false" numbered="false">
          <fr:frontmatter>
            <fr:authors>
              <fr:author>
                <fr:link href="/eigil-rischel/" title="Eigil Fjeldgren Rischel" uri="https://erischel.com/eigil-rischel/" display-uri="eigil-rischel" type="local">Eigil Fjeldgren Rischel</fr:link>
              </fr:author>
            </fr:authors>
            <fr:date>
              <fr:year>2025</fr:year>
              <fr:month>4</fr:month>
              <fr:day>6</fr:day>
            </fr:date>
            <fr:uri>https://erischel.com/efr-HQ73/</fr:uri>
            <fr:display-uri>efr-HQ73</fr:display-uri>
            <fr:route>/efr-HQ73/</fr:route>
            <fr:title text="Markov Fibrations › Introduction"><fr:link href="/efr-0001/" title="Markov Fibrations" uri="https://erischel.com/efr-0001/" display-uri="efr-0001" type="local">Markov Fibrations</fr:link> › Introduction</fr:title>
          </fr:frontmatter>
          <fr:mainmatter>
            <html:p>
  In applying category theory to fields as diverse as game theory (<fr:link href="/hedges-etal-comp-gametheory/" title="Compositional game theory" uri="https://erischel.com/hedges-etal-comp-gametheory/" display-uri="hedges-etal-comp-gametheory" type="local">Reference <fr:contextual-number uri="https://erischel.com/hedges-etal-comp-gametheory/" display-uri="hedges-etal-comp-gametheory" /></fr:link>,<fr:link href="/hedges-etal-bayesian-games/" title="Bayesian open games" uri="https://erischel.com/hedges-etal-bayesian-games/" display-uri="hedges-etal-bayesian-games" type="local">Reference <fr:contextual-number uri="https://erischel.com/hedges-etal-bayesian-games/" display-uri="hedges-etal-bayesian-games" /></fr:link>, <fr:link href="/hedges-etal-graph-games/" title="Compositional modelling of network games" uri="https://erischel.com/hedges-etal-graph-games/" display-uri="hedges-etal-graph-games" type="local">Reference <fr:contextual-number uri="https://erischel.com/hedges-etal-graph-games/" display-uri="hedges-etal-graph-games" /></fr:link>), 
  machine learning (<fr:link href="/bruno-etal-categorical-learning-2021/" title="Categorical Foundations of Gradient-Based Learning" uri="https://erischel.com/bruno-etal-categorical-learning-2021/" display-uri="bruno-etal-categorical-learning-2021" type="local">Reference <fr:contextual-number uri="https://erischel.com/bruno-etal-categorical-learning-2021/" display-uri="bruno-etal-categorical-learning-2021" /></fr:link>, <fr:link href="/bruno-thesis-fundamental-components/" title="Fundamental Components of Deep Learning: A category-theoretic approach" uri="https://erischel.com/bruno-thesis-fundamental-components/" display-uri="bruno-thesis-fundamental-components" type="local">Reference <fr:contextual-number uri="https://erischel.com/bruno-thesis-fundamental-components/" display-uri="bruno-thesis-fundamental-components" /></fr:link>), dynamical systems (<fr:link href="/myers-cst/" title="Categorical Systems Theory" uri="https://erischel.com/myers-cst/" display-uri="myers-cst" type="local">Reference <fr:contextual-number uri="https://erischel.com/myers-cst/" display-uri="myers-cst" /></fr:link>, <fr:link href="/lynch-myers-rischel-staton-stoch-clocks/" title="Clock systems for stochastic and non-deterministic categorical systems theories" uri="https://erischel.com/lynch-myers-rischel-staton-stoch-clocks/" display-uri="lynch-myers-rischel-staton-stoch-clocks" type="local">Reference <fr:contextual-number uri="https://erischel.com/lynch-myers-rischel-staton-stoch-clocks/" display-uri="lynch-myers-rischel-staton-stoch-clocks" /></fr:link>), and server design (<fr:link href="/videla-capucci-servers/" title="Lenses for Composable Servers" uri="https://erischel.com/videla-capucci-servers/" display-uri="videla-capucci-servers" type="local">Reference <fr:contextual-number uri="https://erischel.com/videla-capucci-servers/" display-uri="videla-capucci-servers" /></fr:link>), people have found it useful to study categories whose morphisms describe processes or functions that take place in two "stages", where the second is dependent on the first, but composes in the other direction---so-called <html:em>lenses</html:em>. In many of these domains, stochastic phenomena play a role. There is a useful generalization of lenses to categories of stochastic maps---the so-called <html:em>optics</html:em> of Riley, <fr:link href="/riley-optics/" title="Categories of optics" uri="https://erischel.com/riley-optics/" display-uri="riley-optics" type="local">Reference <fr:contextual-number uri="https://erischel.com/riley-optics/" display-uri="riley-optics" /></fr:link>---but this does not accommodate another useful generalization, so called <html:em>dependent lenses</html:em> where not only the backwards process but the set it takes values in is indexed over the base. It has been a long-standing problem to develop a suitable common generalization, "dependent optics", of these two ideas. In this thesis, we solve this problem by developing a theory of <html:em>Markov fibrations</html:em> (<fr:link href="/efr-O088/" title="Markov Fibrations and Stochastic Lenses" uri="https://erischel.com/efr-O088/" display-uri="efr-O088" type="local">§ <fr:contextual-number uri="https://erischel.com/efr-O088/" display-uri="efr-O088" /></fr:link>).
</html:p>
            <html:p>
  A Markov fibration is a weakening of the notion of (Grothendieck) fibration to include (subject to some assumptions) Markov categories of indexed families of objects (given by deterministic functions <fr:tex display="inline"><![CDATA[E \to  X]]></fr:tex>) and compatible stochastic maps (given by commutative squares). The main point of Markov fibrations is that they admit <html:em>fiberwise opposites</html:em>, which generalize the fiberwise opposites of ordinary categories. Just as the fiberwise opposite of the codomain fibration of a finitely complete category describes dependent lenses (see <fr:link href="/efr-ZCTD/" title="Optics and Lenses" uri="https://erischel.com/efr-ZCTD/" display-uri="efr-ZCTD" type="local">§ <fr:contextual-number uri="https://erischel.com/efr-ZCTD/" display-uri="efr-ZCTD" /></fr:link>), the fiberwise opposite of these codomain Markov fibrations give a good notion of stochastic lens (see <fr:link href="/efr-K6NM/" title="https://erischel.com/efr-K6NM/" uri="https://erischel.com/efr-K6NM/" display-uri="efr-K6NM" type="local">Theorem <fr:contextual-number uri="https://erischel.com/efr-K6NM/" display-uri="efr-K6NM" /></fr:link>).
</html:p>
            <html:p>
  We will apply our theory chiefly to two problems. First, we will use them to generalize <html:em>open games</html:em> (Hedges, <fr:link href="/hedges-towards-compositional-thesis/" title="Towards compositional game theory" uri="https://erischel.com/hedges-towards-compositional-thesis/" display-uri="hedges-towards-compositional-thesis" type="local">Reference <fr:contextual-number uri="https://erischel.com/hedges-towards-compositional-thesis/" display-uri="hedges-towards-compositional-thesis" /></fr:link>) to a larger class of interfaces (namely, indexed families of sets) while at the same time considering possibly-stochastic maps. This will allow us to construct the so-called <html:em>external choice</html:em> operator on open games, which describes branching.
</html:p>
            <html:p>
  Secondly, we will generalize Myers' categorical dynamical systems theory to allow for stochastic maps in the base. When combined with another generalization of these systems, to general parametrized lenses, this gives a more natural way of modeling certain stochastic dynamical systems, such as those associated to the training dynamics of machine learning models, see eg <fr:link href="/efr-RUTY/" title="Generative Adversarial Network" uri="https://erischel.com/efr-RUTY/" display-uri="efr-RUTY" type="local">Example <fr:contextual-number uri="https://erischel.com/efr-RUTY/" display-uri="efr-RUTY" /></fr:link>.
</html:p>
            <fr:tree show-metadata="false">
              <fr:frontmatter>
                <fr:authors>
                  <fr:author>
                    <fr:link href="/eigil-rischel/" title="Eigil Fjeldgren Rischel" uri="https://erischel.com/eigil-rischel/" display-uri="eigil-rischel" type="local">Eigil Fjeldgren Rischel</fr:link>
                  </fr:author>
                </fr:authors>
                <fr:date>
                  <fr:year>2025</fr:year>
                  <fr:month>4</fr:month>
                  <fr:day>6</fr:day>
                </fr:date>
                <fr:title text="A brief introduction to lenses">A brief introduction to lenses</fr:title>
              </fr:frontmatter>
              <fr:mainmatter>
                <html:p>
  If <fr:tex display="inline"><![CDATA[\mathcal {C}]]></fr:tex> is a category with finite products, the category <fr:tex display="inline"><![CDATA[\mathsf {Lens}(\mathcal {C})]]></fr:tex> of <html:em>lenses</html:em> in <fr:tex display="inline"><![CDATA[\mathcal {C}]]></fr:tex> has objects pairs <fr:tex display="inline"><![CDATA[\binom {A}{X}]]></fr:tex> of objects in <fr:tex display="inline"><![CDATA[\mathcal {C}]]></fr:tex>, and morphisms <fr:tex display="inline"><![CDATA[\binom {A}{X} \leftrightarrows  \binom {B}{Y}]]></fr:tex> given by pairs <fr:tex display="inline"><![CDATA[f: X \to  Y, f^\#: B \times  X \to  A]]></fr:tex>. (Note that it is of course the morphisms, not the objects, that are called lenses). One way to generalize this is to ask for <fr:tex display="inline"><![CDATA[\mathcal {C}]]></fr:tex> to have pullbacks, and consider an object given by a more general map <fr:tex display="inline"><![CDATA[A \to  X]]></fr:tex>, and let a map be <fr:tex display="inline"><![CDATA[f: X \to  Y, f^\#: B \times _Y X \to  A]]></fr:tex> (so that the triangle over <fr:tex display="inline"><![CDATA[X]]></fr:tex> commutes). (Note that this recovers the "simple lenses" when the objects are of the form <fr:tex display="inline"><![CDATA[A \times  X \to  X]]></fr:tex>). Under the interpretation of a map <fr:tex display="inline"><![CDATA[A \to  X]]></fr:tex> as a family of objects <fr:tex display="inline"><![CDATA[A_x]]></fr:tex> indexed over the elements of <fr:tex display="inline"><![CDATA[X]]></fr:tex>, we see this as a "dependent lens" (since <fr:tex display="inline"><![CDATA[A]]></fr:tex> is a "dependent type"). There are various variations of this idea, which ultimately all fit the pattern of taking a Grothendieck fibration <fr:tex display="inline"><![CDATA[\mathcal {D} \to  \mathcal {C}]]></fr:tex> and forming the fiberwise opposite---for the dependent lenses as above, this is the codomain fibration <fr:tex display="inline"><![CDATA[\mathcal {C}^\to  \to  \mathcal {C}]]></fr:tex>. 
</html:p>
                <html:p>
  Meanwhile, another wide-ranging generalization of <fr:tex display="inline"><![CDATA[\mathsf {Lens}(\mathcal {C})]]></fr:tex> are the <html:em>optics</html:em> of Riley (<fr:link href="/riley-optics/" title="Categories of optics" uri="https://erischel.com/riley-optics/" display-uri="riley-optics" type="local">Reference <fr:contextual-number uri="https://erischel.com/riley-optics/" display-uri="riley-optics" /></fr:link>). For <fr:tex display="inline"><![CDATA[\mathcal {C}]]></fr:tex> a monoidal category, the objects of <fr:tex display="inline"><![CDATA[\mathsf {Optic}(\mathcal {C})]]></fr:tex> are again pairs <fr:tex display="inline"><![CDATA[\binom {A}{X}]]></fr:tex> of objects, but now the morphisms are elements of the coend <fr:tex display="block"><![CDATA[\int ^{M \in  \mathcal {C}}\mathcal {C}(X, M \otimes  Y) \times  \mathcal {C}(M \otimes  B, A).]]></fr:tex> That is, to give an optic <fr:tex display="inline"><![CDATA[\binom {A}{X} \leftrightarrows  \binom {B}{Y}]]></fr:tex> is to give an object <fr:tex display="inline"><![CDATA[M \in  \mathcal {C}]]></fr:tex> and morphisms <fr:tex display="inline"><![CDATA[l: X \to  M \otimes  Y, r: M \otimes  B \to  A]]></fr:tex>, up to the equivalence relation generated by, whenever <fr:tex display="inline"><![CDATA[s: N \to  M, l: X \to  N \otimes  Y, r: M \otimes  B \to  A,]]></fr:tex> identifying the two optics given by <fr:tex display="inline"><![CDATA[(M, (s \otimes  1_Y) \circ  l, r)]]></fr:tex> and <fr:tex display="inline"><![CDATA[(N, l, r \circ  (s \otimes  1_B))]]></fr:tex>. One can show that, in the case where <fr:tex display="inline"><![CDATA[\mathcal {C}]]></fr:tex> is a Cartesian monoidal category, this set can be identified with the set of (simple) lenses.
</html:p>
                <html:p>
  A vector field on a smooth manifold <fr:tex display="inline"><![CDATA[X]]></fr:tex> is simply a (smooth) section of the tangent bundle <fr:tex display="inline"><![CDATA[TX]]></fr:tex>.
  A section is a bundle map from the trivial bundle <fr:tex display="inline"><![CDATA[X \to  X]]></fr:tex>. This gives the idea of considering a <html:em>parametrized</html:em> dynamical system as consisting of a map <fr:tex display="inline"><![CDATA[X \to  A]]></fr:tex> to some other smooth manifold, a bundle <fr:tex display="inline"><![CDATA[E \to  A]]></fr:tex> (the points of <fr:tex display="inline"><![CDATA[E]]></fr:tex> are the parameters) and a bundle map <fr:tex display="inline"><![CDATA[E \times _A X \to  TX]]></fr:tex>.
  As we will see, such a bundle map is exactly a dependent lens in a category of bundles. Building on this idea, Myers (<fr:link href="/myers-cst/" title="Categorical Systems Theory" uri="https://erischel.com/myers-cst/" display-uri="myers-cst" type="local">Reference <fr:contextual-number uri="https://erischel.com/myers-cst/" display-uri="myers-cst" /></fr:link>) described a highly abstract theory of open dynamical systems, given by lenses out of tangent bundles (where the notion of space, bundle and tangent bundle are generalized to any fibration).
</html:p>
                <html:p>
   It has been observed that, although a lens from the tangent bundle <fr:tex display="inline"><![CDATA[TS \leftrightarrows  A]]></fr:tex> may indeed be said to describe an open dynamical system with state space <fr:tex display="inline"><![CDATA[S]]></fr:tex>, the same can be said for a lens of type <fr:tex display="inline"><![CDATA[TS \otimes  A \leftrightarrows  I]]></fr:tex>---although a dynamical system of a different kind (essentially, the first type are the <html:em>Moore machines</html:em>, the second the <html:em>Mealy machines</html:em>---see the introduction to <fr:link href="/efr-000D/" title="The \mathsf {Para} construction in generic 2-categories" uri="https://erischel.com/efr-000D/" display-uri="efr-000D" type="local">§ <fr:contextual-number uri="https://erischel.com/efr-000D/" display-uri="efr-000D" /></fr:link> for more on this). It is natural to consider parametrized maps <fr:tex display="inline"><![CDATA[TS \otimes  A \leftrightarrows  B]]></fr:tex> as a common generalization of these two concepts---and in fact, special cases of this idea, lenses parametrized by tangent bundles, have already been considered many times, for example in the semantics of gradient descent (see <fr:link href="/bruno-etal-categorical-learning-2021/" title="Categorical Foundations of Gradient-Based Learning" uri="https://erischel.com/bruno-etal-categorical-learning-2021/" display-uri="bruno-etal-categorical-learning-2021" type="local">Reference <fr:contextual-number uri="https://erischel.com/bruno-etal-categorical-learning-2021/" display-uri="bruno-etal-categorical-learning-2021" /></fr:link>, <fr:link href="/towards-cybercat/" title="Towards Foundations of Categorical Cybernetics" uri="https://erischel.com/towards-cybercat/" display-uri="towards-cybercat" type="local">Reference <fr:contextual-number uri="https://erischel.com/towards-cybercat/" display-uri="towards-cybercat" /></fr:link>, <fr:link href="/backprop-as-functor/" title="Backprop as Functor: A compositional perspective on supervised learning" uri="https://erischel.com/backprop-as-functor/" display-uri="backprop-as-functor" type="local">Reference <fr:contextual-number uri="https://erischel.com/backprop-as-functor/" display-uri="backprop-as-functor" /></fr:link>).</html:p>
                <html:p>
  Since parametrized maps compose in an obvious way, we now have three different notions of morphisms between bundles---lenses, charts, and "generalized systems". These should form some sort of symmetric monoidal triple category, but the right axiomatisation of this concept is somewhat elusive.
</html:p>
                <html:p>
  Lenses, in their various incarnations, have been widely used in applied category theory. For example, Hedges and his collaborators have developed a compositional approach to game theory (<fr:link href="/hedges-string-games/" title="String diagrams for game theory" uri="https://erischel.com/hedges-string-games/" display-uri="hedges-string-games" type="local">Reference <fr:contextual-number uri="https://erischel.com/hedges-string-games/" display-uri="hedges-string-games" /></fr:link>, <fr:link href="/hedges-etal-comp-gametheory/" title="Compositional game theory" uri="https://erischel.com/hedges-etal-comp-gametheory/" display-uri="hedges-etal-comp-gametheory" type="local">Reference <fr:contextual-number uri="https://erischel.com/hedges-etal-comp-gametheory/" display-uri="hedges-etal-comp-gametheory" /></fr:link>, <fr:link href="/hedges-etal-institutions/" title="Composing games into complex institutions" uri="https://erischel.com/hedges-etal-institutions/" display-uri="hedges-etal-institutions" type="local">Reference <fr:contextual-number uri="https://erischel.com/hedges-etal-institutions/" display-uri="hedges-etal-institutions" /></fr:link>, <fr:link href="/hedges-etal-graph-games/" title="Compositional modelling of network games" uri="https://erischel.com/hedges-etal-graph-games/" display-uri="hedges-etal-graph-games" type="local">Reference <fr:contextual-number uri="https://erischel.com/hedges-etal-graph-games/" display-uri="hedges-etal-graph-games" /></fr:link>, others). Recent work by Hedges and Sakamoto bring this idea to reinforcement learning (<fr:link href="/sakamoto-reinforcement-lenses/" title="Reinforcement Learning in Categorical Cybernetics" uri="https://erischel.com/sakamoto-reinforcement-lenses/" display-uri="sakamoto-reinforcement-lenses" type="local">Reference <fr:contextual-number uri="https://erischel.com/sakamoto-reinforcement-lenses/" display-uri="sakamoto-reinforcement-lenses" /></fr:link>). We briefly mentioned Myers' categorical systems theory above, and we will see much more of it later. As we discussed above, there is also a literature using lenses to study gradient descent in an abstract sense. This is without even mentioning their original role in the theory of functional programming (this is the origin of the somewhat confusing term <html:em>lens</html:em>), or their prehistory in Gödel's dialectica interpretation---see eg <fr:link href="/jules-lenses-blogpost/" title="Lenses for philosophers" uri="https://erischel.com/jules-lenses-blogpost/" display-uri="jules-lenses-blogpost" type="local">Reference <fr:contextual-number uri="https://erischel.com/jules-lenses-blogpost/" display-uri="jules-lenses-blogpost" /></fr:link> for a survey of this.
</html:p>
              </fr:mainmatter>
            </fr:tree>
            <fr:tree show-metadata="false">
              <fr:frontmatter>
                <fr:authors>
                  <fr:author>
                    <fr:link href="/eigil-rischel/" title="Eigil Fjeldgren Rischel" uri="https://erischel.com/eigil-rischel/" display-uri="eigil-rischel" type="local">Eigil Fjeldgren Rischel</fr:link>
                  </fr:author>
                </fr:authors>
                <fr:date>
                  <fr:year>2025</fr:year>
                  <fr:month>4</fr:month>
                  <fr:day>6</fr:day>
                </fr:date>
                <fr:title text="
    Dependent Optics
  ">
    Dependent Optics
  </fr:title>
              </fr:frontmatter>
              <fr:mainmatter>
                <html:p>
    An open game, in the sense of Hedges, has as its interface two objects in the category of lenses (of sets) <fr:tex display="inline"><![CDATA[\binom {S}{X}, \binom {R}{Y}]]></fr:tex> (that is, two pairs of sets). An open game with this interface consists of a set <fr:tex display="inline"><![CDATA[\Sigma ]]></fr:tex> of <html:em>strategies</html:em> equipped with a function <fr:tex display="inline"><![CDATA[\Sigma  \to  \mathsf {Lens}(\mathsf {Set})(\binom {S}{X},\binom {R}{Y}),]]></fr:tex> and a subset <fr:tex display="inline"><![CDATA[Eq(x, k) \subset  \Sigma ]]></fr:tex> of <html:em>equilibrium strategies</html:em> for each <fr:tex display="inline"><![CDATA[x \in  X]]></fr:tex> and <fr:tex display="inline"><![CDATA[k: Y \to  R]]></fr:tex>---note that such an <fr:tex display="inline"><![CDATA[x]]></fr:tex> is exactly a lens <fr:tex display="inline"><![CDATA[\binom {*}{*} \leftrightarrows  \binom {S}{X},]]></fr:tex> and such a <fr:tex display="inline"><![CDATA[k]]></fr:tex> is exactly a lens <fr:tex display="inline"><![CDATA[\binom {R}{Y} \to  \binom {*}{*}]]></fr:tex>. This view of open games makes the composition rule much simpler to define, although we will not delve into the details here, see eg <fr:link href="/hedges-etal-comp-gametheory/" title="Compositional game theory" uri="https://erischel.com/hedges-etal-comp-gametheory/" display-uri="hedges-etal-comp-gametheory" type="local">Reference <fr:contextual-number uri="https://erischel.com/hedges-etal-comp-gametheory/" display-uri="hedges-etal-comp-gametheory" /></fr:link>. The idea is that the open game represents the strategies and preferences of a player or set of players---<fr:tex display="inline"><![CDATA[\sigma  \in  \Sigma ]]></fr:tex> are the possible strategies, <fr:tex display="inline"><![CDATA[x \in  X]]></fr:tex> is the information revealed to the player before they make their decision of which moves to make, the resulting <fr:tex display="inline"><![CDATA[y \in  Y]]></fr:tex> is the choice the player "sends" in response to <fr:tex display="inline"><![CDATA[x]]></fr:tex>, and the <fr:tex display="inline"><![CDATA[r \in  R]]></fr:tex> is the "utility", the value they eventually learn, depending on their choice <fr:tex display="inline"><![CDATA[y]]></fr:tex>, which they have some preferences over.
  </html:p>
                <html:p>
    The above description gives a theory of deterministic games, but of course, it is completely essential for game theory to model both random decisions (mixed strategies) and decisions made under uncertainty. This motivates the replacement of lenses in this definition with optics in a category of probability kernels (the form of the equilibrium relation must be modified as well, see <fr:link href="/hedges-etal-bayesian-games/" title="Bayesian open games" uri="https://erischel.com/hedges-etal-bayesian-games/" display-uri="hedges-etal-bayesian-games" type="local">Reference <fr:contextual-number uri="https://erischel.com/hedges-etal-bayesian-games/" display-uri="hedges-etal-bayesian-games" /></fr:link>, <fr:link href="/towards-cybercat/" title="Towards Foundations of Categorical Cybernetics" uri="https://erischel.com/towards-cybercat/" display-uri="towards-cybercat" type="local">Reference <fr:contextual-number uri="https://erischel.com/towards-cybercat/" display-uri="towards-cybercat" /></fr:link>)
  </html:p>
                <html:p>
    In the abstract study of open games, it is desirable to define a "choice" operation <fr:tex display="inline"><![CDATA[\oplus ]]></fr:tex> on the objects (the pairs of sets) so that maps into <fr:tex display="inline"><![CDATA[\binom {R}{X} \oplus  \binom {R'}{X'}]]></fr:tex> represent players who are faced with some binary choice between <fr:tex display="inline"><![CDATA[X]]></fr:tex> and <fr:tex display="inline"><![CDATA[X']]></fr:tex>, after which play may proceed for a time in one of two branches. However, this is immediately problematic because the category of lenses do not have coproducts---inside the category of <html:em>dependent</html:em> lenses, however, we can form the coproduct simply as <fr:tex display="inline"><![CDATA[R \times  X + R' \times  X' \to  X + X']]></fr:tex>---that is, we get a family which is <fr:tex display="inline"><![CDATA[R]]></fr:tex> over <fr:tex display="inline"><![CDATA[X]]></fr:tex>, and <fr:tex display="inline"><![CDATA[R']]></fr:tex> over <fr:tex display="inline"><![CDATA[X']]></fr:tex>. This indeed does the job, but for game theory the extension to stochastic maps---optics---is absolutely essential. This motivates the search for a theory of <html:em>dependent optics</html:em>, a common generalization of optics and dependent lenses.
  </html:p>
                <html:p>
    There have been a number of attempts at this---see eg <fr:link href="/fibre-optics-2021/" title="Fibre optics" uri="https://erischel.com/fibre-optics-2021/" display-uri="fibre-optics-2021" type="local">Reference <fr:contextual-number uri="https://erischel.com/fibre-optics-2021/" display-uri="fibre-optics-2021" /></fr:link>, <fr:link href="/hedges-braithwaite-dep/" title="Dependent Bayesian Lenses: Categories of Bidirectional Markov Kernels with Canonical Bayesian Inversion" uri="https://erischel.com/hedges-braithwaite-dep/" display-uri="hedges-braithwaite-dep" type="local">Reference <fr:contextual-number uri="https://erischel.com/hedges-braithwaite-dep/" display-uri="hedges-braithwaite-dep" /></fr:link>, <fr:link href="/milewski-polylens/" title="PolyLens" uri="https://erischel.com/milewski-polylens/" display-uri="milewski-polylens" type="local">Reference <fr:contextual-number uri="https://erischel.com/milewski-polylens/" display-uri="milewski-polylens" /></fr:link>, <fr:link href="/vertechi-dep-optics/" title="Dependent Optics" uri="https://erischel.com/vertechi-dep-optics/" display-uri="vertechi-dep-optics" type="local">Reference <fr:contextual-number uri="https://erischel.com/vertechi-dep-optics/" display-uri="vertechi-dep-optics" /></fr:link>. While these efforts have to some extent succeeded in describing a theory that is general enough to contain the desired examples, it is generally very ad hoc. The construction of optics as a special case of Vertechi's dependent optics (<fr:link href="/vertechi-dep-optics/" title="Dependent Optics" uri="https://erischel.com/vertechi-dep-optics/" display-uri="vertechi-dep-optics" type="local">Reference <fr:contextual-number uri="https://erischel.com/vertechi-dep-optics/" display-uri="vertechi-dep-optics" /></fr:link>) gives them as fibre optics with the indexing bicategory being (the delooping of) a monoidal category <fr:tex display="inline"><![CDATA[\mathcal {M}]]></fr:tex>, but embeds lenses using a bicategory of spans. Thus simple lenses admit two distinct encodings in this theory. Moreover, Vertechi's example of dependent monoidal optics fails to describe a supercategory of <fr:tex display="inline"><![CDATA[\mathsf {Optic}(\mathcal {C})]]></fr:tex> when applied to Markov categories, and are thus not suitable for, for example, game theory.
  </html:p>
              </fr:mainmatter>
            </fr:tree>
            <fr:tree show-metadata="false">
              <fr:frontmatter>
                <fr:authors>
                  <fr:author>
                    <fr:link href="/eigil-rischel/" title="Eigil Fjeldgren Rischel" uri="https://erischel.com/eigil-rischel/" display-uri="eigil-rischel" type="local">Eigil Fjeldgren Rischel</fr:link>
                  </fr:author>
                </fr:authors>
                <fr:date>
                  <fr:year>2025</fr:year>
                  <fr:month>4</fr:month>
                  <fr:day>6</fr:day>
                </fr:date>
                <fr:title text="Categorical Cybernetics">Categorical Cybernetics</fr:title>
              </fr:frontmatter>
              <fr:mainmatter>
                <html:p>
    The observation that both open games and machine learning systems can be fruitfully described using lenses, naturally led to the idea that this could be used to develop a more thorough analogy between the two. After all, a machine learning system is also a player in a kind of game (with the objective of minimizing loss). Hedges coined the phrase <html:em>categorical cybernetics</html:em> to describe this locus of ideas (<fr:link href="/towards-cybercat/" title="Towards Foundations of Categorical Cybernetics" uri="https://erischel.com/towards-cybercat/" display-uri="towards-cybercat" type="local">Reference <fr:contextual-number uri="https://erischel.com/towards-cybercat/" display-uri="towards-cybercat" /></fr:link>, also used in <fr:link href="/sakamoto-reinforcement-lenses/" title="Reinforcement Learning in Categorical Cybernetics" uri="https://erischel.com/sakamoto-reinforcement-lenses/" display-uri="sakamoto-reinforcement-lenses" type="local">Reference <fr:contextual-number uri="https://erischel.com/sakamoto-reinforcement-lenses/" display-uri="sakamoto-reinforcement-lenses" /></fr:link>).
  </html:p>
                <html:p>
    Myers' categorical systems theory also describes dynamical systems as lenses. However, where a cybernetic system in the sense of <fr:link href="/towards-cybercat/" title="Towards Foundations of Categorical Cybernetics" uri="https://erischel.com/towards-cybercat/" display-uri="towards-cybercat" type="local">Reference <fr:contextual-number uri="https://erischel.com/towards-cybercat/" display-uri="towards-cybercat" /></fr:link> is a parametrized lens <fr:tex display="inline"><![CDATA[\Sigma  \otimes  {\bar {X} \choose  X} \leftrightarrows  {\bar {Y} \choose  Y},]]></fr:tex> and thus has two different inputs - <fr:tex display="inline"><![CDATA[x \in  X,]]></fr:tex> which is the information on which basis they are allowed to choose their decision <fr:tex display="inline"><![CDATA[y \in  Y,]]></fr:tex> and <fr:tex display="inline"><![CDATA[y^\sharp  \in  \bar {Y},]]></fr:tex> which is their "utility", the information they are allowed to care about.
  </html:p>
                <html:p>
    It is straightforward to describe the machine learning part of the categorical cybernetics analogy in terms of Myers' theory---a "learner" is simply a lens of the above form with <fr:tex display="inline"><![CDATA[\Sigma ]]></fr:tex> replace with a tangent bundle <fr:tex display="inline"><![CDATA[TS]]></fr:tex>. This idea (described in these terms, although not with the analogy to machine learning) has already been described by <fr:link href="/energy-driven-systems/" title="Organizing Physics with Open Energy-Driven Systems" uri="https://erischel.com/energy-driven-systems/" display-uri="energy-driven-systems" type="local">Reference <fr:contextual-number uri="https://erischel.com/energy-driven-systems/" display-uri="energy-driven-systems" /></fr:link>.
    However, for game theory, it is necessary that the output of a given system can be stochastically chosen (a player must be able to randomize their strategy). At the same time, for a machine learning system, the <fr:tex display="inline"><![CDATA[x \in  X]]></fr:tex> is usually some sort of sample from a training distribution---ie, it is random. Hence to really describe the training dynamics of machine learning systems using this theory, we are again naturally drawn to consider systems theories (that is, fibrations) which have stochastic maps in the base, not merely the fiber.
  </html:p>
              </fr:mainmatter>
            </fr:tree>
            <fr:tree show-metadata="false">
              <fr:frontmatter>
                <fr:authors>
                  <fr:author>
                    <fr:link href="/eigil-rischel/" title="Eigil Fjeldgren Rischel" uri="https://erischel.com/eigil-rischel/" display-uri="eigil-rischel" type="local">Eigil Fjeldgren Rischel</fr:link>
                  </fr:author>
                </fr:authors>
                <fr:date>
                  <fr:year>2025</fr:year>
                  <fr:month>4</fr:month>
                  <fr:day>6</fr:day>
                </fr:date>
                <fr:title text="Overview and contributions">Overview and contributions</fr:title>
              </fr:frontmatter>
              <fr:mainmatter>
                <html:p>
    We begin the thesis in <fr:link href="/efr-POD2/" title="Preliminaries" uri="https://erischel.com/efr-POD2/" display-uri="efr-POD2" type="local">§ <fr:contextual-number uri="https://erischel.com/efr-POD2/" display-uri="efr-POD2" /></fr:link> with a review of some preliminary material. This chapter can largely be skipped for readers already familiar with the material (Markov categories, double categories, lenses and optics, fibrations, and categorical dynamical systems theory). The chapter on Markov categories introduces a few novel auxiliary notions, but these can be referred back to as necessary (they are primarily regularity conditions which hold in most Markov categories of interest). 
  </html:p>
                <html:p>
    In <fr:link href="/efr-O088/" title="Markov Fibrations and Stochastic Lenses" uri="https://erischel.com/efr-O088/" display-uri="efr-O088" type="local">§ <fr:contextual-number uri="https://erischel.com/efr-O088/" display-uri="efr-O088" /></fr:link>, we give the main technical contribution of the thesis by developing a theory of <html:em>Markov fibrations</html:em>. Their fiberwise opposites generalize both the fiberwise opposites of codomain fibrations (dependent lenses in a classical sense) and optics in Markov categories. <fr:link href="/efr-K6NM/" title="https://erischel.com/efr-K6NM/" uri="https://erischel.com/efr-K6NM/" display-uri="efr-K6NM" type="local">Theorem <fr:contextual-number uri="https://erischel.com/efr-K6NM/" display-uri="efr-K6NM" /></fr:link> provides the statement of the latter (the former is straightforward). We also give a description of monoidal structures on Markov fibrations (which pass to monoidal structures on the resulting categories of optics).
  </html:p>
                <html:p>
    In <fr:link href="/efr-000D/" title="The \mathsf {Para} construction in generic 2-categories" uri="https://erischel.com/efr-000D/" display-uri="efr-000D" type="local">§ <fr:contextual-number uri="https://erischel.com/efr-000D/" display-uri="efr-000D" /></fr:link>, we give a construction of the double category of <html:em>parametrized morphisms</html:em> for a category action (or actegory)---in fact, we do this  internally to any <fr:tex display="inline"><![CDATA[2]]></fr:tex>-category. This has the advantage of allowing us to construct more highly-structured versions of this double category by carrying out the construction internally to higher-structured actions. (Bicategorical versions of <fr:tex display="inline"><![CDATA[\mathsf {Para}]]></fr:tex> are a relatively old idea, and the double categorical version is a straightforward extension which has existed for some time as folklore, but the fully-internal construction here is novel).
  </html:p>
                <html:p>
    In <fr:link href="/efr-GFG0/" title="Open Games with external choice in Markov Fibrations" uri="https://erischel.com/efr-GFG0/" display-uri="efr-GFG0" type="local">§ <fr:contextual-number uri="https://erischel.com/efr-GFG0/" display-uri="efr-GFG0" /></fr:link>, we apply Markov fibrations to compositional game theory, and solve a longstanding problem by giving a category of stochastic open games with a general "external choice" operator. This construction is largely abstract over the particular category, and so can be applied to different Markov fibrations to describe games defined with different notions of stochasticity. We also review some previous work with Capucci, Hedges, and Gavranovic on abstract constructions of categories of open games (<fr:link href="/towards-cybercat/" title="Towards Foundations of Categorical Cybernetics" uri="https://erischel.com/towards-cybercat/" display-uri="towards-cybercat" type="local">Reference <fr:contextual-number uri="https://erischel.com/towards-cybercat/" display-uri="towards-cybercat" /></fr:link>). 
  </html:p>
                <html:p>
    In <fr:link href="/efr-ZRUZ/" title="Categories of stochastic dynamical systems" uri="https://erischel.com/efr-ZRUZ/" display-uri="efr-ZRUZ" type="local">§ <fr:contextual-number uri="https://erischel.com/efr-ZRUZ/" display-uri="efr-ZRUZ" /></fr:link>, we describe how to extend Myers' categorical systems theory to Markov fibrations, to give theories of systems which may have stochastic maps not merely in the fiber (as was already described by Myers in <fr:link href="/myers-cst/" title="Categorical Systems Theory" uri="https://erischel.com/myers-cst/" display-uri="myers-cst" type="local">Reference <fr:contextual-number uri="https://erischel.com/myers-cst/" display-uri="myers-cst" /></fr:link>) but also in the base. We also leverage our construction from <fr:link href="/efr-000D/" title="The \mathsf {Para} construction in generic 2-categories" uri="https://erischel.com/efr-000D/" display-uri="efr-000D" type="local">§ <fr:contextual-number uri="https://erischel.com/efr-000D/" display-uri="efr-000D" /></fr:link> to give a description of a <html:em>symmetric monoidal triple category</html:em> whose three types of morphisms, are lenses, charts, and what we call <html:em>bisystems,</html:em> that is morphisms <fr:tex display="inline"><![CDATA[TS \otimes  A \leftrightarrows  B]]></fr:tex> - these are open dynamical systems which have two directions of interaction with the environment.
    We also describe a particular systems theory of smooth manifolds and smooth stochastic maps between them.
  </html:p>
              </fr:mainmatter>
            </fr:tree>
            <fr:tree show-metadata="false">
              <fr:frontmatter>
                <fr:authors>
                  <fr:author>
                    <fr:link href="/eigil-rischel/" title="Eigil Fjeldgren Rischel" uri="https://erischel.com/eigil-rischel/" display-uri="eigil-rischel" type="local">Eigil Fjeldgren Rischel</fr:link>
                  </fr:author>
                </fr:authors>
                <fr:date>
                  <fr:year>2024</fr:year>
                  <fr:month>6</fr:month>
                  <fr:day>5</fr:day>
                </fr:date>
                <fr:uri>https://erischel.com/efr-0008/</fr:uri>
                <fr:display-uri>efr-0008</fr:display-uri>
                <fr:route>/efr-0008/</fr:route>
                <fr:title text="Acknowledgements">Acknowledgements</fr:title>
              </fr:frontmatter>
              <fr:mainmatter>
                <html:p>
  I would like to extend a great thanks to the Mathematically Structured Programming group at the University of Strathclyde, my fellow PhD students in particular, for making my time there such a great one. A good chunk of this work was completed while I worked at the Compositional Systems Laboratory at the Tallinn University of Technology---I owe everyone there a great thanks as well.
</html:p>
                <html:p>
  For conversations which contributed to this work, and to my mathematical development in general, I would like to thank Dylan Braithwaite, Matteo Capucci, Elena di Lavore, Tobias Fritz, Davidad, Tomáš Gonda, Bruno Gavranović, Diana Kessler, Owen Lynch, Jade Master, David Jaz Myers, Riu Nakamura, Chad Nester, Evan Patterson, Paolo Perrone, Mario Roman, Brandon Shapiro, Toby Smithe, Pawel Sobocinski, David Spivak, and Andre Videla. A special thanks to Dylan, Matteo, and Bruno, for serving their time with me in the dependent optics mines.
</html:p>
                <html:p>
  To Neil Ghani, Radu Mardare, and Jules Hedges, a massive thanks for serving as my advisors during the somewhat tumultuous process that was the production of this thesis.
</html:p>
                <html:p>
  Finally, I thank my wonderful family. Now you can stop asking me about it.
</html:p>
              </fr:mainmatter>
            </fr:tree>
          </fr:mainmatter>
        </fr:tree>
      </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>
