Search arXivSearch

arXiv · 2606.28984

Compositional Dynamics in Learning and Mechanics

Abstract

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.

Explore related subjects

Keep this discovery

Explore connections, maps & timelines

BibTeXRIS

David I. Spivak. 2026-08-22. Compositional Dynamics in Learning and Mechanics. https://arxiv.org/abs/2606.28984

Cite the original work for its findings. Save a collection to share your selection of sources.

KEEP EXPLORING

Related papers

A Categorical Generalization of Counterpoint

We extend Mazzola's counterpoint model using category theory, generalizing from the category $\mathbf{Set}$ to an arbitrary topos other than $\mathbf{Set}$. This generalization suggests that counterpoint's essential structure depends on specific categorical conditions rather than classical set-theoretic reasoning. A key contribution is identifying sufficient requirements for a well-behaved counterpoint theory in a topos: some version of Zorn's Lemma (GJZL), and two-valuedness and split supports (NS). Within a topos, we introduce (weak) quasidichotomies alongside the classical notion of dichotomy. These structures capture varying degrees of oppositional structure between consonance and dissonance, with weak quasidichotomies preserving the non-Boolean flexibility essential to musical practice while quasidichotomies represent maximal opposition short of complete partition. We prove a generalized counterpoint theorem giving sufficient conditions for the existence of admitted successors. When the ambient topos turns non-zero successor objects into points, admitted succession can be iterated to form counterpoint paths, which may terminate at consonances with no admitted successor. The framework naturally accommodates counterpoint with sets instead of pure pitches, relaxing the ``yes/no'' character of classical consonance definitions and emphasizing context-dependence. Mazzola's model allows a Kuratowski closure operator induced by a polarity, which defines an internal topology enabling algebraic-topological analysis of counterpoint structure. We conclude by showing this construction generalizes to involutive morphisms. This categorical approach provides foundations for understanding both the historical evolution of contrapuntal practice and cross-cultural divergences in interval organization.

math.CT

From 3-crossed modules to Gray-type 4-categories

In this paper, we investigate the relation between the category of 3-crossed modules and the category of Gray-type 4-groups. The notion of a 3-crossed module was first introduced by Arvasi \textit{et al.}, motivated by the question of what kind of algebraic structure completely encodes a homotopy 4-type. On the other hand, from the point of view that higher groups are equivalent to algebraic realizations of higher categories -- as exemplified by the relationship between 2-crossed modules and Gray 3-groups established by Sarikaya--Ulualan -- it had not been clear how the 3-crossed modules of Arvasi \textit{et al.} relate to any higher category. In our previous paper, we proposed a new definition of a 3-crossed module and observed that it admits a natural interpretation in terms of higher categories. In this paper, we make this interpretation precise: we introduce a 4-category, which reduces to a semistrict braided monoidal 2-category when restricted to a single object and a single 1-morphism, and prove that the category of our 3-crossed modules is equivalent to the category of Gray 4-groups, defined as single-object versions of this 4-category in which all morphisms are invertible. We therefore expect that these structures can correctly capture the topological nature of surface knots and higher-dimensional manifolds.

math.CT

Observations on the variety of equationally linear Heyting semilattices

In previous work, we analysed a number of categorical properties, of interest in the context of Janelidze-Márki-Tholen semi-abelian categories, for the variety $\mathsf{HSLat}$ of Heyting semilattices. In this paper, we focus on the subvariety $\mathsf{ELHSLat}$ of equationally linear Heyting semilattices. Our main objective is to show that, unlike $\mathsf{HSLat}$, this category is algebraically coherent. We furthermore prove that it is neither locally algebraically cartesian closed nor cosmash associative.

math.CT