-
Pattern runs on matter: The free monad monad as a module over the cofree comonad comonad
Authors:
Sophie Libkind,
David I. Spivak
Abstract:
Interviews run on people, programs run on operating systems, voting schemes run on voters, games run on players. Each of these is an example of the abstraction pattern runs on matter. Pattern determines the decision tree that governs how a situation can unfold, while matter responds with decisions at each juncture.
In this article, we will give a straightforward and concrete construction of the…
▽ More
Interviews run on people, programs run on operating systems, voting schemes run on voters, games run on players. Each of these is an example of the abstraction pattern runs on matter. Pattern determines the decision tree that governs how a situation can unfold, while matter responds with decisions at each juncture.
In this article, we will give a straightforward and concrete construction of the free monad monad for $(\mathbf{Poly}, \mathbin{\triangleleft}, \mathcal{y})$, the category of polynomial functors with the substitution monoidal product. Although the free monad has been well-studied in other contexts, the construction we give is streamlined and explicitly illustrates how the free monad represents terminating decision trees. We will also explore the naturally arising interaction between the free monad and cofree comonad. Again, while the interaction itself is known, the perspective we take is the free monad as a module over the cofree comonad. Lastly, we will give four applications of the module action to interviews, computer programs, voting, and games. In each example, we will see how the free monad represents pattern, the cofree comonad represents matter, and the module action represents runs on.
△ Less
Submitted 24 April, 2024;
originally announced April 2024.
-
Additive Invariants of Open Petri Nets
Authors:
Benjamin Merlin Bumpus,
Sophie Libkind,
Jordy Lopez Garcia,
Layla Sorkatti,
Samuel Tenka
Abstract:
We classify all additive invariants of open Petri nets: these are $\mathbb{N}$-valued invariants which are additive with respect to sequential and parallel composition of open Petri nets. In particular, we prove two classification theorems: one for open Petri nets and one for monically open Petri nets (i.e. open Petri nets whose interfaces are specified by monic maps). Our results can be summarize…
▽ More
We classify all additive invariants of open Petri nets: these are $\mathbb{N}$-valued invariants which are additive with respect to sequential and parallel composition of open Petri nets. In particular, we prove two classification theorems: one for open Petri nets and one for monically open Petri nets (i.e. open Petri nets whose interfaces are specified by monic maps). Our results can be summarized as follows. The additive invariants of open Petri nets are completely determined by their values on a particular class of single-transition Petri nets. However, for monically open Petri nets, the additive invariants are determined by their values on transitionless Petri nets and all single-transition Petri nets. Our results confirm a conjecture of John Baez (stated during the AMS' 2022 Mathematical Research Communities workshop).
△ Less
Submitted 22 February, 2024; v1 submitted 2 March, 2023;
originally announced March 2023.
-
A Categorical Framework for Modeling with Stock and Flow Diagrams
Authors:
John C. Baez,
Xiaoyan Li,
Sophie Libkind,
Nathaniel D. Osgood,
Eric Redekopp
Abstract:
Stock and flow diagrams are already an important tool in epidemiology, but category theory lets us go further and treat these diagrams as mathematical entities in their own right. In this chapter we use communicable disease models created with our software, StockFlow.jl, to explain the benefits of the categorical approach. We first explain the category of stock-flow diagrams and note the clear sep…
▽ More
Stock and flow diagrams are already an important tool in epidemiology, but category theory lets us go further and treat these diagrams as mathematical entities in their own right. In this chapter we use communicable disease models created with our software, StockFlow.jl, to explain the benefits of the categorical approach. We first explain the category of stock-flow diagrams and note the clear separation between the syntax of these diagrams and their semantics, demonstrating three examples of semantics already implemented in the software: ODEs, causal loop diagrams, and system structure diagrams. We then turn to two methods for building large stock-flow diagrams from smaller ones in a modular fashion: composition and stratification. Finally, we introduce the open-source ModelCollab software for diagram-based collaborative modeling. The graphical user interface of this web-based software lets modelers take advantage of the ideas discussed here without any knowledge of their categorical foundations.
△ Less
Submitted 13 January, 2023; v1 submitted 1 November, 2022;
originally announced November 2022.
-
Compositional Modeling with Stock and Flow Diagrams
Authors:
John Baez,
Xiaoyan Li,
Sophie Libkind,
Nathaniel D. Osgood,
Evan Patterson
Abstract:
Stock and flow diagrams are widely used in epidemiology to model the dynamics of populations. Although tools already exist for building these diagrams and simulating the systems they describe, we have created a new package called StockFlow, part of the AlgebraicJulia ecosystem, which uses ideas from category theory to overcome notable limitations of existing software. Compositionality is provided…
▽ More
Stock and flow diagrams are widely used in epidemiology to model the dynamics of populations. Although tools already exist for building these diagrams and simulating the systems they describe, we have created a new package called StockFlow, part of the AlgebraicJulia ecosystem, which uses ideas from category theory to overcome notable limitations of existing software. Compositionality is provided by the theory of decorated cospans: stock and flow diagrams can be composed to form larger ones in an intuitive way formalized by the operad of undirected wiring diagrams. Our approach also cleanly separates the syntax of stock and flow diagrams from the semantics they can be assigned. We consider semantics in ordinary differential equations, although others are possible. As an example, we explain code in StockFlow that implements a simplified version of a COVID-19 model used in Canada.
△ Less
Submitted 31 July, 2023; v1 submitted 9 May, 2022;
originally announced May 2022.
-
An Algebraic Framework for Structured Epidemic Modeling
Authors:
Sophie Libkind,
Andrew Baas,
Micah Halter,
Evan Patterson,
James Fairbanks
Abstract:
Pandemic management requires that scientists rapidly formulate and analyze epidemiological models in order to forecast the spread of disease and the effects of mitigation strategies. Scientists must modify existing models and create novel ones in light of new biological data and policy changes such as social distancing and vaccination. Traditional scientific modeling workflows detach the structure…
▽ More
Pandemic management requires that scientists rapidly formulate and analyze epidemiological models in order to forecast the spread of disease and the effects of mitigation strategies. Scientists must modify existing models and create novel ones in light of new biological data and policy changes such as social distancing and vaccination. Traditional scientific modeling workflows detach the structure of a model -- its submodels and their interactions -- from its implementation in software. Consequently, incorporating local changes to model components may require global edits to the code-base through a manual, time-intensive, and error-prone process. We propose a compositional modeling framework that uses high-level algebraic structures to capture domain-specific scientific knowledge and bridge the gap between how scientists think about models and the code that implements them. These algebraic structures, grounded in applied category theory, simplify and expedite modeling tasks such as model specification, stratification, analysis, and calibration. With their structure made explicit, models also become easier to communicate, criticize, and refine in light of stakeholder feedback.
△ Less
Submitted 7 May, 2022; v1 submitted 28 February, 2022;
originally announced March 2022.
-
Operadic Modeling of Dynamical Systems: Mathematics and Computation
Authors:
Sophie Libkind,
Andrew Baas,
Evan Patterson,
James Fairbanks
Abstract:
Dynamical systems are ubiquitous in science and engineering as models of phenomena that evolve over time. Although complex dynamical systems tend to have important modular structure, conventional modeling approaches suppress this structure. Building on recent work in applied category theory, we show how deterministic dynamical systems, discrete and continuous, can be composed in a hierarchical sty…
▽ More
Dynamical systems are ubiquitous in science and engineering as models of phenomena that evolve over time. Although complex dynamical systems tend to have important modular structure, conventional modeling approaches suppress this structure. Building on recent work in applied category theory, we show how deterministic dynamical systems, discrete and continuous, can be composed in a hierarchical style. In mathematical terms, we reformulate some existing operads of wiring diagrams and introduce new ones, using the general formalism of C-sets (copresheaves). We then establish dynamical systems as algebras of these operads. In a computational vein, we show that Euler's method is functorial for undirected systems, extending a previous result for directed systems. All of the ideas in this paper are implemented as practical software using Catlab and the AlgebraicJulia ecosystem, written in the Julia programming language for scientific computing.
△ Less
Submitted 3 November, 2022; v1 submitted 25 May, 2021;
originally announced May 2021.
-
An Algebra of Resource Sharing Machines
Authors:
Sophie Libkind
Abstract:
Dynamical systems are a broad class of mathematical tools used to describe the evolution of physical and computational processes. Traditionally these processes model changing entities in a static world. Picture a ball rolling on an empty table. In contrast, open dynamical systems model changing entities in a changing world. Picture a ball in an ongoing game of billiards. In the literature, there i…
▽ More
Dynamical systems are a broad class of mathematical tools used to describe the evolution of physical and computational processes. Traditionally these processes model changing entities in a static world. Picture a ball rolling on an empty table. In contrast, open dynamical systems model changing entities in a changing world. Picture a ball in an ongoing game of billiards. In the literature, there is ambiguity about the interpretation of the "open" in open dynamical systems. In other words, there is ambiguity in the mechanism by which open dynamical systems interact. To some, open dynamical systems are input-output machines which interact by feeding the input of one system with the output of another. To others, open dynamical systems are input-output agnostic and interact through a shared pool of resources. In this paper, we define an algebra of open dynamical systems which unifies these two perspectives. We consider in detail two concrete instances of dynamical systems -- continuous flows on manifolds and non-deterministic automata.
△ Less
Submitted 28 July, 2020;
originally announced July 2020.