Live data from Hacker News

Basic Category Theory

arxiv.org

81–90 of 92 posts

Re: Basic Category Theory

#81
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.

Re: Basic Category Theory

#83
post #52

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?

The short answer is category theoretic monads. Once upon a time, Eugenio Moggi realized that monads could be used as the formal basis for assembling sequential actions. For example, when you write

    print("hello ");
    print("world")
you expect the output to be "hello world" and not "worldhello " or something weirder. Moggi realized that the semicolon there was a monadic operation that arranged for the two outputs to be printed sequentially.

That might seem like a small thing, but it isn't. In theory, so far as I understand, specifically in denotational semantics, the next best alternative is continuation passing, which adds an extra parameter and return value to the actions and is generally awkward.

The big advantage, though, is practically, in lazy programming languages like Haskell. In that case, the alternative was world passing, where the entire (metaphorical) universe is passed to the action to allow normal parameter passing conventions to sequentially associate the actions. (In contrast, monadic IO does the same thing, but hides the world in the definition of the monad.) The result is sequential code that we all know and love.

Then it was discovered that other bases than the (metaphorical) IO world made for meaningful, useful monads: the maybe monad aborts a computation on the first error, for example. And other data structures like lists...well, go look for a paper with a title like "turn your failures into a list of successes" and we were off and running.

[Edit]

And I'm thinking of the wrong Wadler paper. Try some of the ones from here [1], starting at the bottom.

[1] http://homepages.inf.ed.ac.uk/wadler/topics/monads.html

Re: Basic Category Theory

#84
post #50

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... It assumes almost no prior math knowledge (okay, you should know what sets and functions are...).

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/p…

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.

Re: Basic Category Theory

#85
post #70

Earlier quoted context omitted.

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 w…

> 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 (de…

> 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.

Re: Basic Category Theory

#86

Earlier quoted context omitted.

I 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'

"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

Since 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.

Re: Basic Category Theory

#87
post #68

Earlier quoted context omitted.

Have you never used a functional language?

Yes. I don't think knowing about category theory makes you more proficient in using or designing functional languages either. Lambda calculus has much more obvious utility. Even things similar to monads can be described more simply without abstract nonsense: state is just another variable that you are passing along in your functions. The best books on Haskell do not dwell on category theory. There's actually a bit of…

I assume the functional language you used was a Lisp or something not statically typed?

Re: Basic Category Theory

#88
post #50

Earlier quoted context omitted.

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/p…

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.

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

Re: Basic Category Theory

#89

I enjoy "Make Category Theory Intuitive!" (2007), by Jocelyn Ireson-Paine http://www.j-paine.org/make_category_theory_intuitive.html

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).

you 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

[old pdf version] http://math.mit.edu/~dspivak/CT4S.pdf

Re: Basic Category Theory

#90
post #68

Earlier quoted context omitted.

Have you never used a functional language?

Yes. I don't think knowing about category theory makes you more proficient in using or designing functional languages either. Lambda calculus has much more obvious utility. Even things similar to monads can be described more simply without abstract nonsense: state is just another variable that you are passing along in your functions. The best books on Haskell do not dwell on category theory. There's actually a bit of…

Category Theory is to mathematics approximately what Urbit is to computing.
Post reply on HN