Category Theory
Zulip Server
Archive

You're reading the public-facing archive of the Category Theory Zulip server.
To join the server you need an invite. Anybody can get an invite by contacting Matteo Capucci at name dot surname at gmail dot com.
For all things related to this archive refer to the same person.


Stream: learning: questions

Topic: How to make up categories outside of math?


view this post on Zulip Alex Kreitzberg (Sep 18 2024 at 00:21):

Years ago Bartosz Milewski told me "Categories are about composition." Even going so far as to claim category theory "is how our mind works." This seemed way too general, but it's hard for me to avoid "running too far" with intuitions.

After many years I came up with a few categories that I'll share, one for chess, one for an accordion, and one for drawing - that seem "small". However it's hard to do much with them outside of the context of their original subjects. I was hoping for feedback on whether the categories I'm making up can be manipulated with category theory in interesting ways.

Chess games as a category:

Chess games are notated in an "algebraic notation" ( https://en.wikipedia.org/wiki/Algebraic_notation_(chess) ). For example the Italian game, an opening in chess, is notated:

  1. e4 e5
  2. Nf3 Nc6
  3. Bc4

If board states are objects, and arrows are allowed moves (plus an arrow for "nobody has moved yet" to stand for the identity) then I believe the above moves are a morphism in a category whose objects are valid chess positions.

Here's a way I've tried to explore this. If I forget most of the rules of chess, who alternates turns, how pieces capture, etc. But keep how individual pieces are allowed to move, then all a single piece cares about are which squares it can move to.

So in following game of Kasporav vs Topalov, If I apply an "only White Queen moves" Functor,

The following below transforms...

  1. e4 d6 2. d4 Nf6 3. Nc3 g6 4. Be3 Bg7 5. Qd2 c6 6. f3 b5
  2. Nge2 Nbd7 8. Bh6 Bxh6 9. Qxh6 Bb7 10. a3 e5 11. O-O-O Qe7
  3. Kb1 a6 13. Nc1 O-O-O 14. Nb3 exd4 15. Rxd4 c5 16. Rd1 Nb6
  4. g3 Kb8 18. Na5 Ba8 19. Bh3 d5 20. Qf4+ Ka7 21. Rhe1 d4
  5. Nd5 Nbxd5 23. exd5 Qd6 24. Rxd4 cxd4 25. Re7+ Kb6
  6. Qxd4+ Kxa5 27. b4+ Ka4 28. Qc3 Qxd5 29. Ra7 Bb7 30. Rxb7
    Qc4 31. Qxf6 Kxa3 32. Qxa6+ Kxb4 33. c3+ Kxc3 34. Qa1+ Kd2
  7. Qb2+ Kd1 36. Bf1 Rd2 37. Rd7 Rxd7 38. Bxc4 bxc4 39. Qxh8
    Rd3 40. Qa8 c3 41. Qa4+ Ke1 42. f4 f5 43. Kc1 Rd2 44. Qa7 1-0

into...

Qd2 Qxh6 Qf4+ Qxd4+ Qc3 Qxf6 Qxa6+ Qa1+ Qb2+ Qxh8 Qa8 Qa4+ Qa7

A history of the queens moves. To me this reads like, Qd2 is really a morphism Queen:d1d2Queen : d1 \rightarrow d2, and the above is a chain of morphisms between chess squares:

d1d2h6f4d4c3f6a6a1b2h8a8a4a7d1 \rightarrow d2 \rightarrow h6 \rightarrow f4 \rightarrow d4 \rightarrow c3 \rightarrow f6 \rightarrow a6 \rightarrow a1 \rightarrow b2 \rightarrow h8 \rightarrow a8 \rightarrow a4 \rightarrow a7

With Q being the arrow.

I think this is just a preorder, a queen's basic movement can either move between two squares or it can't.

A category for drawing:

I had been trying to draw for years and a common piece of advice was to conceive of your drawings as being composed of simple forms, like cylinders spheres and boxes. Phrasing this categorically seemed possible but beside the point - most of my ideas here gave the impression category theory could model drawing by virtue of how extremely expressive some categories are, like Set.

But I liked how Category theory had arrows, and diagrams, I really wanted to think of these as drawings in a very verbatim way.

An art teacher of mine, Joshua Jacobo, introduced an idea that gave me an excuse to do exactly that. He has very specific ideas of what traditional drawing is supposed to be.

To him, figures are composed of surfaces, the surfaces have boundaries on critical structural curves, these structural curves are composed of many simple C curves that you can chain together on well chosen points.

This was perfect! If I could find a category where objects were points, morphisms were curves, and surfaces were some higher dimensional gadget, then I'd have a category whose diagrams were drawings in this sense defined by Jacobo.

After sniffing around online, I found out about Moore path categories (https://ncatlab.org/nlab/show/Moore+path+category) these seemed to do exactly what I wanted. My surfaces are 2-morphisms!

This was very exciting to me, even the interchange law had a straightforward interpretation. If I have four "squares" that share curves horizontally and vertically, then "erasing" horizontal lines and vertical lines gives the same result as "erasing" vertical lines and then horizontal lines.

This was a much easier 2-category to wrap my head around than the usual 2-category of small categories.

An accordion category:
This idea is newer, but I believe is essentially sound. There is a variant of an accordion called a "Chromatic button accordion" where the buttons on the melody side are arranged in a hexagonal grid.

Moving one dimension on this grid increase the note by the same number of half steps. On my accordion, a C System, moving down the long direction increases in three half-step units. Moving the diagonal to the left increases the half step by 1, and moving a diagonal to the right increases the half step by 2.

These layouts are sometimes called "isomorphic", because no matter where you place your hand, provided it's "the same shape" your chord will have the same quality (minor, major, etc.)

The Euler "Tonnetz"(https://en.wikipedia.org/wiki/Tonnetz) can be thought of as an isomorphic layout, it's used on an instrument called the Harmonetta (https://en.wikipedia.org/wiki/Harmonetta).

Songs are typically written by concatenating chords, or individual notes. But to play the instrument you have to physically move your hand between the specific chords on the instrument.

I want to think of the hand shapes and positions as objects, and the way I move my hand between these different positions, as the arrows, of an accordion category. I haven't made this formal, but intuitively it feels like it can at least start as 5 Moore path categories glued together (one path for each finger).

So this category would encode the physical act of playing. Then a Functor could map the specific objects to chords in music theory, and the hand motions to voice leading tracking transforms between these chords. So the physical act of playing the accordion gets mapped to morphisms like the Parallel chord transform, the Relative chord transform, and the Leading tone transform (explained in the Tonnetz article I linked).

Are my ideas with these subjects reasonable? Or am I sticking category theory into places where it doesn't belong? There's a theme here of possible physical motions forming a sort of basic initial, but very strict category (I've been wondering if I should treat the way you can physically move chess pieces as a sort of strict initial category, for example).

I've been thinking of my "physical movements" as a sort of "syntax" and I'm trying to embed these different activities into abstract semantic structures. Giving abstract meaning to physical tools. Is this at all a reasonable thing to do?

view this post on Zulip David Egolf (Sep 18 2024 at 01:06):

I'm also interested in the question "How to make up categories outside of math?". A couple rough thoughts:

I'm sure there is a LOT that could be said about the process of moving from a system of interest to a categorical setting that allows for discussion of important concepts in that setting. On a broadly related topic, you may enjoy the book "Seven Sketches in Compositionality".

view this post on Zulip John Baez (Sep 18 2024 at 01:10):

An accordion category: this idea is newer, but I believe is essentially sound.

Accordion. Essentially sound. :laughing:

view this post on Zulip John Baez (Sep 18 2024 at 01:14):

I want to think of the hand shapes and positions as objects, and the way I move my hand between these different positions, as the arrows, of an accordion category.

Guerino Mazzola's book The Topos of Music: Geometric Logic of Concepts, Theory, and Performance is all about trying to use category theory in music, and he quite generally wants to develop categories of 'gestures', which could be many things, ranging from a hand gesture to a musical phrase. From my limited readings, I find this book unsatisfying in terms of how much benefit he gets versus how much work he puts in. (The book is 1335 pages long.) But the descriptions of music and of category theory seem accurate to me.

view this post on Zulip John Baez (Sep 18 2024 at 01:18):

Are my ideas with these subjects reasonable? Or am I sticking category theory into places where it doesn't belong?

They seem reasonable. I've spent a lot of time trying to apply category theory to subjects ranging from topological quantum field theory to electrical circuits to chemistry to (most recently) software for epidemiological modeling. From doing this, I think there are very many patterns in the world that we can describe with the help of category theory. So to me the big question is: which subjects would most benefit from this sort of description? What exactly am I hoping to achieve?

view this post on Zulip John Baez (Sep 18 2024 at 01:21):

If the main goal is to learn math and have fun, the stakes are fairly low and the range of topics one can apply category theory to is enormous. This may be a good way to start! Then as one gets better at this game, one may - or may not - decide to look for 'killer apps', where category theory helps to achieve something really impressive.

view this post on Zulip Mike Shulman (Sep 18 2024 at 01:23):

Sometimes when you see "objects and arrows" and try to think of it as a category, what you're really seeing is a [[quiver]], and the only way to make it into a category is basically to generate the free category on that quiver since the arrows don't intrinsically have a notion of composition. It seems to me this is the case with chess moves: you can't compose two single moves and get another move, so the arrows in a category have to be sequences of moves, which are the morphisms in the free category generated by the quiver of positions and single moves.

There's nothing wrong with free categories, but sometimes when what you "really" have is a quiver, it's more useful to work directly with that.

view this post on Zulip John Baez (Sep 18 2024 at 01:33):

Btw, I think if you want to see nice applications of high-powered math to music I recommend things like Tymoczko's A Geometry of Music and Crans, Fiore and Satyarenda's Group actions in neo-Riemannian music theory. These bring in orbifolds and group theory. And I think they make a broader point: if your goal is to understand something using math, it can be very limiting to only use category theory. I prefer to let the subject tell me what math it wants me to use.

On the other hand if your main goal is to apply category theory, and you don't really care what you're applying it to, it pays to run around and try applying it to everything you can, and get a sense for what works.

It's sort of like the difference between "I want to fix this table with wobbly legs" and "I've got a hammer and I want to use it for something".

view this post on Zulip John Baez (Sep 18 2024 at 01:36):

People tend to say "when all you have is a hammer everything looks like a nail" as if it's a bad thing to be tool-centered. But in math it can actually be good to run around with your latest tool and see what it can do. Just don't break anything. :wink:

view this post on Zulip Alex Kreitzberg (Sep 18 2024 at 01:55):

As it stands, the subject where I feel most successful using Category Theory in surprising ways is programming, and I'm a bit embarrassed about this, because I have a math undergrad.

So I'm trying to use CT creatively, with purpose on various things I find interesting, beyond programming, but like you said it's hard.

The Moore Path category for example, I think it's about as good of a model for drawing as one could hope from CT. But now what? It's hard to find stuff written about it, and if I really wanted to use these ideas for art, you're right it seems like a lot more is "closer to the ground" in differential geometry.

But in programming, all I have to do is slap a Monad on something and now I can pretend my computer exists in a multiverse.

So, which widgets in category theory am I not taking for granted, that makes it obvious it'll be hard to get very far in a Moore Path Category - if my goal is to model drawing with it?

Does that make sense? It's the sort of question that answers itself as I gain more experience, but until I get that experience some applications of applied category appear random (to me as a beginner).

view this post on Zulip Alex Kreitzberg (Sep 18 2024 at 02:00):

I like David's answer with respect to that last question.

I guess I am trying to gain experience using a hammer.

view this post on Zulip Alex Kreitzberg (Sep 18 2024 at 02:00):

Just that slogan "Category Theory models composition" is so punchy, it's hard for me to not try to apply that to literally everything :joy:

view this post on Zulip Alex Kreitzberg (Sep 18 2024 at 02:01):

I have more dramatic dreams than what I shared, but I'm trying to be a responsible adult and not move forward with claims I can't prove

view this post on Zulip Alex Kreitzberg (Sep 18 2024 at 02:10):

Mike Shulman said:

Sometimes when you see "objects and arrows" and try to think of it as a category, what you're really seeing is a [[quiver]], and the only way to make it into a category is basically to generate the free category on that quiver since the arrows don't intrinsically have a notion of composition. It seems to me this is the case with chess moves: you can't compose two single moves and get another move, so the arrows in a category have to be sequences of moves, which are the morphisms in the free category generated by the quiver of positions and single moves.

There's nothing wrong with free categories, but sometimes when what you "really" have is a quiver, it's more useful to work directly with that.

You know I think I noticed this technical issue once and then decided the arrows were "games" rather than moves. But was unnerved by the difference between individual moves and whole games. Whether you could start a game from a random position, etc.

I'm embarrassed I forgot how forced my thinking felt here.

But if you are okay with this, then an opening book of games would have "openings" with branching moves organized into more specific sections.

But you're right all the levels here feel uncomfortable and forced, thanks for pointing out I should probably think about quivers if I really am concerned with individual moves.

view this post on Zulip John Baez (Sep 18 2024 at 02:11):

The Moore Path category for example, I think it's about as good of a model for drawing as one could hope from CT. But now what? It's hard to find stuff written about it, and if I really wanted to use these ideas for art, you're right it seems like a lot more is "closer to the ground" in differential geometry.

Moore paths were invented for use in homotopy theory. There are other closely related categories, 2-categories and bicategories whose 1-morphisms are paths, or equivalence classes of paths - perhaps smooth paths if we're doing differential geometry. A couple are discussed in my paper with John Huerta, An invitation to higher gauge theory, and the papers we discuss there. The description on page 5 should be pretty readable.

So there's a lot to say about this. It would be hard to catch up with all this stuff if you were trying to do gauge theory. But for a new application, like drawing, it could be a lot easier.

view this post on Zulip John Baez (Sep 18 2024 at 02:20):

The concept of 'lazy path' discussed on page 5 might actually be nice for drawing, because it's a path that's smooth (infinitely differentiable) and constant in a neighborhood of each end of the path - as if your pen started and ended at rest, and moved smoothly.

view this post on Zulip Alex Kreitzberg (Sep 18 2024 at 02:26):

It's on my to-do list to learn Homotopy theory, I got Fomenko's book because the illustrations are so beautiful.

Thank you for the suggestion to look into lazy paths, I'll read up on them!

Here's something that I think I'm doing wrong, or am deeply confused about.

If I have two paths that share ends, but aren't strictly equal, I want to think of them as different lines. Like the top and bottom of an eye lid (to oversimplify). But if they're both smooth, then there's probably a smooth Homotopy taking one to the other - so they're both "the same" relative to theory about smooth lines. I don't like that.

So in all my categories above I was trying to make sure all the arrows were strictly different. That is, in my mind, I'm avoiding Homotopy theory.

I think this is deeply misguided somehow, but I'm not sure in what way.

view this post on Zulip John Baez (Sep 18 2024 at 03:08):

You don't need to mod out by smooth homotopies to get a category where the objects are points and the morphisms are piecewise smooth Moore path.

view this post on Zulip John Baez (Sep 18 2024 at 03:09):

So, paths that look different will give different morphisms in this category.

view this post on Zulip Alex Kreitzberg (Sep 18 2024 at 03:13):

But should I be in the habit of modding out by smooth homotopies if I want to talk about smooth stuff?

Like how we're okay rotating triangles when we talk about angles?

I guess I'm asking if I'm making my life way harder in a subtle way by avoiding equivalence classes?

view this post on Zulip Alex Kreitzberg (Sep 18 2024 at 03:19):

I looked for Moore paths to avoid Homotopy theory, but the Homotopy theorists made them up to do Homotopy theory. So I think I'm confused somewhere, and I'm trying to find out where.

view this post on Zulip John Baez (Sep 18 2024 at 03:19):

Alex Kreitzberg said:

But should I be in the habit of modding out by smooth homotopies if I want to talk about smooth stuff?

You should be in the habit of doing what you need to for the task at hand. If we're trying to describe connections in gauge theory, we definitely don't want to use paths mod all smooth homotopies - see my paper. But if you're trying to describe 'flat' conectoins you should.

view this post on Zulip John Baez (Sep 18 2024 at 03:20):

Alex Kreitzberg said:

I looked for Moore paths to avoid Homotopy theory, but the Homotopy theorists made them up to do Homotopy theory. So I think I'm confused somewhere, and I'm trying to find out where.

Homotopy theorists, or at least Moore, didn't want to be forced to take homotopy classes of paths just to get a category.

view this post on Zulip Alex Kreitzberg (Sep 18 2024 at 03:20):

Alright than I guess we had the same goal XD

view this post on Zulip John Baez (Sep 18 2024 at 03:20):

Just because you do homotopy theory for a living doesn't mean you always want to mod out by homotopies all the time.

view this post on Zulip Alex Kreitzberg (Sep 18 2024 at 03:20):

I'll stop overthinking this point then, thank you for your time.

view this post on Zulip Posina Venkata Rayudu (Nov 30 2024 at 09:37):

@Alex Kreitzberg The claim "category theory is how our mind works" is kind of sort of OK if we associate concepts with the mind and category theory as involving concepts, along with their objectifications.

Pop Quiz: Divide-and-rule works, but why?
Hint: It involves categories and morphisms, no more technical than any that you'd actually encounter in Lawvere & Schanuel, Conceptual Mathematics.
Prize: I'll solve any exercise of your choice from Lawvere & Schanuel, Conceptual Mathematics, or Lawvere & Rosebrugh, Sets for Mathematics.
P.S. Identities constrict humanity (cf. Helen Vendler).