In this post I’ll describe something that’s kind of common knowledge among applied category theorists, that when you describe behaviour via a (pseudo)functor to the category of relations, emergent effects are described by the failure of that functor to be strong, ie. to be an actual functor. This is more or less in Seven Sketches (Fong and Spivak say “generative effects”, which as far as I can tell is an exact synonym for emergent effects), but I’ll write it in one place and in my own words.

Suppose we have a domain-specific category . It’s hopefully monoidal and most likely a hypergraph category, but the basic idea of what I’m saying applies just to the category structure. The morphisms of are open systems of some sort, the objects describe the open boundaries that a system can have, and composition describes coupling two systems together along a common boundary. The standard sledgehammer for building categories like this is decorated cospans, with structured cospans as a closely related new alternative.

Now suppose we define an operation , which we think of as describing `behaviour’, understood broadly. Every object is sent to a set of behaviours that the boundaries can exhibit. Every morphism is set to a subset , where we think of as saying that, if we have the system , it is possible to simultaneously observe the behaviour on its left boundary and on its right boundary.

Now think about what happens when we couple a pair of systems , along their common boundary, yielding the complex system . We now have three sets of behaviours: the behaviours of the first component, the behaviours of the second component, and the behaviours of the complex.

Under reasonable conditions, it is the case that every pair of behaviours of and that are *consistent*, in the sense that they agree on the behaviour of the common boundary, yield a behaviour of the complex system. (This can certainly fail – I can think of one example involving Nash equilibria of games under a naive composition like adding payoffs – but if it fails you should probably give up and try something different.) The behaviours on the outer boundaries that arise from behaviours of the components that are consistent on the middle boundary is exactly described by the composition in the category :

So the reasonable condition we imposed on behaviours is that

which is the condition that is a *lax (pseudo)functor* (thinking of as a fairly boring 2-category).

If we always have , then is a functor. This condition says that *every* possible behaviour of arises in this way from behaviours of and that are consistent along . This is a very strong requirement in practice, and generally fails. (An example of it failing is reachability in Petri nets; I have an in-progress example involving smooth optimisation.)

Failure of a lax functor to be a functor is caused by *emergent effects*, that is to say, behaviours of a complex system that do not come from possible behaviours of the components. Under this very general setup, we can give a precise definition of an emergent behaviour of a complex system : it is as an element of the set

This much is what I expect most applied category theorists to know, so I’m writing for everyone else. Now I’m going to end with a difficult challenge for ACT.

It’s a good achievement to have such a clean definition of emergent effects, but I am worried that we can’t follow it up. Instead of saying “huh, my class of systems exhibits emergent effects” and moving on, can we say more? What I would like is to be able to associate, to a given lax (probably monoidal, hypergraph) pseudofunctor into (or variants such as ), some kind of object that encodes some useful knowledge about its failure to be a functor. Ideally, something that makes it easier to calculate (or otherwise do something with) if we know and . Algebraic topology has a bunch of machinery that seems like it might be able to do this sort of thing (especially if we start imposing some reasonable extra conditions on our category of open systems or on ), but I don’t understand it well enough.