[ 3 / biz / cgl / ck / diy / fa / ic / jp / lit / sci / vr / vt ] [ index / top / reports ] [ become a patron ] [ status ]
2023-11: Warosu is now out of extended maintenance.

/sci/ - Science & Math


View post   

File: 29 KB, 1200x1200, 1200px-Commutative_diagram_for_morphism.svg.png [View same] [iqdb] [saucenao] [google]
10051526 No.10051526 [Reply] [Original]

So I've recently heard about "Category Theory" in functional programming.

Apparently it ties together very deeply with abstract algebra. I've looked into it a little bit and found that there's all these mathematical terms like Monad, Monoid, Functor, Endofunctor, Homology and whatnot.

But YouTube videos only get you so far, so here's the question: What is a good book to read about this topic(s)? Abstract Algebra, Category Theory and how they tie in with Functional Programming. Any suggestions?

>> No.10051594

Borceux's handbook of categorical algebra is a good place to start as well as one of the most complete longass intros to category theory. Reading the first chapters of volume 1 should be nice if you're interested in pure category theory.

Aluffi's "Algebra--Chapter 0" is a more practical alternative. It covers most introductory topics in abstract algebra (from simple group/ring/fields theory and linear algebra to homology) with a categorical mindset, introducing only the relevant categorical notions when necessary and showing plenty of examples.

>> No.10051829

Category theory is fucking bullshit and absolutely god awful. I can't believe anyone would ever willingly explore it.
Literally masturbating all over a bunch of stupid fucking diagrams.

>> No.10051894

>>10051829
It's one of the most important fields of epistemology and mathematics out there right now

>> No.10051982

>>10051894
>epistemology
lol wtf is that

>> No.10052024

>>10051982
the study of what separates valid belief, from opinion.

>> No.10052037

>>10051526
Functional programming is useless

>> No.10052050

>>10051594
Thanks for making the only post actually suggesting resources. Will look into the ones mentioned by you!

>>10051829
Nice opinion bro

>>10051982
Brainlet

>>10052037
Not really

>> No.10052054

>>10052024
So what are some major results in the field of epistemology? (not being sarcastic, I'm genuinely interested)

>> No.10052230

>>10052050
>I replied to everyone
>Somehow, my idiotic opinions are still valid
You're probably not gonna make it too far
Category theory isn't real math though, so I'm sure you'll be fine learning that.

>> No.10052236

>>10052230
So what's an example of "real math"?

>> No.10052242

>>10052236
topology
pure dynamical systems
algebraic geometry (category theory is a tool for this, yes. but while i respect algebraic geometers i am not one myself)
analysis of any type besides numerical
differential geometry
logic, model theory, recursion theory
the only non-math fields are "pure algebra" and "number theory"
"category theory" is a subset of "pure algebra" and as such is not real math.

>> No.10052253

>>10052242
Lmao. Why is number theory not math? You sound like a larper

>> No.10052268

>>10052253
number theory is playing with toys and pretending it's important
it's recreational math at best, which is kids math and not real math
algebraic number theorists are hopeless (this goes without saying)
analytic number theorists would be ok if their entire field didn't revolve around slapping unenlightening asymptotics onto worthless sequences of integers
assuming you're op, you've never even seen any category theory before. any yet you think i'm a larper? i've done enough of any type of math you'd be able to name to know what's respectable and what belongs on >>>/toy/

>> No.10052275

>>10052268
I'm not OP though. If number theory is recreational math, why is topology not as well?

>> No.10052302

>>10052275
because topology is serious and has a variety of pure uses
algebraic topology between homotopy and homology, dynamical systems/odes/pdes, differential geometry and topology, analysis in all its forms, measure theory, operator theory, even certain fields of algebra
what's number theory good for? combinatorics?
it's a dead end that only autists pursue.

>> No.10052745

>>10051526
Standard Functional programming comes from simple or early versions type theory, category theory use is minimum, but Category theory become base for modern type theory.

https://github.com/jozefg/learn-tt

ML(SML,Ocaml,F#) and Haskell comes from type theory and Calculus of Constructions and Lisp from lambda calculus.

Read this book if you want learn ML or haskell language
https://www.cs.kent.ac.uk/people/staff/sjt/TTFP/
http://www.cs.cmu.edu/~rwh/pfpl.html

This book easiest category theory.
http://math.mit.edu/~dspivak/CT4S.pdf

This book begin Category theory in Type theory best summary.
https://www.elsevier.com/books/categorical-logic-and-type-theory/jacobs/978-0-444-50170-7

>> No.10053088

Another good resource for FP & CT is "category theory for programmers"

>> No.10053183

>>10052745
>>10053088
please stop spoonfeeding the algebratards

>> No.10053212 [DELETED] 
File: 26 KB, 761x334, finecosmos3.png [View same] [iqdb] [saucenao] [google]
10053212

The General Relevance of the Modified Cosmological Model
http://www.vixra.org/abs/1712.0598

>> No.10053246

>>10052054
Unironically nothing. It's an offshoot of philosophy's school of "u can't no nuffin".

>> No.10053604

>>10052037
>Self-contained code is useless

>> No.10053633

>>10053212
No, dumbass, as everything you do it's wrong. Except for n=1 [math] [U(1)]^n \cong [S^1]^n \cong T^n \ncong S^n[/math]

>> No.10053699
File: 191 KB, 1761x690, 1522603141554.jpg [View same] [iqdb] [saucenao] [google]
10053699

>>10051526

>> No.10053712

>>10053699
Simmons is great alongside a more in depth book. It gives you good motivations and intuition about how it works that most other books skip.

>> No.10053720

>>10052302
>pseudophysics wingding manipulation is real math
>numbers aren't

>> No.10053724

>>10053712
yeah Simmons is the most pedagogical

>> No.10053746

>>10052242
>algebraic geometry is real math but algebraic number theory isn't
I've seen a lot of "not real math" trolls with varying definitions of "math," but at least they're consistent.

>> No.10053796

>>10052242
what is "pure algebra" ?

>> No.10053814

>>10052054
This:

https://en.wikipedia.org/wiki/Gettier_problem

This is the single most important problem the field has faced in millennia.

>> No.10053815

>>10053814
its literally retarded self contained verbal games and had no use for anyone doing scientific work.

>> No.10053821
File: 133 KB, 780x1172, cassel3.jpg [View same] [iqdb] [saucenao] [google]
10053821

I'm not the greatest fan of the man as such, but Bartosz Milewski has finished his 'Category Theory for Programmers' which might be suited for many peoples applications. Otherwise I also think Simmons is the simplest way in

https://github.com/hmemcpy/milewski-ctfp-pdf

>> No.10055367

>>10052302
Encryption
Error Prevention

>> No.10055396

>>10053796
Algebra which isn't applied to geometric/topological objects (ring theory, group theory, category theory, combinatorics, etc.)
>>10053720
>>10053746
Talk about embarrassing. Look at the angry numbertards coming out of the woodwork. Oh no, I'm so scared! They might throw some modular forms at me!
P-please dont put a group structure on my elliptic curve! Think of the children!!!
Hahaha, pathetic.

>> No.10055493

>>10053821
>Using software versioning for a book
This pisses me off more than it should probably. Thanks for the link anyway I'll take a look at it.

>> No.10055505
File: 6 KB, 292x133, okthisisepic2.png [View same] [iqdb] [saucenao] [google]
10055505

>> No.10055511

>>10052037
Functional programming is literally programmers who think recursion could solve everything.

>> No.10055512

>>10055511
fractals are beautiful anon

>> No.10055539

>>10055511
>Functional programming is literally computer scientifics who think recursion could solve everything.

Average programmer don't know recursion outside trivial examples.

>> No.10057390

>>10055539
Recursion is a meme anyways. Every recursive algorithm has an iterative equivalent and viceversa.

>> No.10057488

>>10055396
>His face when he realizes that the only difference between algebraic number theory and algebraic geometry is putting the prime ideals of a ring into a set and giving it a topology.
I'd love to hear your opinion on arithmetic geometry lmao

>> No.10057500

>>10053246
imagine being this much of a stemlet

>> No.10057590

>>10057488
I haven't really looked much into arithmetic geometry, but everything I've heard makes me think I wouldn't like it very much. Whole lotta elliptic curves and shit, right?
I'm very open to learning more about the geometric parts of algebra/number theory, but I don't think I'll ever respect it in the way I do analytic fields.

>> No.10057684

>>10055511
Is recursion really the only control flow available in functional programming? That sounds pretty masochistic.

>> No.10057688

jules is that you?

>> No.10057716

>>10057684
no. if statements etc exist

functional programing just means "functions are first class citizens" and "if the inputs to a function are the same, the outputs will be the same"

>> No.10057801

>>10057684
Even in languages where other constructs are available, you typically don't write loops in functional code. For most things you can just use some sort of filter/map/reduce. One of the advantages of functional programming is that it doesn't matter what order code gets executed in, so it's very easy to make things parallel, and in my opinion map/reduce/filter-type things tend be clearer than loops anyway (provided your language has good syntax for such things).

>> No.10058839

>>10051594
>Aluffi's "Algebra--Chapter 0" is a more practical alternative. It covers most introductory topics in abstract algebra (from simple group/ring/fields theory and linear algebra to homology) with a categorical mindset, introducing only the relevant categorical notions when necessary and showing plenty of examples.
Don't listen to this retard. That book is shit. It uses algebra as an intro to category theory and not category theory as an intro to algebra, as it should be.

Watch Ed Morehouse's lectures here.
https://www.cs.uoregon.edu/research/summerschool/summer16/curriculum.php
They're a crash course aimed at comp sci students. Accompany them with Awodey's Category Theory book which is also aimed at comp sci students. If you want to take it further then read up on type theory.

Don't waste too much time on Algebra. Most of it is useless to you aside from basic group theory stuff.

>> No.10058840

>>10052242
>Thinks category theory is a subset of algebra
lmao, get a load of this undergrad/early grad retard.

>> No.10058849
File: 130 KB, 1000x759, HoTT girl.jpg [View same] [iqdb] [saucenao] [google]
10058849

>>10055493
It's not that uncommon. The HoTT book does it too and when you buy a paperback copy it includes the hash of the last commit.

>> No.10059342

>>10053821
>>10055493
I read a few chapters and this is probably one of the worst books I've ever read. The guy just goes on stupid tangents and uses bad analogies. He writes the book as if you've never programmed before and its tilte is '... for programmers'

>> No.10059374

>>10051526
Read Category Theory, Second Edition by Steve Awodey
Lectures for it here: https://www.youtube.com/playlist?list=PLGCr8P_YncjVjwAxrifKgcQYtbZ3zuPlb or if you want better quality here: http://www.cs.uoregon.edu/research/summerschool/summer12/curriculum.html

To see how it ties in to functional programming, read Martin-Löf's papers, like his dependent type theory papers. Basically the idea is to do proofs using types, proving that two things are equivalent using all the benefits of classical math at a higher abstraction where category theory has the same properties. This is all math constructivist stuff, so Wildberger/Robert Harper/Poincaire mathematics.

>> No.10059389

>>10055493
why? its a lot better than issuing a new version once a year for $240 or having a website with all sorts of errata
software versioning is really text versioning which is exactly what textbooks do

>> No.10059397

>>10059374
>Wildberger
no
>>10058840
he's correct

>> No.10059403

>>10059397
>Wildberger
Is the literal definition of constructivist mathematics philosophy in his ranting against the uncritical embrace of 20th century set theory and 'axioms of infinity'.

>> No.10059412

>>10059403
Wildberger is to constructivists as Trump is to conservatives.

>> No.10059633

>>10058840
And you're in high school, aren't you?
Algebra is the study of generalized structures. Categories are a generalized structure.
So are topological spaces, but we study those analytically, so they're ok despite being inherently algebraic.

>> No.10060182

>>10059633
Categories do capture structure, in a sense but that is just a feature of category theory. In truth the theory is much richer than that and algebraists only use a small portion of it. Moreover, only some topologies are studied algebraically. There are many applications of topology to other areas where the interesting features have little or nothing to do with analysis (eg. topological models for modal logic).

>>10059397
Hillariously inept.

>>10059412
Not wrong but Trump is still widely regarded as a conservative.

>> No.10060899

>>10060182
This is a good post. Thank you anon.
>topology + logic
What the fuck

>> No.10060985
File: 48 KB, 1126x615, KKK.jpg [View same] [iqdb] [saucenao] [google]
10060985

>>10055396
Have a one of these, algebralet.

>> No.10061295

>>10058839
>That book is shit. It uses algebra as an intro to category theory and not category theory as an intro to algebra, as it should be.
This is stupid. It's like saying kids can't learn arithmetic because they don't know enough set theory and first order logic to define numbers.

>They're a crash course aimed at comp sci students
And that's why they're shit. Learn the actual thing and then learn the applications.

>> No.10061304

>>10060182
>Categories do capture structure, in a sense but that is just a feature of category theory
I think anon meant that categories are usually defined as a kind of algebraic structure, which is true.

>>10060899
>topology + data analisis
>topology on the set of ideals of a ring
>changing the topology of real vector spaces to make determinate sequences converging or determinate functions continuous
>changing topologies on vector spaces in a way that all closed sets are algebraic manifolds and vice versa
Wow. Mind-blowing.

>> No.10061333

>>10061304
>>topology on the set of ideals of a ring
lol what is the point of that

>> No.10061377

>>10061295
The issue is that Algebra is best understood through Category Theory. That book tries to teach Algebra and Category Theory at the same time and as a result is overly verbose, at times weirdly informal, and just overall badly structured. It's better to
>Learn algebra first and then see how it's formalized over category theory after learning category theory
>Learn category theory and use it to learn Algebra (through a book that assumes category theory background and teaches algebra).

The crash course covers all the major topics in category theory. It just focuses on categorical logic, type theory, and programming instead of covering the full breadth of category theory applications.

>> No.10061535

>>10061333
It's called Zarisky Topology. The Z. topology over the the ring of polinomials R[X1,...,Xn] is awfully similar to the affine space Rn equipped with the "closed sets=algebraic varieties" topology (also called Zarisky topology), so Zarisky topologies are used for a more general approach to algebraic geometry.

>> No.10061705
File: 17 KB, 400x291, photoNormal.jpg [View same] [iqdb] [saucenao] [google]
10061705

>>10061333
Over R^2,
the polynomial
p(X,Y) := (X-3)^2 + (Y-7)^2
is zero exactly when (X,Y)=(3,7)

The polynomial
q(X,Y) := (X+5)^24 + (Y-4)^6
is zero exactly when (X,Y)=(-5,4). So does
r(X,Y) := (X+5)^4 + (Y-4)^70

All set of polynomials which share a zero can be viewed as a point in space.

But other sub-spaces (subsets) of that space can also be represented by polynomials. E.g.
c(X,Y) := X^2 + Y^2
is zero for all (X,Y) on a circle of radius 1.

And
k(X,Y) := c(X,Y) * r(X,Y) * p(X,Y)
is zero when (X,Y) is either on that circle or the point (3,7) or the point (-5,4). You replaced the union of subspaces with mutliplication.

You can imagine how you can go from there doing... algebraic geometry.

And the prime/maximal ideals (specia polynomials holding zeros) are the points in this description.

>> No.10061709

I meant to write

c(X,Y) := X^2 + Y^2 - 1

>> No.10062927

give me rundown on F_1

>> No.10063383

>>10051829
you are a retard

>> No.10063456
File: 1.44 MB, 263x229, rundown on f1.gif [View same] [iqdb] [saucenao] [google]
10063456

>>10062927

>> No.10064806

>>10062927
could be used to solve the Riemann hypothesis. see Baez's TWF explanations + "F_1 for Everyone"

>> No.10065128

>>10051526
Try reading Hungerford

>> No.10065208

You autists realise Hoare Triples form a category right?