It just became a lot easier to learn about applied category theory, thanks to this free book:

• Brendan Fong and David Spivak, *Seven Sketches in Compositionality: An Invitation to Applied Category Theory*.

I’ve started an informal online course based on this book on the Azimuth Forum. I’m getting pretty sick of the superficial quality of my interactions on social media. This could be a way to do something more interesting.

The idea is that you can read chapters of this book, discuss them, try the exercises in the book, ask and answer questions, and maybe team up to create software that implements some of the ideas. I’ll try to keep things moving forward. For example, I’ll explain some stuff and try to help answer questions that people are stuck on. I may also give some talks or run discussions on Google Hangouts or similar software—but only when I have time: I’m more of a text-based guy. I may get really busy some times, and leave the rest of you alone for a while. But I like writing about math for at least 15 minutes a day, and more when I have time. Furthermore, I’m obsessed with applied category theory and plan to stay that way for at least a few more years.

If this sounds interesting, let me know here—and please visit the Azimuth Forum and register! **Use your full real name as your username, with no spaces**. I will add spaces and that will become your username. **Use a real working email address.** If you don’t, the registration process may not work.

Over 70 people have registered so far, so this process will take a while.

The main advantage of the Forum over this blog is that you can initiate new threads and edit your comments. Like here you can write equations in LaTeX. Like here, that ability is severely limited: for example you can’t define macros, and you can’t use TikZ. (Maybe someone could fix that.) But equations are better typeset over there—and more importantly, the ability to edit comments makes it a lot easier to correct errors in your LaTeX.

Please let me know what you think.

What follows is the preface to Fong and Spivak’s book, just so you can get an idea of what it’s like.

### Preface

Category theory is becoming a central hub for all of pure mathematics. It is unmatched in its ability to organize and layer abstractions, to find commonalities between structures of all sorts, and to facilitate communication between different mathematical communities. But it has also been branching out into science, informatics, and industry. We believe that it has the potential to be a major cohesive force in the world, building rigorous bridges between disparate worlds, both theoretical and practical. The motto at MIT is *mens et manus*, Latin for mind and hand. We believe that category theory—and pure math in general—has stayed in the realm of mind for too long; it is ripe to be brought to hand.

#### Purpose and audience

The purpose of this book is to offer a self-contained tour of applied category theory. It is an invitation to discover advanced topics in category theory through concrete real-world examples. Rather than try to give a comprehensive treatment of these topics—which include adjoint functors, enriched categories, proarrow equipments, toposes, and much more–we merely provide a taste. We want to give readers some insight into how it feels to work with these structures as well as some ideas about how they might show up in practice.

The audience for this book is quite diverse: anyone who finds the above description intriguing. This could include a motivated high school student who hasn’t seen calculus yet but has loved reading a weird book on mathematical logic they found at the library. Or a machine learning researcher who wants to understand what vector spaces, design theory, and dynamical systems could possibly have in common. Or a pure mathematician who wants to imagine what sorts of applications their work might have. Or a recently-retired programmer who’s always had an eerie feeling that category theory is what they’ve been looking for to tie it all together, but who’s found the usual books on the subject impenetrable.

For example, we find it something of a travesty that in 2018 there seems to be no introductory material available on monoidal categories. Even beautiful modern introductions to category theory, e.g. by Riehl or Leinster, do not include anything on this rather central topic. The basic idea is certainly not too abstract; modern human intuition seems to include a pre-theoretical understanding of monoidal categories that is just waiting to be formalized. Is there anyone who wouldn’t correctly understand the basic idea being communicated in the following diagram?

Many applied category theory topics seem to take monoidal categories as their jumping off point. So one aim of this book is to provide a reference—even if unconventional—for this important topic.

We hope this book inspires both new visions and new questions. We intend it to be self-contained in the sense that it is approachable with minimal prerequisites, but not in the sense that the complete story is told here. On the contrary, we hope that readers use this as an invitation to further reading, to orient themselves in what is becoming a large literature, and to discover new applications for themselves.

This book is, unashamedly, our take on the subject. While the abstract structures we explore are important to any category theorist, the specific topics have simply been chosen to our personal taste. Our examples are ones that we find simple but powerful, concrete but representative, entertaining but in a way that feels important and expansive at the same time. We hope our readers will enjoy themselves and learn a lot in the process.

#### How to read this book

The basic idea of category theory—which threads through every chapter—is that if one pays careful attention to structures and coherence, the resulting systems will be extremely reliable and interoperable. For example, a category involves several structures: a collection of objects, a collection of morphisms relating objects, and a formula for combining any chain of morphisms into a morphism. But these structures need to cohere or work together in a simple commonsense way: a chain of chains is a chain, so combining a chain of chains should be the same as combining the chain. That’s it!

We will see structures and coherence come up in pretty much every definition we give: “here are some things and here are how they fit together.” We ask the reader to be on the lookout for structures and coherence as they read the book, and to realize that as we layer abstraction on abstraction, it is the coherence that makes everything function like a well-oiled machine.

Each chapter in this book is motivated by a real-world topic, such as electrical circuits, control theory, cascade failures, information integration, and hybrid systems. These motivations lead us into and through various sorts of category-theoretic concepts.

We generally have one motivating idea and one category-theoretic purpose per chapter, and this forms the title of the chapter, e.g. Chapter 4 is “Collaborative design: profunctors, categorification, and monoidal categories.” In many math books, the difficulty is roughly a monotonically-increasing function of the page number. In this book, this occurs in each chapter, but not so much in the book as a whole. The chapters start out fairly easy and progress in difficulty.

The upshot is that if you find the end of a chapter very difficult, hope is certainly not lost: you can start on the next one and make good progress. This format lends itself to giving you a first taste now, but also leaving open the opportunity for you to come back at a later date and get more deeply into it. But by all means, if you have the gumption to work through each chapter to its end, we very much encourage that!

We include many exercises throughout the text. Usually these exercises are fairly straightforward; the only thing they demand is that the reader’s mind changes state from passive to active, rereads the previous paragraphs with intent, and puts the pieces together. A reader becomes a student when they work the exercises; until then they are more of a tourist, riding on a bus and listening off and on to the tour guide. Hey, there’s nothing wrong with that, but we do encourage you to get off the bus and make contact with the natives as often as you can.

This sounds totally awesome & just registered on the forum. Thanks JB!

Great! It will take a while for your registration to go through, since David Tanzer (another member of the Azimut team) is doing that, and he’s probably not expecting a flood of applications on a late Sunday night in New York.

Tried registering with my real identity (not this one) and no luck despite following the rules that I have to mention Azimuth in the reason for joining.

In what sense did you have “no luck”? Maybe I just haven’t gotten to your application yet: I’m flooded with them, and it’s taking time. Since you’re not revealing your identity here, I can’t tell the status of your applicatoin.

Hi, I tried using WalterTautz as my user id, but the red coloured box appears that says to read the guidelines again. Presumably, the log files would have seen my attempt?

The red colored box means you probably did something wrong. Try registering again and follow all the directions. This is the first of many challenging problems you’ll meet in this course.

You should get a successful registration. Apparently, the mess that is WordPress didn’t like that extra text I wrote. Feel free

email me for a more detailed description of why I want to interact with this forum.

I got rejected also trying to provide a link to this page as a reason for registering … the terms of service didn’t specifically say no links but I removed the link and the application went throught.

I guess the software rejects html or something. Sorry!

Great work, thank you. Recently came into this. And totally inspired. Hope there will be a workshop for novices in NYC sometime soon!!

Sent from my iPhone

EidoSearch President & Co-Founder (314) 406 – 6026 52 7th Avenue, #3F New York, NY 11217 http://www.eidosearch.com

>

Oh my goodness, my comment submitted itself before I had a chance to proofread and finish it! Please delete and I will resubmit — Lee Mondshein

Will do; then I’ll delete these.

Sounds very exciting. Registered on the Forum.

Thanks for announcing the book and initiating this course!

You’re welcome! It’ll fun if a lot of people get involved, ask a lot of questions, and help each other figure out the answers.

Extremely glad you’re doing this, professor. Thank you so much!

Hi! Unfortunately I’ll have to decline your application because you didn’t use your real name as username. Over on the Azimuth Forum we use our real identities. Please don’t be offended; just reapply! By the way: if you get an email when I decline your application, please let me know. Someone else was running this aspect of things and I don’t exactly know what someone sees if their application is declined.

[…] Applied Category Theory – Online Course 5 by mathgenius | 0 comments on Hacker News. […]

Yeah, plenty of interest from HN: https://news.ycombinator.com/item?id=16676614

I’m in. Registering on the forum right now but will probably only start actively participating in a couple of months cause I’m in Africa right now.

Have fun in Africa. I hope you did this:

1) Use your full real name without spaces as username.

2) Use a working email address as address so I can send you further instructions.

If you didn’t, your application will be declined, but don’t feel bad: just apply again following these instructions.

Oh, my god! Great, wonderful…Just one question: is that Spivak the same Spivak of those Calculus books??????? How old is he? Or is he a relative? Just…Curious!!!!

Completely randomly, I ran into him yesterday at a social occasion. I don’t think he expected a complete stranger to say “Wait… are you the David Spivak who wrote a book on category theory?” He confirmed that he is not related to Michael.

I just registered on the forum and am looking forward to going through the book with other folks!

That’s funny. I’m going through about 70 applications now, so it may take a while to get to yours… or maybe you’ll be lucky and I’ll do it soon! I hope you did this:

1) Use your full real name without spaces as username.

2) Use a working email address as address so I can send you further instructions.

If you didn’t, your application will be declined, but don’t feel bad: just apply again following these instructions.

I have registered on the Azimuth forum, as DanSchmidt, and confirmed my email, but I can’t seem to find a way (on multiple browsers) to post or comment there. Am I missing something in the UI or is this a permissions issue? Of possible relevance, when I look at my profile my role is “Applicant”, rather than “Member” as I see in others’ profiles.

Thanks, and apologies for bothering you with administrivia.

All is fine now. Probably I just needed to wait; I think I misinterpreted my original email confirmation as actual membership approval and thought that something was wrong. Thanks!

I once asked him to autograph my copy of

Category Theory for the Working Scientist. I think he didn’t know what to make of the idea.Same Spivak as Calculus on Manifolds. He also has another Category Theory book, Category Theory for Scientists which has similar scope and is available for free online.

I completed the first three chapters of this book, if Seven Sketches is of similar difficulty and scope it will be a joy. :)

No, he’s not the same Spivak as

Calculus on Manifolds! That was Michael Spivak.If you want to register for the Azimuth Forum so you can take the course, please remember to:

1) Use your full real name without spaces as username.

2) Use a working email address as address so I can send you further instructions.

Bah! I thought it would be the same due to the shared interest in dynamical systems theory. No matter.

I’ll read along/do exercises but I came here from a link from a friend from another online community; don’t want my real identity known and linked to that site hence. Oh well.

Have a link to that other category theory textbook from David Spivak:

https://arxiv.org/pdf/1302.6946.pdf

They have slightly different perspectives but feel about the same difficulty.

David Spivak’s also got some lectures up on Youtube on LambdaConf’s channel:

Hope someone finds these useful.

No, he’s not the same Spivak as Calculus on Manifolds! That was Michael Spivak.

David Spivak is not a relative, and he’s a pretty young guy. My former student Brendan Fong is doing a postdoc with him at MIT.

This sounds very interesting. I’m particularly interested in ways Category Theory can be applied to Machine Learning and Information Retrieval, and other topics related to CS & AI. I’ve been extremely curious for a while if Applied Category Theory could offer a better foundation for understanding theoretical aspects of Machine Learning/AI and hopefully provide new avenues for research and applications.

This sounds awesome, I’ll sign up!

If you want to register for the Azimuth Forum so you can take the course, please remember to:

2) Use a working email address as address so I can send you further instructions.

If you don’t, your application will be declined, but don’t feel bad: just apply again following these instructions.

I’m all in!

I’m registered. Looking forward to it, getting deeper into Category Theory has been on my to-do list forever. Thanks John!

Great! I declined your application to the Azimuth Forum because you didn’t follow one of these directions on the registration form:

1) Use your real name, with no spaces, as username.

2) Use a working email address as your email address, so I can send you more instructions.

Don’t feel bad, just reapply!

Would love to join the course. I just filled registration form. Hope did everything according to the rules :)

This sounds great. Cheers.

You’re in!

Registered for this wonderful course just a few minutes ago as suggested in the blog. I am hopeful that in due course of time (days / weeks ?) I’ll be granted a registration. :-)

Understanding how to apply category by way of examples would help me improve my software skills.

You have been granted a registration.

The Pie illustration is IDEF0 sideways.

How Sweet! I can’t tell you how much I appreciate the connection to formal math to knowledge engineering I did years ago.

Another +1 for the opportunity to learn & discuss interactively. Some context: I’ve been a software engineer for 20+ years. I’m not a mathematician, though have a reasonable grounding in discrete maths (logic, sets, graphs). I’ve tried to get my head around category theory several times, though have always found the writing impenetrable (which – to be clear – I see as my limitation, not that of the authors). A brief skim of “seven sketches” holds promise of material presented in a way that’s accessible to me. But I still have questions. So the opportunity to discuss – and ask even the most basic questions – would be greatly appreciated.

(Note: I haven’t registered on Azimuth yet – only because I don’t want to create a ghost account if you decide not to proceed).

I’m definitely proceeding with the course. The course officially starts tomorrow! But people are already asking and answering questions about the first chapter of

Seven Sketches. So, please register.I really like the fact that you want to ask basic questions. If everyone is trying to show off and nobody dares ask basic questions, people won’t learn very much. Once people realized it’s okay to ask basic questions, learning will accelerate. So please help that happen!

Thanks John – that’s very encouraging. Registration request submitted.

[…] https://johncarlosbaez.wordpress.com/2018/03/26/seven-sketches-in-compositionality/ […]

This online course is an awesome idea. I’m a control theorist looking forward to see applications of category theory in control, so I really wish to take part in this course.

Thanks for the opportunity :)

Great! Sometime you might like to check out this thesis:

• Jason Erbele,

Categories in Control: Applied PROPs, Ph.D. thesis, Department of Mathematics, U. C. Riverside, 2016.Jason was a student of mine.

Thanks for the reference! I will give a read :)

Count me in!

You’re in!

I’d love to be a part of this. I’ve sent a registration request on Azimuth following the username and email requirements. I hope that this course will help me improve my software design skills. :)

I’m in!

Very cool! I’m interested.

I may try to sign up since I’ve always been interested in the field but didn’t have patience to learn much—I had already spent time learning some set and model theory, nonlinear dynamics and statistical mechanics, and applications to biology and social fields.

I sort of wonder if this is useful for even theoretial ecology or economics—species and population distributions—sometimes discussed on Azimuth, job finding or matching skills to jobs that need them; optimal budgeting including science funding—predicting what combinations of grants might lead to the best results for the world—and universities.

(One Wisconsin college is proposing to eliminate many liberal arts programs like philosophy, geosciences, arts, languages, in favor of marketing, computer graphics, management, etc. because they say these are what is needed .)

I’ve taken some MOOCs out of curiosity or refreshers in logic, physics, economics, psychology math but only passed and finished a few partly becuse they lack the social or peer support of a non-online college class. I’ve heard only 20% of MOOC takers finish them.

The text may be too abstract for me but if i could get in and through it , that would a be a unique opportunity.

Mart wrote:

There seems to be plenty of peer support in this class: people are asking each other questions and answering them. See for example the discussion about the first chapter:

Also, you can meet other students taking the course, and talk to them online here:

People have written self-introductions, and they’re having conversations, so you can find people you’re interested in.

Thanks–your blog to me is like going to some art gallery –dazzling. (everything from climate, to chemical networks to transfinite logic.)

I’ll try to register and I guess I’ll see what the time constraints are–if i have time and whether there is a schedule i can keep up with. (I’m taking a very basic mooc on fractals from SFI now as a refresher, but even that i have trouble fitting in. )

I’m glad you like my blog here! Yes, I cover a lot of topics… I hate being bored.

The applied category theory course is proceeding apace. It’s taking up a lot of my time, effectively displacing my less interesting social media activities—which was sort of the point.

Category theory could be taken more into account when crafting domain models and interfaces (or abstract classes) in imperative languages. Here is my proposition and a proof of concept of a simple syntax which could be used to do the trick https://github.com/kummahiih/python-domain-equations

I’m not really a computer expert, but I agree that category theory should apply to imperative languages… and should therefore eventually be helpful in designing them.

Might be a midlife crisis, but I miss equation solving from my student time. The usual software rewriting paradigm is to throw the old code away, because it is usually easier to rethink the whole thing again than to modify the current code base. My only cure for it has been so far to write as small pieces as possible, because that way you have at least some pieces for reuse. That type equation thing might work, but it would take months to write so much code that you would be able to see the difference and after you have solved the problems there it would be really hard to try to solve the same problems again in a different way.

This is interesting! I’m in!

[…] Seven Sketches in Compositionality by Brendan Fong and David Spivak. They have a series of video lectures on YouTube and a related “course” organized by John Baez. […]

Here are all the lectures on Chapter 1, which is about adjoint functors between posets, and how they interact with meets and joins. We study the applications to logic – both classical logic based on subsets, and the nonstandard version of logic based on partitions. And we show how this math can be used to understand “generative effects”: situations where the whole is more than the sum of its parts!

• Lecture 1 – Introduction

• Lecture 2 – What is Applied Category Theory?

• Lecture 3 – Chapter 1: Preorders

• Lecture 4 – Chapter 1: Galois Connections

• Lecture 5 – Chapter 1: Galois Connections

• Lecture 6 – Chapter 1: Computing Adjoints

• Lecture 7 – Chapter 1: Logic

• Lecture 8 – Chapter 1: The Logic of Subsets

• Lecture 9 – Chapter 1: Adjoints and the Logic of Subsets

• Lecture 10 – Chapter 1: The Logic of Partitions

• Lecture 11 – Chapter 1: The Poset of Partitions

• Lecture 12 – Chapter 1: Generative Effects

• Lecture 13 – Chapter 1: Pulling Back Partitions

• Lecture 14 – Chapter 1: Adjoints, Joins and Meets

• Lecture 15 – Chapter 1: Preserving Joins and Meets

• Lecture 16 – Chapter 1: The Adjoint Functor Theorem for Posets

• Lecture 17 – Chapter 1: The Grand Synthesis

My course on applied category theory is continuing! After a two-week break where the students did exercises, I’m back to lecturing about Fong and Spivak’s book

Seven Sketches. Now we’re talking about “resource theories”. Resource theories help us answer questions like this:1) Given what I have,

is it possibleto get what I want?2) Given what I have,

how much will it costto get what I want?3) Given what I have,

how long will it taketo get what I want?4) Given what I have,

what is the set of waysto get what I want?We’re having fun bouncing between the relatively abstract world of monoidal preorders and their very concrete real-world applications to chemistry, scheduling, manufacturing and other topics. Here are the lectures so far:

• Lecture 18 – Chapter 2: Resource Theories

• Lecture 19 – Chapter 2: Chemistry and Scheduling

• Lecture 20 – Chapter 2: Manufacturing

• Lecture 21 – Chapter 2: Monoidal Preorders

• Lecture 22 – Chapter 2: Symmetric Monoidal Preorders

• Lecture 23 – Chapter 2: Commutative Monoidal Posets

• Lecture 24 – Chapter 2: Pricing Resources

• Lecture 25 – Chapter 2: Reaction Networks

• Lecture 26 – Chapter 2: Monoidal Monotones

• Lecture 27 – Chapter 2: Adjoints of Monoidal Monotones

• Lecture 28 – Chapter 2: Ignoring Externalities

• Lecture 29 – Chapter 2: Enriched Categories

• Lecture 30 – Chapter 2: Preorders as Enriched Categories

• Lecture 31 – Chapter 2: Lawvere Metric Spaces

• Lecture 32 – Chapter 2: Enriched Functors

• Lecture 33 – Chapter 2: Tying Up Loose Ends

Tai-Danae Bradley has a new free “booklet” on applied category theory. It’s based on the Applied Category Theory 2018 school, and I think it makes a great complement to Fong and Spivak’s book

Seven Sketchesand my online course based on that book:• Tai-Danae Bradley,

What is Applied Category Theory?In my online course on applied category theory we’re now into the third chapter of Fong and Spivak’s book

Seven Sketches. Now we’re talking about databases!To some extent this is just an excuse to (finally) introduce

categories, functors, natural transformations, adjoint functorsandKan extensions. Great stuff, and databases are a great source of easy examples.Here are the lectures:

• Lecture 34 – Chapter 3: Categories

• Lecture 35 – Chapter 3: Categories versus Preorders

• Lecture 36 – Chapter 3: Categories from Graphs

• Lecture 37 – Chapter 3: Presentations of Categories

• Lecture 38 – Chapter 3: Functors

• Lecture 39 – Chapter 3: Databases

• Lecture 40 – Chapter 3: Relations

• Lecture 41 – Chapter 3: Composing Functors

• Lecture 42 – Chapter 3: Transforming Databases

• Lecture 43 – Chapter 3: Natural Transformations

• Lecture 44 – Chapter 3: Categories, Functors and Natural Transformations

• Lecture 45 – Chapter 3: Composing Natural Transformations

• Lecture 46 – Chapter 3: Isomorphisms

• Lecture 47 – Chapter 3: Adjoint Functors

• Lecture 48 – Chapter 3: Adjoint Functors

• Lecture 49 – Chapter 3: Kan Extensions

• Lecture 50 – Chapter 3: Kan Extensions

• Lecture 51 – Chapter 3: Right Kan Extensions

• Lecture 52 – Chapter 3: The Hom-Functor

• Lecture 53 – Chapter 3: Free and Forgetful Functors

• Lecture 54 – Chapter 3: Tying Up Loose Ends

Our course on applied category theory is now starting the fourth chapter of Fong and Spivak’s book

Seven Sketches. Chapter 4 is on collaborative design and enriched profunctors. Here are the lectures:Here are the lectures:

• Lecture 55 – Chapter 4: Enriched Profunctors and Collaborative Design

• Lecture 56 – Chapter 4: Feasibility Relations

• Lecture 57 – Chapter 4: Feasibility Relations

• Lecture 58 – Chapter 4: Composing Feasibility Relations

• Lecture 59 – Chapter 4: Cost-Enriched Profunctors

• Lecture 60 – Chapter 4: Closed Monoidal Preorders

• Lecture 61 – Chapter 4: Closed Monoidal Preorders

• Lecture 62 – Chapter 4: Constructing Enriched Categories

• Lecture 63 – Chapter 4: Composing Enriched Profunctors

• Lecture 64 – Chapter 4: The Category of Enriched Profunctors

• Lecture 65 – Chapter 4: Collaborative Design

• Lecture 66 – Chapter 4: Collaborative Design

• Lecture 67 – Chapter 4: Feedback in Collaborative Design

• Lecture 68 – Chapter 4: Feedback in Collaborative Design

• Lecture 69 – Chapter 4: Feedback in Collaborative Design

• Lecture 70 – Chapter 4: Tensoring Enriched Profunctors

• Lecture 71 – Chapter 4: Caps and Cups for Enriched Profunctors

• Lecture 72 – Chapter 4: Monoidal Categories

• Lecture 73 – Chapter 4: String Diagrams and Strictification

• Lecture 74 – Chapter 4: Compact Closed Categories

• Lecture 75 – Chapter 4: The Grand Synthesis

• Lecture 76 – Chapter 4: The Grand Synthesis

• Lecture 77 – Chapter 4: The End? No, the Beginning!

I wonder isn’t there a mistake? I started 1st lecture (about preorders), and it looked like it was about to talk a lot about preorders; but a few paragraphs later it just… ended!

And then there’s a link to questions, and there are ones that wasn’t mentioned in lecture. E.g. 3-rd says “What do mathematicians usually call the thing that Fong and Spivak call a poset?”, and you even said in lecture that you answered that question. But… you didn’t, if you enter word “math” in browser search, you won’t find an occurrence in the first lecture.

And in general, I’m surprised that lectures are soo tiny, did people succeed learning Category Theory from them?

These lectures are to be read along with the book.