Abstractions as morphisms between (co)algebras

post by Erik Jenner (ejenner) · 2023-01-14T01:51:45.622Z · LW · GW · 1 comments

Contents

  Motivation
  (Co)algebras
  Examples
  Some potential problems with this formalism
None
1 comment

In a previous post [LW · GW], I suggested we should think of abstractions/ontologies as maps that make a certain commutative diagram commute:

The downward arrows are the abstraction, which throws away some information about the world state while keeping other parts. The horizontal arrow at the top is time evolution. The diagram says that there should be a way to "mirror" the time evolution inside the high-level model (that's the dashed arrow at the bottom). Commutativity of this diagram means that we can either do time evolution in the actual world and then abstract, or first abstract and then do time evolution in the model. If this doesn't make sense, the original post [LW · GW] has more details and examples.

It turns out that this idea is very, very far from new.[1] I'll hopefully write a post on some related literature soon, but here I want to discuss one connection in particular: category theory, and more specifically (co)algebras of endofunctors. Using coalgebras for abstractions is an idea from bisimulations in computer science. See nlab if you just want a quick version. This post essentially just adds lots of examples and some reframing—the computer science discussions I've seen tend to be heavily focused on the special case of abstractions of transition systems.

Motivation

There are two main things the (co)algebra framework will give us:

  1. It could be a useful way to formalize the slightly vague description of abstractions-via-commutative-diagrams from my previous post. (In particular, it addresses one open question that I'll discuss in a moment.)
  2. The original post had a few examples for commutative diagrams of the type above, but most of them focused on deterministic time evolution. This (co)algebraic framework lets us easily generate tons of examples in a natural way, from group theory to general-purpose optimizers. This gives some support both to this specific framework but also to the more general idea of using these commutative diagrams to define "good abstractions".

I'll briefly elaborate on why the description in my earlier post was a bit vague. I had another example of the commutative diagram above with a somewhat different flavor:

The abstraction  maps from real numbers to a representation using 11 decimal digits (the details don't matter here). The horizontal arrow isn't time evolution of a physical system in this example, instead it's addition of real numbers. The commutative diagram essentially says we should also be able to add within our decimal approximation.

A key difference is that in the time evolution example, the horizontal arrow was an endomorphism, i.e. it mapped from the set of possible states to itself, with a type signature like . Addition does not have this type signature, it's a map . This means we can't use the same function for both downward arrows. Intuitively, it's pretty clear that it makes sense to use  on the left side, i.e. apply the abstraction to each input independently. But what's the general principle that tells us how the two downward arrows should be related? And what kinds of horizontal arrows can we use besides time evolution and addition? That's what this post gives one potential answer to.

(Co)algebras

I'll assume you know what categories and functors are, and just focus on slightly less well-known concepts. If you don't know category theory, the next section with examples could still be interesting to get a sense of what kinds of things can be described in this abstractions framework.

First, an endofunctor is simply a functor  from a category  to itself. All of my examples are going to be for  since that already gives us plenty. Some examples of endofunctors we'll use:

An algebra of an endofunctor  is a morphism  for some specific object  (i.e. a set in our examples). A coalgebra is the same thing in the other direction, . Some examples:

As you can see, both the time evolution example and the binary operation example have a horizontal arrow that can be understood as a (co)algebra. In general, I think any algebra or coalgebra of any endofunctor can be used as a horizontal arrow. The choice of functor and (co)algebra is going to describe which "task" we care about: prediction of next time steps, addition of numbers, etc.

Given a horizontal arrow, i.e. a (co)algebra, we can think of abstractions as morphisms from this (co)algebra to another one. A morphism from an algebra  to  is defined as a map  such that this diagram commutes:

In our context, the morphism  is the abstraction, with  the low-level/detailed system and  the high-level model.  is the representation of the task/operation  within the high-level model (the dashed arrow in the diagrams above).

This is a generalization of the addition diagram above: there,  and . Note how this answers the question of what the relation between downward arrows should be: we choose the abstraction  and then get the other arrow by applying the functor , which is part of the specification of the horizontal arrow.

Coalgebras work analogously, except we choose the downward arrow on the left side and then translate it to the right using the functor:

This shows how (co)algebras are one possible formalization of these commutative diagrams. I don't see any strong a priori justification of why they are the correct formalism. The main reason this approach seems interesting to me is that lots of examples work out: abstractions I had thought about before seeing this formalism fit in nicely, and if I plug in endofunctors I hadn't thought about before, I often get good examples of abstractions out. This is what we'll look at next.

Examples

I'll now quickly go through some examples of different endofunctors and how to interpret them in the context of abstractions. These are going to be pretty informal but hopefully still clear (otherwise let me know and I'll be happy to give a more detailed version in the comments).

Some potential problems with this formalism

I don't view any of these as decisive issues. Possible objections that I think could be a bigger deal:

  1. ^

    Thanks to Generallyer for pointing out [LW(p) · GW(p)] related work in causality; there are many other examples as well.

1 comments

Comments sorted by top scores.

comment by Shmi (shminux) · 2023-01-14T09:11:02.150Z · LW(p) · GW(p)

Here is a couple of my somewhat related comments from awhile back: https://www.lesswrong.com/posts/NFMPftEhagCcHcmQJ/on-the-role-of-abstraction-in-mathematics-and-the-natural?commentId=GRp8PKJd64Tm5DhtA [LW(p) · GW(p)]

https://www.lesswrong.com/posts/wuJpYLcMEBz4kcgAn/what-is-abstraction-1?commentId=qxnTe3TAYs2ZqzAQL [LW(p) · GW(p)]

I wish I had the background to formalize them the way you have in your post.

In general, I get the importance of keeping in mind the relevant commutative diagram (often more than one) for whatever mapping you are working on, but it is not clear to me that you can get anything actionable out of them. Still, I do think that even if all your examples are in Set, CT is a good framework for thinking about them, without going down the abstraction levels.