
Basic Category Theory - adamnemecek
https://arxiv.org/abs/1612.09375v1
======
Tom_Leinster
Hi, I'm the author. Thanks for your interest in my book!

I agree, the words "relatively little background" are too vague. What I had in
mind was that the book requires little background _relative_ to many other
introductions to category theory (such as the grand-daddy of them all, Mac
Lane's _Categories for the Working Mathematician_ ). But I should have been
more specific. If update the arXiv submission, I'll fix that.

As cokernel points out, the level of knowledge assumed is roughly what you'd
get from an undergraduate mathematics degree at an ordinary university in
Britain (and probably many other countries too). I know this because I used it
several times to teach a master's course at the University of Glasgow.
Probably the most famous master's-level category theory course is the one that
Cambridge runs in its Part III (master's) programme, which I've also taught.
But this book covers much less than the Cambridge course, and assumes less
background too.

If you've taken either (i) enough algebra that you're comfortable with rings,
groups and vector spaces, or (ii) any kind of topology course, then you should
be able to understand enough of the examples that you can get a good grip on
the general concepts. If you haven't, then it might not be the right book for
you. As others have pointed out, Lawvere and Schanuel's book _Conceptual
Mathematics_ assumes much less background than mine, and there are also texts
oriented towards readers with a computer science background.

------
decasteve
For an even more _basic_ introduction I'd recommend starting with Lawvere and
Schanuel's _Conceptual Mathematics: A First Introduction to Categories_.
Requires less abstract algebra. If you have _some_ mathematical intuition then
this is the book to start with.

I'm surprised he cites _Sets for Mathematics_ but doesn't include it in his
further reading. If you have _some_ university level abstract algebra (groups,
rings, vector spaces, topology) then _Sets_ is a quicker start and better
reference guide for Category Theory. I started with this book before I had
done any abstract algebra and I quickly got out of my depth. But when I did
get more algebraic structures under my belt, I had quite a few aha! moments
and referred back to this book quite frequently.

I haven't read Awodey's introductory Category Theory book so I can't comment
there.

Speaking of Category Theory: Bill Lawvere is an interesting and exceptional
20th century mathematician who probably has less name recognition than he
deserves. Lawvere's Wikipedia page:
[https://en.wikipedia.org/wiki/William_Lawvere](https://en.wikipedia.org/wiki/William_Lawvere)

~~~
danharaj
> For an even more basic introduction I'd recommend starting with Lawvere and
> Schanuel's Conceptual Mathematics: A First Introduction to Categories.
> Requires less abstract algebra. If you have some mathematical intuition then
> this is the book to start with.

It's a great book! Don't forget to do the exercises. It starts off very easy
but if you don't do the exercises all of a sudden you'll be lost.

~~~
Smaug123
This is generally good advice for all maths study, of course: "mathematics is
not a spectator sport".

------
monktastic1
The best intro I've ever seen is Bartosz Milewski's video series (intended
mostly for coders):
[https://www.youtube.com/playlist?list=PLbgaMIhjbmEnaH_LTkxLI...](https://www.youtube.com/playlist?list=PLbgaMIhjbmEnaH_LTkxLI7FMa2HsnawM_)

It assumes almost no prior math knowledge (okay, you should know what sets and
functions are...).

~~~
dualogy
Looks so promising. Haven't decided yet whether I'll view through these 15
whopping hours or study the written (massive-book-length) equivalent chapters
on his blog..

Sizing this up, my real question now becomes: as an active day-to-day-life
programmer, by how much exactly will this propel my work if I already know and
use monads, basic function composition and Haskell?

I'm sure there's _some_ amount of skill/quality/productivity payoff if you
evaluate this kind of time investment over the whole lifetime-of-work
outstanding, but seems impossible to judge beforehand. Any, er, "testimonials"
in terms of how this _actually_ changed work and coding for you or others,
other than "just neat geeky theory to digest and reason about endlessly"?

It's just SO MUCH material to dive into (in terms of sources lectures books
etc, I'm sure once grasped everyone could condense it into a single page,
though fully comprehensible only to themselves, until for teaching others once
again decompressed into 15-hours-of-lectures/26-chapters-totalling-book-
length) and I'm still driven by this odd old urge to "just go pump out code
and make programs _happen_ " back from my earliest Pascal/Basic days I
suppose..

~~~
monktastic1
TBH, I don't feel my FP has improved much after learning why monads are
monoids in the category of endufunctors. I did it for the math geek in me.

~~~
dualogy
I suspected as much. Still gotta dig into all this more deeply _eventually_ ,
but given your anecdote it's probably fine to stretch this out over half a
year, a weekend here, a train ride there, etc, rather than attacking it full-
on

------
myxlptlk
This is how you serve science. Thanks to Tom Leinster. "This electronic
version is not only free; it is also freely editable. For instance, if you
would like to teach a course using this book but some of the examples are
unsuitable for your class, you can remove them or add your own. Similarly, if
there is notation that you dislike, you can easily change it; or if you want
to reformat the text for reading on a particular device, that is easy too."

------
petercooper
_" for readers with relatively little mathematical background."_

A well put together guide, but note that 'relatively little' here means you're
OK with some abstract algebra, at least, as the second example of the
_introduction_ begins: _This example involves rings, which in this book are
always taken to have a multiplicative identity, called 1. Similarly,
homomorphisms of rings are understood to preserve multiplicative identities._
;-)

~~~
keyboardwriter
Why do mathematicians use phrases such as "relatively little mathematical
background" or "introduction to.." when they assume previous knowledge? I find
that really annoying and a turn off from reading most math textbooks that are
suppose to be "introductions". Is there an actual good book on category theory
for someone that didn't complete a math degree?

Additionally, what are applications of category theory to computer
programming, or computer science in general? I find this really interesting
from an outsiders view and want to learn it. I'm looking for a truly basic and
gentle approach to learning category theory, without removing the rigor.

~~~
adamnemecek
You might be interested in "Algebra: Chapter 0"
[http://amzn.to/2iYpAn5](http://amzn.to/2iYpAn5)

"The primary distinguishing feature of the book, compared to standard
textbooks in algebra, is the early introduction of categories, used as a
unifying theme in the presentation of the main topics."

~~~
keyboardwriter
Thanks, but is this another textbook that requires knowledge in abstract
algebra prior to reading it, or make any sort of previous knowledge
assumptions?

~~~
qwerty12653
Having attempted to get through it myself(and having a math degree), I would
strongly recommend against Algebra: Chapter 0 as an introductory text on
either category theory or abstract algebra.

If you either already have a math degree, or if you're already at the point
where you're ready to take an upper-level undergraduate math course, then it
may be a decent book for you. Maybe. For example, if you're:

\- already very comfortable with linear algebra

\- possibly been exposed to a bit of topology in analysis class

\- already been exposed to abstract algebra a bit by a more theoretical
approach to linear algebra (comfortable with proving things in linear algebra
via vector spaces and fields)

Otherwise, I would absolutely steer clear of it. The writing style is also not
terribly beginner-friendly, in my opinion.

The closest book I can think of to what you're asking for would be "Conceptual
Mathematics: A First Introduction to Categories". Though obviously I don't
know whether it's a good fit for your particular background and learning
style.

------
syats
If I may ask, why is the HN community so interested in this particular topic?
I studied Math and have basic understanding of Category Theory... could
someone point me to a text relating Categories and... something related to
computers? What am I missing?

~~~
jordigh
Yeah, I also have a mathematics degree and don't really get the fascination
that computer people have with category theory. I have never been particularly
impressed with their claims of applicability. It seems to just complicate
things for very little benefit. It's a pretty abstraction, but I don't see
actual results from it. People use ugly, practical things like git, not
beautiful categorical abstractions like pijul.

~~~
naasking
> Yeah, I also have a mathematics degree and don't really get the fascination
> that computer people have with category theory.

This point seems to be repeated with every new mathematics.

> It's a pretty abstraction, but I don't see actual results from it.

It has applications in physics and is widely used in computation, particularly
for reasoning about composition of programs with side effects. With respect,
if you don't see any actual results, you haven't been looking.

~~~
madgar
> With respect, if you don't see any actual results, you haven't been looking.

With respect, if you think any category-theoretic results were necessary to
author even 0.01% of the code executed in computation globally, you're
willfully deluding yourself.

~~~
naasking
Good thing I never made that claim. I will however claim that, despite being
unnecessary in principle, quite a bit more than 0.01% of code executed
globally did make use of category theoretic abstractions because they are so
useful (depending on how you measure this of course). Pretty much any program
written for .NET and Scala makes use of monadic composition.

I will also claim that their use is only going to grow with Rust adoption and
Java adopting lambdas and functional APIs.

~~~
madgar
> Good thing I never made that claim.

You said "It has applications in physics and is widely used in computation".
Category theory is not widely used by those who program computers and thus
produce computation in them.

> I will however claim that, despite being unnecessary in principle, quite a
> bit more than 0.01% of code executed globally did make use of category
> theoretic abstractions because they are so useful (depending on how you
> measure this of course). Pretty much any program written for .NET and Scala
> makes use of monadic composition.

And like clockwork, you provide the bog-standard argument for why knowing
category theory is important: you point out how many people productively write
software without knowing anything about category theory (or even abstract
algebra).

Saying that people use category theory to write software without knowing it is
like saying they use Maxwell's Laws to write software: so reductive it loses
all relevance to productive conversation. That's bad, unless your goal is to
make the conversation unproductive.

~~~
naasking
> Category theory is not widely used by those who program computers and thus
> produce computation in them.

Computation is bigger than just programming in industry. "Computing" has
always referred to the overall discipline of computer science.

> you point out how many people productively write software without knowing
> anything about category theory (or even abstract algebra).

That wasn't my point at all. Read again. They can have _even more
productivity_ if they used category theoretic abstractions.

> Saying that people use category theory to write software without knowing it
> is like saying they use Maxwell's Laws to write software

Good thing that's not what I said either. You're making a habit of this.

People can understand a structure, in that they can grasp its semantics and
its application, without knowing it's canonical name.

------
Smaug123
This book also has the [backing of Peter Smith][1], who is basically the king
of logic-related reading materials (logicmatters.net). I was part of a student
reading group studying BCT last year with him, and I found it _extremely_
helpful in the context of people studying for the MMath. One of the most
important parts of basic category theory is seeing how adjunctions, limits and
universal properties play with each other; this book is about exactly that,
and goes into it in a depth I haven't seen very well elsewhere.

[1]: [http://www.logicmatters.net/2017/01/02/tom-leinsters-
basic-c...](http://www.logicmatters.net/2017/01/02/tom-leinsters-basic-
category-theory/)

------
harry8
If you genuinely don't know much maths, maybe Eugenia Cheng's "How to Bake Pi"
also published as "Cakes, Custard and Category Theory"

I enjoyed it, it's not a text, there are no exercises. Popular overview of the
subject, including a first half that mentions category theory only in passing.

Brave to even attempt such a book and I thought she pulled it off rather well.
I hope we hear more from her and others mathematicians are similarly inspired.

------
Bahamut
This article definitely assumes more knowledge than basic abstract algebra -
there are also some key facts used from set theory assumed (i.e. In a proof,
it is assumed to be known that if a compositiom of two maps is the identity
map on one set, and the reverse composition is the identity on the other set,
then the map is a bijection - it also assumes knowledge from abstract algebra
that the composition of two homomorphisms is a homomorphism).

I have only looked in the first chapter, so I cannot speak further on that
atm. That said, I appreciate that a text talks about the universal property -
I did not encounter a definition of it in a text when in grad school. I only
encountered it because lecturers at my grad program made sure to talk about
it.

~~~
wolfgke
> In a proof, it is assumed to be known that if a compositiom of two maps is
> the identity map on one set, and the reverse composition is the identity on
> the other set,

This is something math and computer science students typically learn in the
first two weeks in their mandatory math lectures at least at German
universities

~~~
Bahamut
In the US, I don't think I saw it until a course in set theory, although it
could get rolled up in a topology course.

~~~
wolfgke
I mean: It really makes sense to put it at the beginning since otherwise it's
ugly to understand why a diffeomorphism is defined as it is:

You surely know that an isomorphism of sets (bijective function) has an
inverse that is also an isomorphism of sets.

For differentiable functions a similar statement does not hold in general
(just consider [-1,1] -> [-1,1]; x \mapsto x^3; its inverse is not
differentiable everywhere on [-1,1]; so its inverse exists as an isomorphism
of sets, but not as a differentiable function). Since diffeomorphisms for R^d
are introduced in the 2nd semester for math students (typically in the context
of the inverse function theorem), one better has already understood the basics
before.

------
jasonm23
I enjoy "Make Category Theory Intuitive!" (2007), by Jocelyn Ireson-Paine

[http://www.j-paine.org/make_category_theory_intuitive.html](http://www.j-paine.org/make_category_theory_intuitive.html)

~~~
nhaehnle
Like so much of category theory writing, it lacks examples. Seriously, point
me to examples where category theory is actually useful outside of specific
parts of mathematics, and I'd be very happy. By useful, I mean that it allows
you to prove or understand something that would otherwise not have been proved
(or is much more difficult to prove).

~~~
Smaug123
The point isn't so much proving new results, as showing how different results
(that you thought looked similar but were distinct from each other) are
actually exactly the same result in different settings. One of the things
category theory does is tell you whether a result is "deeply meaningful" or
not.

For example, I still don't know how the Segre embedding of projective
varieties is constructed (my algebraic geometry lecturer laboured hard to try
and impart that knowledge, with the result that I thought it was difficult and
abstruse); but I now know that it's a product in an appropriate category, so
while the construction may be really nontrivial, the object itself is just the
same old product which I already know and love. I now know that the difficulty
lay in showing that this object exists and has the required properties, rather
than the object itself being in some deep moral sense "hard to understand".

------
primodemus
Mathematical Physics by Robert Geroch was recommended on the haskell subreddit
a while ago: [https://www.amazon.com/Mathematical-Physics-Chicago-
Lectures...](https://www.amazon.com/Mathematical-Physics-Chicago-
Lectures/dp/0226288625/ref=sr_1_8?s=books&ie=UTF8&qid=1483449467&sr=1-8&keywords=mathematical+physics)

------
mathgenius
Tom Leinster wrote some things about open sourcing the book here:

[https://golem.ph.utexas.edu/category/2017/01/basic_category_...](https://golem.ph.utexas.edu/category/2017/01/basic_category_theory_free_onl.html)

~~~
alexott
There "Category Theory in Context" book by Emily Riehl is also freely
available at
[https://golem.ph.utexas.edu/category/2016/11/category_theory...](https://golem.ph.utexas.edu/category/2016/11/category_theory_in_context.html)
(I didn't read it yet)...

------
Koshkin
Yet another excellent resource that I found helpful (and fun) is a series of
short lectures by _The Catsters_ :
[https://www.youtube.com/user/TheCatsters](https://www.youtube.com/user/TheCatsters).

------
skocznymroczny
After reading that, will I be able to write a hello world in Haskell?

~~~
Smaug123
No. It's not a Haskell book.

------
elberto34
I lost interest in math after calculus, when it stopped being about results
and more about abstract and complicated squiggles on the page . Elliptic
functions are interesting because it seems calculus-like (such as elliptic
integrals and the theta series) but this weird set/category theory stuff just
doesn't do it for me.

~~~
Smaug123
"Stopped being about results"? I think you're referring to the building-up of
the vocabulary required to attain results. As an analogy, you learnt to count
(1,2,3,4,…), but then when addition and multiplication were introduced, it
"stopped being about numbers, and more about abstract and complicated
operations on numbers". Yes, fine, but addition and multiplication open the
gateway to the study of the primes, from which most of the results of number
theory follow.

~~~
auggierose
I'd say addition and multiplication are more important than prime numbers, or
number theory, for that matter.

