# Fun with Category Theory and Dynamical Systems

## Sets without elements?

• Can I say “The set A has only one element” without saying anything about elements?

Surprisingly, yes! Instead of talking about the one element, I can say this: “Given any other set B, there is exactly one function f : BA.”
• Can you say “The set A has the same elements as the set B” without saying anything about elements?

Since we have no way to actually name or describe those elements (since we’re forbidden from even talking about them), we can not say this. But we can get close, by saying that A has the same number of elements as B. Here’s how to do it: “There is a function f : AB, and another function g : BA, and gf is the identity function on A, and fg is the identity function on B.”
• Can you define the cartesian product without talking about elements?

Well, just like the previous example, we can’t be sure what exactly the elements in our set are called, but we can say that a set has the right number of elements to be the cartesian product. And what’s more, we can even provide a pair of functions that give the components of the ordered pair, giving a way to interpret everything in that set as an ordered pair.
• The functions f and g mean that every element of S has some associated pair of elements from A and B. Any particular S may not be associated to all of the possible pairs, but importantly, we can choose an S and f and g that associate any pair, if we like.
• That h exists means, therefore, that for any choice of elements from A and B, there’s an element in A × B that corresponds to it. The projections p and q tell us which A and which B each element corresponds to.
• That h is unique means that there is only one such element for each pair, since otherwise there would be a choice of which element h points at.

## Dynamical systems appear!

• fg = g means that f doesn’t change anything in the result of g. In other words, for any x in the result of g, we must have f(x) = x. There’s a word for values that are unchanged by a function: fixed points (or sometimes fixpoints, or stationary points). So g can only point to the fixed points of f.
• By the same logic, any choice of k can only point to the fixed points of f. But it’s possible to choose a k that points to any fixed point of A.
• That h exists, then, means that g must map some element of U to every fixed point of f. (If it didn’t, then k might map something to that fixed point, and it couldn’t be obtained by composing with g.)
• That h is unique means that g maps only one thing to each fixed point of f. (Otherwise, there would be a choice of where h should map some things, so h wouldn’t be unique.)

## Reversing course: colimits

• The existence of h means that no two elements of A or B map to the same element of A + B. If they did, then we could find an f and g that map them somewhere different, and then we couldn’t write that f and g as compositions with h.
• The uniqueness of h means that there’s nothing else in A + B except these elements that are mapped from A and B. If there were, then there would be a choice of where h maps those extra elements.

## Colimits and dynamical systems

• First, k = k f. What this tells us is that for any x in A, k(f(x)) = k(x). But that’s true for anything at all in A, including f(x), and f(f(x)) and so on, so we can write a chain of equalities: k(x) = k(f(x)) = k(f(f(x))) = k(f(f(f(x)))) = …, forever and ever. This brings us to another idea in dynamical systems: the orbit. An orbit (or sometimes trajectory) is a set of values that eventually map to the same things when iterating the transition function. So this says that k maps everything in the same orbit of f to the same result. (So do all valid choices of g, which has the same condition.)
• The existence of h tells us that k maps distinct orbits of f to different places. (Otherwise, if g mapped them to different places, then g couldn’t be written as a composition with k.)
• The uniqueness of h tells us that there’s nothing else in U other than one element for each orbit of f. (Otherwise, h would have a choice where to map these extra elements, so it wouldn’t be unique.)

## What’s next?

• I would strongly encourage you to explore limits and colimits on your own by considering other simple diagrams you can draw, and checking whether there’s some natural characterization of the limit and colimit.
• I’ve also stuck to sets and functions in this article, but the “game” where we didn’t talk about elements or membership did have a point. When you play that game with sets, you get an alternative kind of set theory for mathematics called the “Elementary Theory of the Category of Sets”, or ETCS for short. In the traditional ZF set theory, you assume there’s some notion of membership, and then work to build up ordered pairs, then relations, then functions. But in ETCS, you assume there’s a notion of functions, and work backward to recover ordered pairs and such. You can even recover an idea analogous to set membership: an element of a set is analogous to a function from some other one-element set, which we defined without reference to elements, into that set.
• But because there was no direct reference to elements, the same definitions work in any other category; that is, a collection of things and arrows between them that compose in a manner like function composition. You can, for example, consider any algebraic structure (groups, rings, etc.) and the homomorphisms between them, or topological spaces and continuous functions between them, or even fundamentally non-function-like things such as partial orders (or any other reflexive transitive relation).
• Although the same definitions work for any category, but they can mean very different things, and they may or may not even exist. One example: if you work out what sums and products of two things (that just means the colimit and limit of a diagram with two objects and no arrows) look like for the category of abelian groups, you’ll discover that they are the same thing! Both correspond to a notion that’s usually called a direct sum or direct product, which are the same thing for any finite number of groups. That’s very different from sets, where one was the cartesian product and the other the disjoint union.

--

--

--

## More from Chris Smith

Software engineer, volunteer K-12 math and computer science teacher, author of the CodeWorld platform, amateur ring theorist, and Haskell enthusiast.

Love podcasts or audiobooks? Learn on the go with our new app.

## Chris Smith

Software engineer, volunteer K-12 math and computer science teacher, author of the CodeWorld platform, amateur ring theorist, and Haskell enthusiast.