SearcharxivSearch

arXiv subjects

David I. Spivak

Publications and source records attributed to David I. Spivak.

At least 19 recordsLinked to original sources

Compositional Dynamics in Learning and Mechanics

We give a single compositional setting in which gradient-based learning and Hamiltonian-style mechanics appear as functorial semantics. The syntax is an operad Arr whose objects are input-output interfaces (pairs of manifolds) and whose morphisms are *smooth adaptive arrangements*, which consist of a responsive parameter space, a lens given by smooth output and input maps, and a real-valued potential. The main technical result of the paper is what we call *lens internalization*, a lax symmetric monoidal functor Lens(C) $\to$ C associated to any symmetric monoidal closed category C. Using it, we provide two functors $Φ_\text{phase}$, $Φ_\text{conf}$: Arr $\to$ PC into the 2-category of polynomial coalgebras -- input-output discrete dynamical systems -- which we take as the semantics category. $Φ_\text{phase}$ stores both position and momentum, whereas $Φ_\text{conf}$ stores only position. When applied to a parameterized function, $Φ_\text{conf}$ recovers the gradient descent training algorithm, with backpropagation as the lens' backward pass. When applied to harmonic particles wired together -- in series, or according to any finite directed graph -- one diagram yields two different regimes, both of which are governed by the graph Laplacian: $Φ_\text{phase}$ gives the discrete wave equation, which is conservative and second-order, and $Φ_\text{conf}$ gives the discrete heat equation, which is dissipative and first-order. They are two semantics of one adaptive arrangement, e.g. with the same potential in each case. And because Arr is an operad, such diagrams nest -- larger systems wired from smaller ones -- and each semantics assembles a system's dynamics functorially from its parts. These dynamics are moreover executable: a parameterized neural network and a graph of particles both compile, by the same construction, to explicit state machines one can run.

math.CT

Comonads as spaces

Comonads on Set generalize both categories and topological spaces. Expanding upon Garner's work on ionads, we develop aspects of the theory of topological spaces for arbitrary comonads on arbitrary categories. Our approach is centered around density comonads, which provide an abstraction of subbases. We study subbases as well as bases in terms of density comonads, and we study continuous maps of comonads in terms of functors between coalgebra categories, with definitions that recover the usual notions for topological spaces. Whereas Ahman and Uustalu characterized categories as precisely the polynomial comonads on Set, we characterize topological spaces as precisely the density comonads of diagrams of subsets of a set, which are familiar as topological subbases. We show that every comonad on Set has an underlying topological space, and that this construction is a reflection with respect to continuous maps; similarly, every comonad on Set has an underlying small category, and this construction is a coreflection. We also show that the category of all comonads on Set with continuous maps is complete, and that its full subcategory of accessible comonads is cocomplete. Continuous maps and ordinary comonad morphisms form a double category, which, in the case of the polynomial comonads on Set, recovers the double category of functors and retrofunctors of Clarke and Di Meglio. We find topological intuition for these concepts in terms of "halos", an abstraction of infinitesimal neighborhoods of points, defined as formal limits of neighborhood systems. We include a long appendix of counterexamples, many applicable to general (co)monad theory rather than the particular concerns of this text.

math.CT

Polynomial Universes in Homotopy Type Theory

Awodey, later with Newstead, showed how polynomial functors with extra structure (termed ``natural models'') hold within them the categorical semantics for dependent type theory. Their work presented these ideas clearly but ultimately led them outside of the usual category of polynomial functors to a particular \emph{tricategory} of polynomials in order to explain all of the structure possessed by such models. This paper builds off that work -- explicating the categorical semantics of dependent type theory by axiomatizing them entirely in terms of the usual category of polynomial functors. In order to handle the higher-categorical coherences required for such an explanation, we work with polynomial functors in the language of Homotopy Type Theory (HoTT), which allows for higher-dimensional structures to be expressed purely within this category. The move to HoTT moreover enables us to express a key additional condition on polynomial functors -- \emph{univalence} -- which is sufficient to guarantee that models of type theory expressed as univalent polynomials satisfy all higher coherences of their corresponding algebraic structures, purely in virtue of being closed under the usual constructors of dependent type theory. We call polynomial functors satisfying this condition \emph{polynomial universes}. As an example of the simplification to the theory of natural models this enables, we highlight the fact that a polynomial universe being closed under dependent product types implies the existence of a distributive law of monads, which witnesses the usual distributivity of dependent products over dependent sums.

cs.LO

Interactions that reshape the interfaces of the interacting parties

Polynomial functors model systems with interfaces: each polynomial specifies the outputs a system can produce and, for each output, the inputs it accepts. The bicategory $\mathbb{O}\mathbf{rg}$ of dynamic organizations \cite{spivak2021learners} gives a notion of state-driven interaction patterns that evolves over time, but each system's interface remains fixed throughout the interaction. Yet in many systems, the outputs sent and inputs received can reshape the interface itself: a cell differentiating in response to chemical signals gains or loses receptors; a sensor damaged by its input loses a channel; a neural network may grow its output resolution during training. Here we introduce *polynomial trees*, elements of the terminal $(u\triangleleft u)$-coalgebra where $u$ is the polynomial associated to a universe of sets, to model such systems: a polynomial tree is a coinductive tree whose nodes carry polynomials, and in which each round of interaction -- an output chosen and an input received -- determines a child tree, hence the next interface. We construct a monoidal closed category $\mathbf{PolyTr}$ of polynomial trees, with coinductively-defined morphisms, tensor product, and internal hom. We then build a bicategory $\mathbb{O}\mathbf{rgTr}$ generalizing $\mathbb{O}\mathbf{rg}$, whose hom-categories parametrize morphisms by state sets with coinductive action-and-update data. We provide a locally fully faithful functor $\mathbb{O}\mathbf{rg}\to\mathbb{O}\mathbf{rgTr}$ via constant trees, those for which the interfaces do not change through time. We illustrate the generalization by suggesting a notion of progressive generative adversarial networks, where gradient feedback determines when the image-generation interface grows to a higher resolution.

math.CT

A reference for categorical structures on $\mathbf{Poly}$

In this document, we collect a list of categorical structures on the category $\mathbf{Poly}$ of polynomial functors. There is no implied claim that this list is in any way complete. It includes: infinitely many monoidal structures, all but one of which is symmetric, closed, and distributes over $+$, several of which interact duoidally; it also includes a right-coclosure and two indexed left coclosures; it also includes various adjunctions of which $\mathbf{Poly}$ is a part, including the free monad and cofree comonad and their interaction with various monoidal structures.

math.CT

Organizing Physics with Open Energy-Driven Systems

Organizing physics has been a long-standing preoccupation of applied category theory, going back at least to Lawvere. We contribute to this research thread by noticing that Hamiltonian mechanics and gradient descent depend crucially on a consistent choice of transformation -- which we call a reaction structure -- from the cotangent bundle to the tangent bundle. We then construct a compositional theory of reaction structures. Reaction-based systems offer a different perspective on composition in physics than port-Hamiltonian systems or open classical mechanics, in that reaction-based composition does not create any new constraints that must be solved for algebraically. The technical contributions of this paper are the development of symmetric monoidal categories of open energy-driven systems and open differential equations, and a functor between them, functioning as a "functorial semantics" for reaction structures. This approach echoes what has previously been done for open games and open gradient-based learners, and in fact subsumes the latter. We then illustrate our theory by constructing an n-fold pendulum as a composite of n-many pendula.

math.CT

Pattern Runs on Matter: The Free Monad Monad as a Module over the Cofree Comonad Comonad

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 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.

math.CT

The compact double category $\mathbf{Int}(\mathbf{Poly}_*)$ models control flow and data transformations

Hasegawa showed that control flow in programming languages -- while loops and if-then-else statements -- can be modeled using traced cocartesian categories, such as the category $\mathbf{Set}_*$ of pointed sets. In this paper we define an operad $\mathscr{W}$ of wiring diagrams that provides syntax for categories whose control flow moreover includes data transformations, including deleting, duplicating, permuting, and applying pre-specified functions to variables. In the most basic version, the operad underlies $\mathbf{Int}(\mathbf{Poly}_*)$, where $\mathbf{Int}(\mathscr{T})$ denotes the free compact category on a traced category $\mathscr{T}$, as defined by Joyal, Street, and Verity; to do so, we show that $\mathbf{Poly}_*$, as well as any multivariate version of it, is traced. We show moreover that whenever $\mathscr{T}$ is uniform -- a condition also defined by Hasegawa and satisfied by $\mathbf{Int}(\mathscr{T})$ -- the resulting $\mathbf{Int}$-construction extends to a double category $\mathbb{I}\mathbf{nt}(\mathscr{T})$, which is compact in the sense of Patterson. Finally, we define a universal property of the double category $\mathbb{I}\mathbf{nt}(\mathbf{Poly}_*)$ and $\mathbb{I}\mathbf{nt}(\mathbf{Set}_*)$ by which one can track trajectories as they move through the control flow associated to a wiring diagram.

math.CT

Learners' Languages

In "Backprop as functor", the authors show that the fundamental elements of deep learning -- gradient descent and backpropagation -- can be conceptualized as a strong monoidal functor Para(Euc)$\to$Learn from the category of parameterized Euclidean spaces to that of learners, a category developed explicitly to capture parameter update and backpropagation. It was soon realized that there is an isomorphism Learn$\cong$Para(Slens), where Slens is the symmetric monoidal category of simple lenses as used in functional programming. In this note, we observe that Slens is a full subcategory of Poly, the category of polynomial functors in one variable, via the functor $A\mapsto Ay^A$. Using the fact that (Poly,$\otimes$) is monoidal closed, we show that a map $A\to B$ in Para(Slens) has a natural interpretation in terms of dynamical systems (more precisely, generalized Moore machines) whose interface is the internal-hom type $[Ay^A,By^B]$. Finally, we review the fact that the category p-Coalg of dynamical systems on any $p \in$ Poly forms a topos, and consider the logical propositions that can be stated in its internal language. We give gradient descent as an example, and we conclude by discussing some directions for future work.

math.CT

Categories by Kan extension

Categories can be identified -- up to isomorphism -- with polynomial comonads on Set. The left Kan extension of a functor along itself is always a comonad -- called the density comonad -- so it defines a category when its carrier is polynomial. We provide a number of generalizations of this to produce new categories from old, as well as from distributive laws of monads over comonads. For example, all Lawvere theories, all product completions of small categories, and the simplicial indexing category $Δ^{op}$ arise in this way. Another, seemingly much less well-known, example constructs a so-called selection category from a polynomial comonad in a way that's somehow dual to the construction of a Lawvere theory category from a monad; we'll discuss this in more detail. Along the way, we will see various constructions of non-polynomial comonads as well.

math.CT

Duoidal Structures for Compositional Dependence

We provide a categorical framework for mathematical objects for which there is both a sort of "independent" and "dependent" composition. Namely we model them as duoidal categories in which both monoidal structures share a unit and the first is symmetric. We construct the free such category and observe that it is a full subcategory of the category of finite posets. Indeed each algebraic expression in the two monoidal operators corresponds to the poset built by taking disjoint unions and joins of the singleton poset. We characterize these "expressible" posets as precisely those which contain no "zig-zags." We then move on to describe categories equipped with $n$-ary operations for each $n$-element finite poset; we refer to them as "dependence categories" since they allow for combinations of objects based on any network of dependencies between them. These structures model various sorts of dependence including the space-like and time-like juxtaposition of weighted probability distributions in relativistic spacetime, which we model using polynomial endofunctors on the category of sets, as well as the runtimes for multiple computer programs run in parallel and series, which we model using the tropical semiring structure on nonnegative real numbers. With these examples in mind, we conclude by describing ways in which morphisms in a partial monoidal category can be "decorated" in a coherent manner by objects in a dependence category, such as labeling a network of parallel programs with their runtimes.

math.CT

Algebraic Databases

Databases have been studied category-theoretically for decades. The database schema -- whose purpose is to arrange high-level conceptual entities -- is generally modeled as a category or sketch. The data itself, often called an instance, is generally modeled as a set-valued functor, assigning to each conceptual entity a set of examples. While mathematically elegant, these categorical models have typically struggled with representing concrete data such as integers or strings. In the present work, we propose an extension of the set-valued functor model, making use of multisorted algebraic theories (a.k.a. Lawvere theories) to incorporate concrete data in a principled way. This also allows constraints and queries to make use of operations on data, such as multiplication or comparison of numbers, helping to bridge the gap between traditional databases and programming languages. We also show how all of the components of our model -- including schemas, instances, change-of-schema functors, and queries - fit into a single double categorical structure called a proarrow equipment (a.k.a. framed bicategory).

math.CT

Functorial aggregation

We study polynomial comonads and polynomial bicomodules. Polynomial comonads amount to categories. Polynomial bicomodules between categories amount to parametric right adjoint functors between corresponding copresheaf categories. These may themselves be understood as generalized polynomial functors. They are also called data migration functors because of applications in categorical database theory. We investigate several universal constructions in the framed bicategory of categories, retrofunctors, and parametric right adjoints. We then use the theory we develop to model database aggregation alongside querying, all within this rich ecosystem.

math.CT

Dynamic task delegation for hierarchical agents

This is the fourth installment in a series of papers offering models of hierarchical structure for dynamical systems, using the language of polynomial functors. The operad underlying the symmetric monoidal category $(\mathbf{Poly}, \otimes, \mathcal{y})$ can be viewed as defining the behavior of hierarchical delegation. In particular, a morphism $\mathbf{Poly}(p_1 \otimes \cdots \otimes p_m, q)$ turns the outputs of subordinates with interfaces $p_i$ into the output of an agent with interface $q$ and turns a task given to the agent into a task for each of the subordinates. In this article, we extend the framework so that subordinates may be invoked asynchronously depending on the outcomes of other subordinates. We prove that the free (co)monad (co)monad extends to a (co)monad on $\mathbf{Org}$. From the perspective of programs/pattern, this extension implies the existence of a $\mathbf{Cat}$-enriched operad $\mathbf{Org}_\mathfrak{m}$, and from the perspective of behavior/matter, it implies the existence of a $\mathbf{Cat}$-enriched operad $\mathbf{Org}^\mathfrak{c}$. Second, we crispen the relationship between the programmatic and behavioral perspectives via a functor $[-, t] \colon \mathbf{Org}_{\mathfrak{m}}^\textrm{op} \to \mathbf{Org}^\mathfrak{c}$ for any polynomial monad $t$.

math.CT

Polynomial Functors: A Mathematical Theory of Interaction

This monograph is a study of the category of polynomial endofunctors on the category of sets and its applications to modeling interaction protocols and dynamical systems. We assume basic categorical background and build the categorical theory from the ground up, highlighting pictorical techniques and concrete examples to build intuition and provide applications.

math.CT

What kind of linearly distributive category do polynomial functors form?

This paper has two purposes. The first is to extend the theory of linearly distributive categories by considering the structures that emerge in a special case: the normal duoidal category $(\mathsf{Poly} ,\mathcal{y}, \otimes, \triangleleft )$ of polynomial functors under Dirichlet and substitution product. This is an isomix LDC which is neither $*$-autonomous nor fully symmetric. The additional structures of interest here are a closure for $\otimes$ and a co-closure for $\triangleleft$, making $\mathsf{Poly}$ a bi-closed LDC, which is a notion we introduce in this paper. The second purpose is to use $\mathsf{Poly}$ as a source of examples and intuition about various structures that can occur in the setting of LDCs, including duals, cores, linear monoids, and others, as well as how these generalize to the non-symmetric setting. To that end, we characterize the linearly dual objects in $\mathsf{Poly}$: every linear polynomial has a right dual which is a representable. It turns out that the linear and representable polynomials also form the left and right cores of $\mathsf{Poly}$. Finally, we provide examples of linear monoids, linear comonoids, and linear bialgebras in $\mathsf{Poly}$.

math.CT

All Concepts are $\mathbb{C}\mathbf{at}^\#$

We show that the double category $\mathbb{C}\mathbf{at}^\#$ of comonoids in the category of polynomial functors (previously shown by Ahman-Uustalu and Garner to be equivalent to the double category of categories, cofunctors, and prafunctors) contains several formal settings for basic category theory and has subcategories equivalent to both the double category $\mathbb{O}\mathbf{rg}$ of dynamic rewiring systems and the double category $\mathbb{P}\mathbf{oly}_{\mathcal{E}}$ of generalized polynomials in a finite limit category $\mathcal{E}$. Also serving as a natural setting for categorical database theory and generalized higher category theory, $\mathbb{C}\mathbf{at}^\#$ at once hosts models of a wide range of concepts from the theory and applications of polynomial functors and category theory.

math.CT

A Polynomial Construction of Nerves for Higher Categories

We show that the construction due to Leinster and Weber of a generalized Lawvere theory for a familially representable monad on a (co)presheaf category, and the associated ``nerve'' functor from monad algebras to (co)presheaves, have an elegant categorical description in the double category $\mathbb{C}\mathbf{at}^{\#}$ of categories, cofunctors, familial functors, and transformations. In $\mathbb{C}\mathbf{at}^{\#}$, which also arises from comonoids in the category of polynomial functors, both a familial monad and a (co)presheaf it acts on can be modeled as horizontal morphisms; from this perspective, the theory category associated to the monad is built using left Kan extension in the category of endomorphisms, and the nerve functor is modeled by a single composition of horizontal morphisms in $\mathbb{C}\mathbf{at}^{\#}$. For the free category monad $path$ on graphs, this provides a new construction of the simplex category as $Δ:= \lens{path}{path \circ path}$. We also explore the free Eilenberg-Moore completion of $\mathbb{C}\mathbf{at}^{\#}$, in which constructions such as the free symmetric monoidal category monad on $\mathbf{Cat}$ can modeled using the rich language of polynomial functors.

math.CT