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.
I'm going to show a first step that I made in visualising sheaves using interactive web pages containing JavaScript and SVG (Scalable Vector Graphics). My motivation for this is that I follow Seymour Papert, the inventor of Logo, in that I "build knowledge most effectively when [...] actively engaged in constructing things in the world." The quote is from https://news.mit.edu/2016/seymour-papert-pioneer-of-constructionist-learning-dies-0801 . So I want a tool that lets me play with sheaves as though they were bricks or musical notes or electronic circuit components. I don't know what that tool would look like: finding out is itself play. (Actually, another motivation is that I'm an artist, and depicting categorical ideas is relaxing in the same way that, say, drawing Russian Constructivist art is. The systems can be so elegant. And sheaves might actually be useful for categorical aesthetics.)
How does it work? I start with the notion that a sheaf is a kind of functor on the poset of open sets of a space. So in the left half of an image, I draw two open sets, regarded as objects in a category. The picture doesn't define the space that the open sets are from, but for the moment, let's assume it's ℝ with the familiar topology.
The right half draws two objects of the category that's the functor's target. The concept that I want to illustrate is:
A pre-sheaf F of Abelian groups on a topological space X is an assignment of an Abelian group F(U) to each open set U in X; and for every pair of open sets V⊂U in X, a group homomorphism (called the restriction homomorphism) ρUV:F(U)→F(V).
There's more to pre-sheaves and sheaves than this, but I need to start somewhere. I've let the group on U be the group of continuous functions from U to ℝ. This is standard, and easy to work with, because I can use arithmetic and X/Y plots to show how its elements combine. I want to do that, and do it in enough detail to make it clear that this is a group. In future visualisations, I'll want to show the group homomorphisms at work too.
Each element of F(U) is a continuous function from U to ℝ. I show two example open sets U and V, so I need two groups for F(U) and F(V). I can't show all of the infinite number of elements, but I can show representative examples. Psychological research into mental models suggests that at least three is a good number of examples. I'll use five: one of those is a bit special because it's the group identity, and another adds variety.
So I've given F(U) five representative elements, and F(V) likewise. The restriction mapping is clearly demonstrated by the paired sine and parabola graphs, and by the X-axis scales.
So this is what I have:
Groups ought to feel dynamic, and with a computer, we can animate them rather than just writing down a combination table. So let's do that. I introduce a combination sign, visible above, which is a + in a circle, coloured so it is vividly different from the group elements, arrows, and open sets. (I also styled the open sets, stippling the edges as is sometimes seen in topological diagrams.)
So how do we use the combination sign? I made the group elements — the graph thumbnails — draggable. That is, you can pull them along by placing the mouse over them, left-clicking, moving the mouse while the button is down, and releasing it.
Dragging the combination sign over two elements and clicking generates their combination. This is just the pointwise sum of the elements. As explained above, these are the continuous functions from the open set to ℝ.
Since combination is commutative, the relative positions of the elements under the sign don't matter. Once the new element has been generated, it can be combined too. Here's combination working:
In case it's not clear, these are before and after screenshots. The third thumbnail in the top row plays no part in the combination. It just happened to be there. Anyway, combination can be repeated as many times as desired, including with elements generated by previous combinations.
There is a slight confusion of metaphors here. The original five elements represent a view into their group. In such a view, each element can appear only once. However, that metaphor breaks as soon as a combination generates an element that was already depicted, because now the picture plane represents a workspace such as a piece of scrap paper, in which one can write any symbol anywhere. It's unlikely to lead to confusion here, but such clashes need watching for.
This is my first attempt at such a visualisation, and there's a lot I've not said. For example, about the homomorphism between the two groups C(V,ℝ) and C(U,ℝ). However, I have emphasised the nature of the restriction mapping, by lining up corresponding thumbnails so it's easy to compare their scales and the shapes of their functions.
Maths, computing: graphic design is also important. The functor arrow is thicker than the morphism arrows. The inclusion arrow clearly points the other way from the restriction arrow, emphasising contravariance. The open-set circles are stippled round the edges, imitating one style of shading seen in some maths books. The circles are horizontally aligned with the elements of the groups they map to. There's a lot of white space, and the diagram is, I hope, easy to follow.
>
I was just thinking of you the other day -- there were contributions of yours to the n-Category Cafe way back in the day, describing your interactive web pages to illustrate limits and colimits. Glad to see your name again!
Thanks for the thought! I'm not sure now, but I might have contributed a comment to your blog too.
Do you have links to interactive category theory examples you've made?
The interactive web page that Todd mentioned is at http://www.j-paine.org/cgi-bin/webcats/webcats.php . Unfortunately, when I tried it before writing this, I found it didn't work. It's on a commercial web server that I pay for, and I've gone over filestore quota and don't have the money for more. The space holds the Prolog and GraphViz binaries that run it, plus scripts and the images sent to the user. I'll see what I can do, but I may not be able to afford to bring this demo back to life. That said, the link above will be enough to show what it would have done. I kept one of the diagrams it generated, at http://www.j-paine.org/hello/animated_products_diagram.gif .
The interactive web page that I posted about last night is different, because all the work is done in JavaScript inside the page, rather than by external code on a web server. It's at http://www.j-paine.org/lds/sheaves1/all.html . Run it with one of the big-name web browsers such as Firefox or Chrome if you can, preferably not on a phone, because that's more likely to execute the code properly. You can see my code if you ask the browser to show page source. Most of it does the drawing. A more sophisticated version probably would hive off some work to Prolog again: for example, when deriving the formulæ for the sum of the functions represented by the little thumbnail plots.
Awesome
I've got a few others on the go. One is about natural transformations. In the framework below, clicking on a morphism in the left-hand category lights up the corresponding naturality square in the right. The arrowheads are missing, probably a bug in my code, but you can see the principle. That's only a start, because I need to decide what kinds of object the two categories should have. But it will be an important part of whatever I design.
I'd like to use visualisations like this to teach categorical concepts to Humanities students. As someone remarked in another thread here — I can't find it again — category theory involves a lot of language-building, perhaps much more so than in other branches of mathematics. Some of that language could be very useful in, for instance, talking about translation of natural languages. Imagine if, instead of messing around with prompt engineering, we had a formal language with which we could specify to ChatGPT how to translate an English document into a French one, or how it should squeeze a business report down to its essentials. For the former, natural transformations and variants thereof might be very useful. (I've also experimented with them for describing how artistic styles relate to one another, and what emotions an artist intends their audience to feel.)
For the latter, I'm thinking of things like kernels. Not kernels of e.g. group homomorphisms though, but kernels of semiotic morphisms.
We don't really have good tools for building these visualisations yet.
I just put up a new one which uses Boolean algebras rather than groups. At http://www.j-paine.org/lds/sheaves1/all_bl.html .
I'm trying to finish a post on how category theory might help understand accordion's interfaces, I basically just need to post it. I'm trying hard to be as concrete and grounded as possible, so that I'm hopefully able to make headway proving stuff.
That said, I relate to a lot of your dreams for the subject, I wanted to say that out loud. I also have some interest in interactive explanations.
You might like this lecture series by Leonard Bernstein: https://youtube.com/playlist?list=PL6DY3I6m2_i8B3Wb3rxPNxXEPavny4QdD&si=crgXSmjpGgP3VNdV
Trigger warning: there's a moment of bad sexism. I think it's in the third lecture.
But I mention the series because the premise is to seriously interrogate an analogy between language and music. Eventually diagrams play a role in organizing the analogy. I really want to understand these diagrams that pop up when people try to make analogies between very different subjects.