The author's blog  has more of this style and has really helped me get deeper into category theory. Without it, I wouldn't have even begun to try and understand things like the Yoneda lemma (which still remains a mystery to me).
Does anyone know any other papers or resources with this style? Maybe something like "explorable explanations" ?
On first reading, it seems magical and deep, but once you grok the proof, it feels like a relatively trivial observation. The whole thing is just about arrow composition!
In a way, once you're on the other side, the Yoneda Lemma feels a bit like a checkpoint during the accimatization period where your brain gets used to thinking in categories and commutative diagrams.
Not quite sure it's exactly the style you're talking about, but Bartosz Milewski has a nice series of video lectures going all the way from nothing up to Coend stuff. IIRC the series gets to the Yoneda Lemma somewhere in the second series:
There's much much more to it.
For example, a version of the yoneda lemma also holds for metric spaces (instead of a set of arrows between to things, you simply have a number indicating a distance between two things).
Here's how I like to think about the yoneda lemma:
If you have some kind of objects you want to talk about, one way to do this is by relating these objects to each other. Once you have established such a "method of discourse" (i.e. a way to talk about how your objects relate to each other) the yoneda lemma tells you:
1. You can forget about the inner structure of your objects; Everything is already contained in your "method of discourse".
2. Inversely: The choice of a "method of discourse" severely limits what you can say about your objects.
3. There is no spoon: To understand how you can escape these limitations you need a "method of discourse" for "methods of discourse".
That *is* a arrow. Arrow composition is adding up the distance along a path.
I think the other poster meant "elements in the set of morphisms" when they said "arrows".
The difference is the following: Metric spaces "are" categories enriched over the real numbers, ordinary categories are categories enriched over the category of sets. So in one case the morphism objects are sets while in the other case they are real numbers. "Arrows" then refers to something internal to the morphism object. The distance (a real number) between two points in a metric space does not have any internal structure.
I think if you replace _____ with the right word almost every result I've seen in my (albeit somewhat limited) exposure to category theory can be described this way.
(not that that detracts from your answer!)
You have time on your side. Sustained effort compounded over time is unreasonably powerful. Keep pushing!
Thank you, this hits close to home and is great advice, I appreciate it.
On my cube walls, whenever I get back to my cube: “magic is just cleverly concealed patience.” The approximate η-expansion: you can generally figure out what professional magicians do, you just dismiss it, “I mean of course she coulda known what card I was going to pull if she bought 52 decks of cards and assembled an entire card made out of the Jack of Spades... but that’s expensive and difficult and who would do that.” Penn Jillette puts the same point a different way, saying that he is going to have to perform the same trick over and over again and so it cannot be 99% likely to not injure him, that is far, far too low, he has to be 100% certain his tricks are safe. If he is firing a nail gun at Teller’s neck it must surely be incapable of firing a nail at Teller, and if he waxes on about how much he has memorized the pattern of the nails in the gun then he must be cleverly concealing whatever patience went into making that nail gun and the illusion that it is loaded.
But the key is that once you see this one place you see it everywhere. A restaurant works by the same magic. You say what you want and it magically appears before you. How did that happen? Prep work for hours in advance of the meal, so that when the time comes I just need to put tab A in slot B. Like a beef wellington; pre-cooked steak wrapped into a nice little bundle that just needs to be finished in the oven for 20 minutes and sliced. Something to think about next date night—you can impress your date immensely if you make the wellingtons the night before, so that your focus is on your lover and not on your cutting board.
You don’t usually think about the prep work that went into the Mother of All Demos, but you should. Sometimes when Alan Kay shows a clip from there, he mentions something like, “you might notice that they get sub-second latency on all these operations, but the terminal was here and the computer was over there so I like to ask students how they got sub-second latency on all these operations, and only one time have I got the right answer, one student said ‘because they wanted sub-second latency?’ and that is absolutely correct, they-goddamn-wanted-subsecond-latency, these things are there for you if you really want them.”
Already often quoted on HN, and some discussions are interesting with the author bringing feedback. https://hn.algolia.com/?q=https%3A%2F%2Fbetterexplained.com
To be clear, I'm not knoocking that: for those who can and do grok things from that sort of treatment, all power to your elbow (and no small amount of admiration).
But it's not how my brain works. I need an intuitive understanding first: exemplars, informal pictures, whatever. I can only start unscrambling the formalism once I have the intuition.
The author's introductory blog post is a great example . It's without doubt the best "bootstrap" I've come across - where "best" means "most understanable to me". I really admire people who can take abstract/complex subject matters and lay them out in a clear and accessible way for the layperson. Tai-Danae Bradley definitely fits in that Category (dubious pun intended!).
EDIT: fixed typo
The style is super friendly and builds up intuition slowly, while being completely rigorous. For a great example, check out the "Crema di Mascarpone" chapter which introduces all the tools for writing rigorous mathematical proofs using flow diagrams.
(If you like the design, you'd like Tufte's books.) Anyway, her paper is fun to read and one of the most beautiful papers I've read in terms of layout and design - I like the contrast between the hand-drawn illustrations and the abstract content. It reminds me of Lin Clark's Code Cartoons (https://code-cartoons.com/) .
As a generalisation, I don't think anyone by people into category theory actually cares about or applies category theory.
However, Set Theory is essential to build mathematics.
Taking points from: https://mathoverflow.net/questions/10334/what-practical-appl...
Analysis, Number theory, most of modern mathematics rely on set theory, even computer science in the definition of Turing machines and dealing with infinities there are implicit axioms of set theory.
Likewise, perhaps category theory may not yield immediate applications, but it can be useful as a language (like a programming language, natural or mathematical) to express mathematical ideas, and to build mathematical systems and foundations.
I'm not sure how closely it relates to Category theory, but Homotopy Type Theory has yielded the fantastic Univalent foundations, a seemingly more modern and simple foundation for mathematics. This line of work also yielded a solid basis for Proof assistants.
I don't know enough about functional programming to comment...
Set theory actually IS used as the foundation of other work. But category theory isn't, as far as I know.
OTOH it can also be just a pedagogy issue. That nobody has figured out how to condense it into an undergraduate level so working engineers can grasp basics.
It's not. However claims like that get thrown around a fair amount so the confusion is understandable.
That said, some important Haskell abstractions were designed using category theory. So it can be helpful to know some of the lingo (since it will show up in abstraction names and descriptions).
And if you're looking to design the next breakthrough Haskell abstraction it might be extremely helpful, but that's not 99% of programmers. However, the people who can do that are super cool, eg https://www.staff.ncl.ac.uk/andrey.mokhov/selective-functors....
It depends. Are you an abstract or a concrete thinker? That's one axis of one the standard ways of describing personalities. (Yeah, I know, psychology... but it does seem to describe an actual difference in how people think.)
Now, people with one kind of personality can learn to think in the other way, but they won't find it as easy.
Anyone wanna talk about my applied category theory paper at the fall AAAI symposium? https://arxiv.org/abs/2011.11063
The examples in the course offer a complementary entry point to category theory compared to an approach that leverages programmers' knowledge of functional programming.
Personally, the more examples the better. I'm grateful to be able to rely on the example of a category as a collection of objects corresponding to types, and arrows between types corresponding to functions with that type signature, and arrow composition corresponding to function composition (and functors, and natural transformations, and ... corresponding to familiar concepts like polymorphic types, and map, and polymorphic functions and ...). I believe that many programmers can [come to] understand this one specific example of category theory objects, even if the words are unfamiliar. And there are so many more examples! There is a great pleasure in formalizing the analogies across different aspects of math and engineering.
To get a flavor of and gentle introduction to the analogy-making power of category theory, I recommend this talk by Eugenia Cheng: https://www.youtube.com/watch?v=ho7oagHeqNc
I am reapplying category theory to use functions in dart-Flutter to avoid using statefull widgets and instead use a reactive function approach to state management.
Side benefits is it's easier to explain to beg flutter devs than statefull widgets.
Thanks behnamoh for posting this link
Also, "concatinative" languages like Joy.
The step combinator accepts a list and a quoted program and runs the program on each item in the list in turn. (Use it to write e.g. sum of list of ints, etc.)
 [P] step
----------------- Empty list, no-op.
[X|Xs] [P] step
----------------------- Non-empty list, run P and recur.
X P [Xs] [P] step
In terms of branch and x:
step == [F] x
[L] [P] step
[L] [P] [F] x
[L] [P] [F] F
First, get the flag value and roll< it to the top for a branch:
F == F′ F″
F′ == [?] dipd roll<
[L] [P] [F] F
[L] [P] [F′ F″] F′ F″
[L] [P] [F′ F″] [?] dipd roll< F″
How that works out:
[L] [P] [F] [?] dipd roll< F″
[L] ? [P] [F] roll< F″
[L] b [P] [F] roll< F″
[L] [P] [F] b F″
Now we can write a branch:
F″ == [Ff] [Ft] branch
[L] [P] [F] b F″
[L] [P] [F] b [Ff] [Ft] branch
The false case is easy:
Ff == pop popop
...  [P] [F] Ff
...  [P] [F] pop popop
...  [P] popop
The true case is a little more fun:
... [X|Xs] [P] [F] Ft
We need to uncons that first term, run a copy of P, and recur (recurse?
I think re-curse means to "curse again" so it must be "recur".)
Ft == Ft′ Ft″
Ft′ == [uncons] dipd
... [X|Xs] [P] [F] [uncons] dipd Ft″
... [X|Xs] uncons [P] [F] Ft″
... X [Xs] [P] [F] Ft″
So now we run a copy of P:
... X [Xs] [P] [F] Ft″
Ft″ == [dup dipd] dip Ft‴
... X [Xs] [P] [F] Ft″
... X [Xs] [P] [F] [dup dipd] dip Ft‴
... X [Xs] [P] dup dipd [F] Ft‴
... X [Xs] [P] [P] dipd [F] Ft‴
... X P [Xs] [P] [F] Ft‴
And now all that remains is to recur on F:
Ft‴ == x
... X P [Xs] [P] [F] x
Collecting the definitions, we have:
step == [F] x
F == F′ [Ff] [Ft] branch
F′ == [?] dipd roll<
Ff == pop popop
Ft == Ft′ Ft″ x
Ft′ == [uncons] dipd
Ft″ == [dup dipd] dip
"General Theory of Natural Equivalences" - Samuel Eilenberg and Saunders MacLane. Transactions of the American Mathematical Society, Vol. 58, No. 2, (Sep., 1945), pp. 231-294
His "Categorical algebra" paper from 1964 is open-access:
When his book came out it was the standard work for a while. I think some of the terminology he uses is no longer standard, and there are now many very good modern introductions. But his book is still a pretty good read, primarily because he was a wonderful writer with a very distinctive style.
That said, the examples (given the time the book was written) are almost exclusively mathematical. The proofs and exercises are usually not difficult, but at a high level of abstraction (not surprisingly).
I did his course at uni that used this book as a basis and it was great. Tough, but great.
In with type systems, a typeclass is all you need. The mantra is "to be an X (being substituted for an X) is to be able to perform (implement) such and such actions (or have this or that biochemical properties).
It is that general, that deep, it could be even seen in molecular biology.
Category theory, on the other hand, is just a few nested abstract concepts, of which only monoid has some connection to reality, which ends up empty, like most abstract pseudo- philosophical bullshit.
And yes, I have watched and read everything by Bartosz. It is empty.
But CT in general has nothing to do with programming, it's proper role is in pure mathematics
Let's talk the most basic algebraic laws. Yes, there is indeed no difference in adding 2 apples to 3 apples, or adding 3 of them to 2. The question is from which pile to start, and the result is the same. (Multiplication, being just repeated addition, is also obvious - there is really no difference which side of a rectangle comes first).
Notice, that there is still a fundamental connection to reality. Adding C to O has exactly the same properties. There is no difference which comes first.
The identity element is more tricky, because nothing of this sort existed in nature. Nature has distinct start and stop sequence, and does structural pattern matching in the literal sense.
So, we would superimpose an element upon reality which lacks it, the same way as it goes with zero. Let's say, that trying to add what's can't be added (by physical properties) produces no change to the original element, and it is equivalent to addition of a zero.
Generalising this noop we will get something similar to identify.
1 for multiplication, is natural , while an identify matrix is an artificial construction.
Okay, this is all common sense. The important thing that there is literally nothing deeper than this shaky generalisation which we call monoid. First, because only addition and multiplication are "true monoid".
Protein production by an enzyme is almost it, but no identity.
There is no identities outside your head. A list is a monoid because of added '() - the empty list, which, again, does not exist anywhere. There is no such thing as an empty DNA sequence, empty molecule, etc.
I could go on, but maybe you already see where it goes. Everything is imaginary and too abstract to have any applicable, meaningful context.
More generally, mathematics is a social construction, yes. The word literally means "things we teach each other", and the defining quality of mathematical facts is that they are non-obvious but can be verified for oneself without any additional help or context.
Denying the usefulness of category theory will only make theoretical physics harder. It doesn't make physics any simpler.
Edit: I was going to just link you to the Encyclopedia of Philosophy, but I'll spell out the definitions explicitly instead.
A formal logic is a system with some propositions and some deductive rules. Each rule takes a (family of) propositions and sends them to new propositions, changing their syntax but not their truth. Rules may be composed associatively, and for each proposition, there is a trivial identity rule which changes nothing.
This is a category, right? So every formal logic has a corresponding category whose objects represent its propositions and whose arrows represent its rules.
It is also inconsistent to claim that mathematics is a social construction, while agreeing with these Platonic mathematicians enough to use their view as evidence.
If the point was modelling linguistic syllogisms, or accounting for the stock of apples in your warehouse, why bother? These tasks are better served by analyzing the objects in question, rather than you, the describer.
> Please focus on the maths and stop struggling; you're only making things harder for yourself.
This is condescending – I could say the same thing and ask you to "stop struggling with philosophy". But neither of us should.
And indeed you have a distinct style.