游乐游手机版
首页/AI热点日报/热点详情

LessWrong 经典教程:从零快速理解抽象废话的直观入门

类型:热点整理2026-06-30
TL;DR John Wentworth has written a great introduction to category theory for someone who wants to do something useful with categories This post has a

TL;DR John Wentworth has written a great introduction to category theory for someone who wants to do something useful with categories. This post has a different goal: Assuming one is curious about the useless manifestations of category theory, what is a quick intuition to get started? This post's proposal: the game Recover the Labels.

The arcade machine

The “game” is played on an arcade machine with three screens.


Left screen

Through the left screen we can see sets, each of which takes one specific location over a 2D[1] background. The game lets us scroll and see other locations with other sets. Sets are unordered lists of things, each and every set is out there somewhere to be found if we scroll enough. We ha ve e.g. the set “Countries in North America”, which we can also write as {Canada, USA, Mexico}, and we ha ve a set of two websites {LessWrong, AstrologyToday}, and we also ha ve more typical sets, like the set of all natural numbers, the set of all real numbers, etc. There are also peculiar sets like the set of all natural numbers except the number 12, or the set which has as members “Canada”, “AstrologyToday” and all real numbers greater than 13.

The left screen shows not only sets, but also functions between sets. A function between two sets A and B is a rule that assigns to each element of A exactly one element of B. We can e.g. imagine that on different days of this year, LessWrong or AstrologyToday was the most popular website in Canada, USA and Mexico. If we make a list which shows the most popular website for each of those three countries in one specific day, we’ve defined a function.

We can also define functions in the other direction: We imagine days in which both LessWrong and AstrologyToday had on their main page a story about Canada or USA or Mexico (but only one of those countries!). If we make a list which shows the featured country for each of those two websites in one specific day, we ha ve defined one function.

Exercise for the reader: Show that there are only 8 functions of the first kind, and only 9 of the second kind.

Just like every single set can be found somewhere if we scroll enough, every single possible function between any two sets is shown on the left screen. Functions are represented as a bundle of kind-of-parallel lines, each starting at one element of the first set (no repetitions), and each finishing at one element of the second set (repetitions allowed). All the lines belonging to one bundle ha ve the same color, and no other bundle repeats that color.

Central screen

Through the central screen we see something that has been produced from the left screen: each set has been collapsed into one dimensionless point, while keeping its position relative to other sets. A label has been added to the point identifying which set it comes from. So for instance there are dots with the labels “natural numbers”, “real numbers”, and “LessWrong posts written in July 2026”. For the most part, though, most labels simply list the elements of the original set,[2] like {LessWrong, AstrologyToday} or {Donald Trump, 7, bananas}.

Each function (i.e. each bundle of kind-of-parallel lines between elements of two sets) has also been collapsed into one single arrow. Since there are no elements now, the different functions between two sets ha ve been collapsed into arrows which identically start at one point and finish at a different point. To tell them apart, the color of the underlying bundle in the left screen has been preserved in the middle screen, and thus act as a label to identify the arrows. So we now ha ve a display of points with labels, and colorful arrows going from one point to another. As happened on the left screen, each color is only used for one arrow.

Right screen

Through the right screen we see the category of sets. It has been produced from the central screen: we see the exact same configuration of points and arrows, but they now ha ve no labels or colors.

So, in each of the three screens we see different things: sets with elements and bundles in the left screen, labelled points and colorful arrows in the central screen, and unlabelled points and arrows in the right screen. And yet, the three networks are, in a sense, the same: each object in one screen corresponds to exactly one object in each of the other two screens, and the same happens to each connection between objects.

Scrolling, dragging, syncing

Whenever we scroll any of the three screens, the others scroll as well in the same direction and to the same extent, so they always stay in sync (i.e. the left screen always shows the points that ha ve been produced from the sets we see on the left screen, and no other points).

In each of the screens, we can also select one items (set or point) and drag it around. When we do so, the functions or arrows connecting it to other sets/points are also dragged along. Doing this deforms the “constellation” of objects and connections, but it should feel intuitive that it doesn’t alter the network, i.e. each object remains connected to exactly the same objects as before being dragged, no matter how far away we pull them.

Whenever we deform one of the three constellations like this, the constellations on the other two screens also deformed in parallel by dragging the corresponding object in the same distance and to the same extent. Consequently, the three constellations can change as much as we want, but they always stay in sync.

The game: Recover the Labels

The “game” is played with the following constraints:

  1. The mechanism keeping the screens in sync is broken.
  2. Someone has been been scrambling the screens for eons, scrolling each screen in different ways and deforming each of the constellations in different ways.
  3. The middle screen is broken.

The task of the game is to bring the left and right constellations back to sync, to the extent that this is possible.[3]

The puzzle has a partial solution which needs no more information, so the reader is invited to try to find it before continuing reading, particularly because category theory has the peculiarity of seeming trivial in hindsight.

Solution

Finding a special point

To establish the connection we need to find one or more “special points” that are somehow visible among the infinite goo of unlabeled points on the right area. The points are unlabeled and thus indistinguishable… except for the arrows between them. So we need to find a point that is special with regards to its arrows. But the arrows themselves are identical,[4] so only two things can be different: the number of arrows and their direction (incoming or outgoing). So we need to look for numbers that help us in identifying points. Which numbers could be special? 0, 1 and infinite[5] look like the obvious candidates to inspect first.[6]

After failing with the other proposed numbers and directions, one will find that the only way to make it work is looking at points with one incoming arrow. Here’s how:

The singleton as terminal point

A singleton is a set with one element. For every set X,[7] there is only one function to a singleton, namely the one that assigns the only element of the singleton to each element of X.

A terminal point in a category is a point that receives one and only one arrow from every other point.[8]

From these definitions it follows that every singleton on the left screen is depicted as a terminal point on the right screen, and every terminal point on the right screen comes from a singleton on the left screen.

So we’ve found a gateway between the left and right screen: we know that singletons and terminal points are “the same”. Furthermore, we did this without looking at the central screen (constraint #3), and without using and pre-established sync between them (constraints #1 and #2). This should give you a taster of the ambiguous feeling that category theory is all about: it feels simultaneously mind-blowing and trivial that information about an object (in this case, the fact that one sets contains only one element) should be “contained” in its relationships to other objects.

The price: the difference between singletons is lost

We found out that singletons and terminal points are equivalent. Can we identify which singleton specifically corresponds to one terminal point? The answer is No: a terminal point is literally just a point with an incoming arrow from each other object, and thus there is nothing telling two terminal points apart.

The language of category theory doesn’t ha ve the means to distinguish two terminal points, and so for all intents are purposes all terminal points are the same and there is only one terminal point.

Syncing the rest of the left screen

How do we sync the rest of the constellations? (Again, we don’t need any further information, so the reader is invited to solve this before continuing reading. Even if they failed at the previous point, getting the second step right should be much easier)

We should use the point whose identity we already know to identify the rest. How? By realizing that the singleton has a peculiar property. If we think about the functions from the singleton to the set {1,2}, it’s obvious that there are only two: either the sole element of the singleton is sent to 1, or it is sent to 2. Similarly, there are three functions from the singleton to the set {1,2,3}. More generally: The number of functions from the singleton to a sets tells us how many elements the set has.

This can be applied to the identification of dots and sets: every set with n elements depicts a point with n incoming arrows from the terminal point. Every set with a countably infinite number of elements corresponds to a point with a countably infinite number of incoming arrows from the terminal point. Etc.

In typical trivial/mind-blowing way, even though the right constellation shows no sets and no elements, we can recover the information of how many elements each set contains. Going on step further, we can decide to rename the “incoming arrows from terminal set” as elements, after we realize that everything we might want to use elements for can be done with these arrows as well.

As in the first step, the price to pay is that the difference between two sets with the same number of elements is lost. The difference between the sets {1, 2} and {3,4} lies not in how many functions can be defined from the singleton (it’s two in both cases), nor in the functions that can be defined to any other set (it’s the number of elements of that set squared, for any set); it lies in the labels of the elements. Category theory has no language to speak about labels and so, on the right screen, these two sets are represented as identical points receiving two element-arrows from the terminal set and ha ving the same number of outgoing arrows to any other point.

Collapsing parallel sections

It might not hurt to insist on what is happening. The right screen keeps all the information from the screen left, except labels. So when things on the left screen are identical except for the labels, we get identical thing on the right screen.

Let’s push this idea a bit: How similar can two things with different labels be? Imagine one section of the left screen with some of the sets that we ha ve mentioned: the natural numbers, the real numbers, {Canada, USA, Mexico}, {LessWrong, AstrologyToday}, {Donald Trump, 7, bananas, lamp}.

Now we can also imagine a different section of the left screen with contains very similar sets, but where the label of each element contains “yellow”: {yellow Canada, yellow USA, yellow Mexico}, {yellow LessWrong, yellow AstrologyToday}, {yellow Donald Trump, yellow 7, yellow bananas, yellow lamp}, {yellow 1, yellow 2, yellow 3…} and the yellow reals.

It should feel intuitive that the yellow clone, which is a different subsection of the network on the left screen, is nonetheless a structural clone: every set has an yellow analogue, every element has a yellow analogue, and every function has a yellow analogue. We can’t learn anything new about the yellow section if we ha ve exhausted everything that can be learned about the original one. And on the right screen, these two subsections aren’t just structural clones: they are indistinguishable.

How far can we push this idea of ha ving identical things with different labels? Answer: We can create two parallel “universes”, each containing all “relevantly different” sets, which however ha ve different labels. As discussed before, the only thing that makes sets “relevantly different” is the number of elements they contain. If a section of the left screen has one set with each possible number of elements, the rest of the left screen is just copies of that section.

When things are only different in their labels they are called isomorphic. So to be more precise: If a section of the left screen has one set with each possible number of elements, the rest of the left screen is just isomorphic copies of that section. On the right screen, on the other hand, those other copies are identical: The right screen (and category theory in general) collapses isomorphism into identity.[9]

If there is interest in more posts like this, a sequence on intuitive Abstract Nonsense leading to the Yoneda lemma may follow.

  1. ^

    Or, if you find it more intuitive, the sets can take locations in a 3D space. In any case, taking the setup of the game seriously soon runs up against problems, so we are not taking it too seriously.

  2. ^

    Since that is the only way to identify a set consisting of arbitrarily chosen elements.

  3. ^

    The reader has infinite time and no problem scrolling infinite screens. And they should again a void taking the setup too seriously or problems will come up.

  4. ^

    Since the right screen shows us a category, the arrows are actually not identical because they contain information about their composition. This is however not needed for the game presented here.

  5. ^

    As usual in Abstract Nonsense, infinite is not really an option because there are different kinds of infinite.

  6. ^

    Another way of framing the puzzle: You are transported to the inside of the right screen (i.e. to the category of sets). What would be a Schelling point to meet another collaborative player? (Abstracting away from all problems derived from infinite time, space, speed, etc.)

  7. ^

    Including the singleton itself.

  8. ^

    Including itself.

  9. ^

    More technically: into isomorphism up to unique isomorphism.

  10. ^

    I.e. in our setup, without looking at the middle screen, or using the syncing mechanism.

  11. ^

    Equivalently, finding which points correspond to the sets shown on the left. Equivalently, to keep scrolling both screens until they are synced.

  12. ^

    So, again, not something we humans could perceive in any relevant way. But Abstract Nonsense is not tailored for humans.

  13. ^

    As is typical in Abstract Nonsense, the left area is of course infinite (very infinite) and is not something that we could build inside our physical universe.

来源:https://www.bestblogs.dev/article/151b73a7?utm_source=rss&utm_medium=feed&utm_campaign=resources&entry=rss_article_item

相关热点

继续查看同栏目近期热点。

延伸阅读

补充最近整理过的热点入口。