23 ms·
Basic Category Theory
- petercooper 10y ago"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 10y agoWhy 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 10y agoYou 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 10y agoThanks, but is this another textbook that requires knowledge in abstract algebra prior to reading it, or make any sort of previous knowledge assumptions?
- adamnemecek 10y agoYou might be interested in this then https://news.ycombinator.com/item?id=13268335 https://news.ycombinator.com/item?id=13268335 The book doesn't really require much knowledge.
- qwerty12653 10y agoHaving 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.
- GFK_of_xmaspast 10y agoNot sure I see the point in trying to learn category theory without algebra to motivate it.
- j2kun 10y agoI think the first chapter definitely has no prerequisites (it introduces sets and categories), but it's also a core mathematics textbook intended for upper-level undergraduate and early graduate students in pure mathematics. So it re-teaches all of abstract algebra, and quite a bit beyond, using category theory as a unifying principle. It's a book intended to give you a mature perspective and prime you for research.
- keyboardwriter 10y agoI'll check out this book then. Has great reviews.
- Koshkin 10y ago> categories, used as a unifying theme in the presentation of the main topics Categories are not a good way to be introduced to the "main topics" of abstract algebra. Yes, Category Theory can be seen as the "Chapter 0" of a course on abstract algebra, but for beginners a traditional presentation based on sets would be much easier to digest. There is a similarity between using categories and using functional programming style or a language - as opposed to using an approach to mathematics based on sets and using the imperative programming style or a language: the latter is just more intuitive and therefore easier to learn for a beginner.
- stephencanon 10y agoThe mathematical background assumed here is the content of the first couple weeks of the first upper-level course in an undergraduate mathematics degree. It really is "relatively little mathematical background". That said, I second the recommendation of "Algebra: Chapter 0".
- omginternets 10y agoSomeone (perhaps you, stephencanon?) suggested Algebra: Chapter 0 to me a few weeks ago. It's fantastic. Merry Christmas, HN: https://zr9558.files.wordpress.com/2013/11/algebra-chapter-0-aluffi.pdf https://zr9558.files.wordpress.com/2013/11/algebra-chapter-0... Edit: Happy Kwanzaa too! http://fef.ogu.edu.tr/matbil/eilgaz/kategori.pdf http://fef.ogu.edu.tr/matbil/eilgaz/kategori.pdf
- packetslave 10y agowe're posting copyrighted material to HN now?
- omginternets 10y agoIt's for a good cause.
- packetslave 10y agoI imagine the authors would disagree with you
- omginternets 10y agoI imagine the person putting up the link would disagree with them. What's your point?
- schoen 10y agoIt feels like "relatively little" to many authors means "a complete set of undergrad math courses from a fairly math-heavy major" (which could be something like calculus including vectors, differential equations, linear algebra, real analysis, and maybe abstract algebra and discrete math). Maybe we need another term for "OK with logic, proofs, and calculations and doesn't mind learning notation, but hasn't had a lot of university-level courses, or in any event doesn't remember them".
- petercooper 10y agoI think it's easily done when someone knows a topic too well to teach it to beginners from outside the field. Rings, fields and identities may just be math's equivalents of string, operator, or variable, when similarly used by introductory programming books without any explanation.
- Smaug123 10y agoThis is correct: "ring" is a concept that will be taught to all maths undergraduates by the end of the second year at latest.
- cokernel 10y agoI can't comment on applications of category theory to computer programming or computer science, but I believe that the book Conceptual Mathematics by Lawvere and Schanuel is a nice introduction to the basic ideas of category theory. http://www.cambridge.org/catalogue/catalogue.asp?isbn=9780521719162 http://www.cambridge.org/catalogue/catalogue.asp?isbn=978052... I believe this book has been discussed "recently" on HN, but I couldn't find a thread. Mathematicians write for multiple audiences, but there are two major mathematical audiences for their works: specialists in the same field and researchers in other fields. Phrases like "relatively little mathematical background" normally signal that a work is intended to be accessible to non-specialists, but it's often safe to assume that it is aimed at research mathematicians. I think if a work actually requires relatively little mathematical background, a mathematician is more likely to say something like "no, really, you don't need to know mathematics to understand this!" even when it's not quite true.
- keyboardwriter 10y agoGreat recommendation. Thank you!
- empath75 10y agoI genuinely think you don't need a math background to get a general understanding of category theory, because it's so high level. A lot of it is just drawings, even, not complicated formulae and proofs. It's not category theory itself that's difficult to understand, it's the examples and vocabulary. I think you really need no more than high school algebra to understand basically what category theory is about.
- hilbertseries 10y agoThe target audience of this book isn't the layman, it's people studying mathematics. So a phrase like "relatively little mathematical background" is meant in the context of academia. I don't think there's a basic and gentle approach to learning category theory that doesn't remove the rigor. You can learn at a high level what some of the stuff in category theory and get a basic feel and intuition for it, if that's what you want. But, if you want to learn category with the rigor, you're going to have to first learn how to write a proof in mathematics. Really though, you're going to want to have a decent grasp on some basic abstract algebra. Otherwise you're never going to be able to understand the examples for category theory.
- deleted 10y ago[deleted]
- jinfiesto 10y agoI don't understand why this is down-voted. This is probably pretty perplexing to the lay-person. When a mathematician writes "relatively little mathematical background," what that constitutes from their perspective is probably radically different from what a lay-person considers to be "relatively little mathematical background" When I see "minimal mathematical background" or the like, I usually think: "Understands basic set theory, the concept of a function, and has familiarity with basic proof structures" When I see "mathematical maturity", I think "Understands, real analysis, abstract algebra, and topology." Hope that helps.
- deleted 10y ago[deleted]
- zodiac 10y agoWell, everything has some amount of implied/customary prerequisites. You wouldn't complain if a books "Introduction to Metaprogramming in Ruby" or "Introduction to C++ templates" didn't teach you programming. In math many "general topics" like calculus, linear algebra, probability etc are sometimes studied a few times (eg the second course in calculus might start from scratch and carefully construct the real numbers, which the first course skipped), and I've noticed some authors use "Introduction to X" to mean "this textbook is meant to be a first course in X"
- deleted 10y ago[deleted]
- cokernel 10y agoThe "note to the reader" clarifies things a bit -- he's aiming for requiring "no more mathematical knowledge than might be acquired from an undergraduate degree at an ordinary British university". Though he does not specify whether he has in mind a mathematics degree, I think this can be deduced from the fact that he indicates that the text developed out of a master's-level course.
- Smaug123 10y agoThe text developed from approximately six lectures' worth of the MMath-level 24-lecture Part III Introduction to Category Theory at Cambridge, I believe. (Source: I took that course last year, and was part of a small reading group studying Leinster's Basic Category Theory at that time. We found that book really, really helpful.)
- empath75 10y agoI actually laughed out loud when I got to that part. It seemed like the first page and a half he really tried to explain it without jargon and then just gave up. To be fair, though, who is going to read an introduction to category theory that isn't familiar with abstract algebra? Someone should write 'an introduction to introductions to category theory'
- c3534l 10y agoMe! I know some abstract algebra, but I'm not going to understand it without some hand-holding. Remind me what a ring is and how and why it relates to categories.
- ky3 10y ago> Someone should write 'an introduction to introductions to category theory' More like the "Prereqs for an Intro to Category Theory." The author intended his remark that the work is "for readers with relatively little mathematical background" to mean that his readers aren't assumed to have previous exposure to category theory, not that they have zero math. He's reiterating the Basic in the title "Basic Category Theory." Category theory is like the refactoring of a lot of math to express commonalities with a view toward recognition and reuse. The Gang-of-Four OOP patterns book would also seem abstract for anyone sans programming experience.
- more_original 10y ago"There exist only two kinds of modern mathematics books: ones which you cannot read beyond the first page and ones which you cannot read beyond the first sentence." -- Chen Ning Yang
- semi-extrinsic 10y agoSince Yang's name is probably not familiar to most HNers, I'll just add that he's a theoretical quantum physicist; Nobel Price in 1957, etc etc.
- mathgenius 10y agoBob Coecke writes good introductions to category theory, you might find some of his stuff enjoyable. Although he is often also introducing quantum physics and linguistics at the same time. This paper is fascinating: https://arxiv.org/abs/1602.07618 https://arxiv.org/abs/1602.07618
- digler999 10y agojargon like "homoporhism, rings, multiplicative identity" are just scary sounding words for simple concepts. Especially this day and age with wikipedia. Now, not to say that proving things about groups and rings is simple. but just because the word has 5 syllables doesn't mean the concept is hard. Whereas certain concepts in calculus - I think - are quite difficult to solve for even simple looking integrals.
- decasteve 10y agoFor 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 10y ago> 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 10y agoThis is generally good advice for all maths study, of course: "mathematics is not a spectator sport".
- Bahamut 10y agoThis 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.
- Smaug123 10y agoI'm in the middle of writing https://arbital.com/p/universal_property_outline/ https://arbital.com/p/universal_property_outline/ which is precisely an Intro to the Universal Property - comments, feedback and assistance welcome, if you care to help :)
- wolfgke 10y ago> 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 10y agoIn 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 10y agoI 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.
- elberto34 10y agoI 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 10y ago"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 10y agoI'd say addition and multiplication are more important than prime numbers, or number theory, for that matter.
- mathgenius 10y agoTom Leinster wrote some things about open sourcing the book here: https://golem.ph.utexas.edu/category/2017/01/basic_category_theory_free_onl.html https://golem.ph.utexas.edu/category/2017/01/basic_category_...
- alexott 10y agoThere "Category Theory in Context" book by Emily Riehl is also freely available at https://golem.ph.utexas.edu/category/2016/11/category_theory_in_context.html https://golem.ph.utexas.edu/category/2016/11/category_theory... (I didn't read it yet)...
- monktastic1 10y agoThe best intro I've ever seen is Bartosz Milewski's video series (intended mostly for coders): https://www.youtube.com/playlist?list=PLbgaMIhjbmEnaH_LTkxLI7FMa2HsnawM_ https://www.youtube.com/playlist?list=PLbgaMIhjbmEnaH_LTkxLI... It assumes almost no prior math knowledge (okay, you should know what sets and functions are...).
- xiphias 10y agoMe too...it's amazing how much I learned from it about creating composable code.
- dualogy 10y agoLooks 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..
- hderms 10y agoI loved his videos, personally. I had some familiarity with basic category theory and functional programming, but Bartosz does a really good job of explaining everything without prior math knowledge. Compared to all the introductory books people recommend, he's an excellent teacher. On the subject of it improving your coding, not so sure how much you could measure that. I think it's usually preferable to have a strong understanding of the basis of what you're working with, however, as it gives you some confidence to think critically about things you would usually just accept as fact.
- jasonm23 10y agoI 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 10y agoLike 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 10y agoThe 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".
- nikofeyn 10y agoyou might enjoy looking at category theory for the sciences by david spivak. there's a hardcover edition, but it's available online as well. [html version] http://category-theory.mitpress.mit.edu http://category-theory.mitpress.mit.edu [old pdf version] http://math.mit.edu/~dspivak/CT4S.pdf http://math.mit.edu/~dspivak/CT4S.pdf
- Smaug123 10y agoThis 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-category-theory/ http://www.logicmatters.net/2017/01/02/tom-leinsters-basic-c...
- syats 10y agoIf 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?
- lmm 10y agoThe big application I'm aware of is structured recursion schemes: http://maartenfokkinga.github.io/utwente/mmf91m.pdf http://maartenfokkinga.github.io/utwente/mmf91m.pdf ( implemented in Haskell by the recursion-schemes library ). Used carefully they allow a very lightweight/concise way of expressing transformations of tree-like structures, which is the essence of compilers (and of a lot of other programming, particularly when you start working in DSLs and regarding everything as a compiler).
- deleted 10y ago[deleted]
- nicolast 10y agoCT concepts and relations between them are used to design (or have influenced) libraries/APIs and even some language features in several programming language communities, especially those using a 'functional' paradigm. Take a look at Haskell, Idris, Scala (with the scalaz library or whichever took over its place today),...
- jordigh 10y agoYeah, 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.
- misja111 10y ago> It seems to just complicate things for very little benefit. It's a pretty abstraction, but I don't see actual results from it. This is a curse which keeps affecting large groups of programmers, to read about some pretty looking abstraction and then wanting to use it everywhere regardless if it is suitable or not. I'm thinking of Design Patterns, CQRS, complex microservice architectures etc.
- primodemus 10y agoMathematical Physics by Robert Geroch was recommended on the haskell subreddit a while ago: 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 https://www.amazon.com/Mathematical-Physics-Chicago-Lectures...
- myxlptlk 10y agoThis 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."
- skocznymroczny 10y agoAfter reading that, will I be able to write a hello world in Haskell?
- Smaug123 10y agoNo. It's not a Haskell book.
- deleted 10y ago[deleted]
- Tom_Leinster 10y agoHi, 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.
- Koshkin 10y agoYet 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.
- harry8 10y agoIf 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.