Live data from Hacker News

Applied Category Theory Course

math.ucr.edu

91–100 of 100 posts

Re: Applied Category Theory Course

#91
post #89
post #58

Earlier quoted context omitted.

I understand those concepts well, but I find the casual chain of events questionable, especially when the story is told by category theorists. For example, I was once told by a prominent category theorist that certain aspects of the API design for C++ futures was informed by category theory. When I spoke to the people who actually wrote the RFCs, they said category theory had no part in their thinking. This is what i…

I would appreciate if someone wrote here their opinion on Matriarch [1], an application of category theory to biology/physics via software. [1] https://web.mit.edu/matriarch/

My first approach is to look for references to the project on GitHub. Since this project is not itself on GitHub, next best option is to search the URL for code comments, docs, etc.

https://github.com/search?type=code&q=web.mit.edu%2Fmatriarc...

It has one result, which appears to be someone demonstrating their visualization library using a model from Matriarch as an example.

Would love to hear from users of the software.

Re: Applied Category Theory Course

#92
post #61

Earlier quoted context omitted.

OK, so name a concrete, production system that followed this pattern.

Two that I know of, when I worked there: - Amazon Device Econ modeling platform, for econometrics - Amazon Tax calculation platform, for things like VAT But more broadly, that’s how you develop software: you’re theory building. 1. Develop language and rules in that language. 2. Give them semantic meaning in a diagram and set of example cases. 3. Develop a corresponding type theory for that. 4. Implement that syntheti…

Are you implying that the people who worked on those two platforms had no idea what topos theory is (but they were "applying" it nonetheless)? Or that they explicitly modeled their stuff in topos theory, and that improved upon the former way they had been doing it without topos theory? I don't count the former as an application of CT, but I would count the latter.

References to primary sources would be appreciated, or feel free to email me at mathintersectprogramming@gmail.com with the name or contact information of someone who directly worked on those systems that I could talk to.

Re: Applied Category Theory Course

#93
post #66
post #57

Earlier quoted context omitted.

All "applied category theory" books seem to be like this: they start by talking about how great the applications will be, but then instead of getting to the applications, they never stop developing the category theory for its own sake. A lot of math does similar things, to be fair, but I also don't count those as applied.

So, just to offer a few counterpoints there is Tom Leinster’s work on diversity/entropy [1], where people working in mathematical ecology have been happy with his contributions. I’ve also see the Penn robotics group start to use categorical machinery to nail down concepts like bisimulation of dynamical systems and develop a ‘type theory’ for motion plans that has its semantics in a category of dynamical systems [2].…

And then the difficult part becomes, how could I verify that this is used in practical robotics products? There are a handful of citations to [2], many of which are more category theory. One non-category-theory citation seems to say, "there is this formalization that's still a work in progress, and go read that paper if you're interested", hard to tell as an outsider how much they use it.

Unless I can prove it is used, then it doesn't meet my bar. Maybe it's too new, but that means it still has to prove itself. Good luck to them!

Re: Applied Category Theory Course

#94
post #90

Earlier quoted context omitted.

> ... but I find the casual chain of events questionable ... When I spoke to the people who actually wrote the RFCs, they said category theory had no part in their thinking. I think you missed one level of indirection in my argument. I'm not claiming that language designers employ Category Theory explicitly when designing new language features (although this is indeed the case with Haskell, PureScript, and similar la…

> Often, they refer to programming language tutorials where these mathematical ideas are already implemented, for example, in Python or C++. The difference is that _someone_ is actually implementing the features they're relying on, and those people know the math, understand its importance, and deliberately apply it. I know because I dig through their git commits so I can interview them about their work for my book. Y…

> describes type families as originating from three specific papers, [3], [4], [5], none of which mention category theory (nor does the much longer Haskell Wiki [6]). It seems to suggest, what is obvious to me, that not _all_ features of Haskell are related to category theory.

Since you've mentioned it, one of the inventors of type families is Simon Peyton Jones. He is quite renowned within the Haskell community as he is also a significant contributor to the design of the Haskell language. Now, let's examine what he has to say about Category Theory.

> "I say “surprising” because anything with as exotic a name as “monad” — derived from category theory, one of the most abstract branches of mathematics — is unlikely to be very useful to red-blooded programmers. But one of the joys of functional programming is the way in which apparently exotic theory can have a direct and practical application, and the monadic story is a good example."

https://gist.github.com/dtchepak/3163428

In his own words, "apparently exotic theory [Category Theory] can have a direct and practical application," indicating that you hold a differing view from Simon, fair enough, however I believe that few people on this planet have a deeper understanding of Haskell than he does, which is why I hold his opinion in high regard.

So, what about the other major language designers of Haskell?

Firstly, there's Philip Wadler. For a clearer understanding of his work, you can refer to his presentation titled "Category Theory for the Working Hacker" (https://www.infoq.com/presentations/category-theory-proposit...). The title is quite self-explanatory.

Then there's John Hughes, who is renowned for "Generalising monads to arrows", known as Hughes Arrows. His work has a profound correlation with Category Theory, a fact that John Hughes is fully aware of.

In my view, these examples provide sufficient evidence to affirm that Haskell's language designers are well versed in Category Theory concepts. These concepts, to varying degrees, have informed the design of Haskell. Of course, discussing individual features such as type families can become contentious when determining the extent of Category Theory's influence. For instance, it could be argued that these features are more closely related to Type Theory. However, many argue that Type Theory is the internal language of Category Theory.

> There is a deeper discussion to be had here, along the lines of "does it count as an application of math if none of the people doing the applying think about the math." I think the answer is no

I'd like to introduce you to the topic known as the Curry-Howard-Lambek correspondence, which posits a three-way isomorphism between types in programming languages, propositions in logic, and objects within a Cartesian closed category. You may already be familiar with the term "proofs-as-programs". It's important to note that the type system in Haskell isn't sufficient for theorem proving, but it becomes capable of constructing elementary proofs if you enable features like DataKinds, GADTs, PolyKinds, ScopedTypeVariables, TypeApplications, TypeFamilies, and TypeOperators. In contrast, I've also worked with Coq, which undeniably possesses the strength to prove intriguing theorems. What's particularly notable about Coq is its capacity to output Haskell programs based on its proofs, resulting in a Haskell program that lacks the strong guarantees of Coq. In this sense, you could imagine the resultant Haskell program as a "proof sketch" (which is usually correct if it compiles).

I don't presume that you would refute this isomorphism. However, it's possible that you have again a differing perspective on what isomorphism actually means. To me, it's pretty much equivalence.

Re: Applied Category Theory Course

#95
post #63
post #58

Earlier quoted context omitted.

I understand those concepts well, but I find the casual chain of events questionable, especially when the story is told by category theorists. For example, I was once told by a prominent category theorist that certain aspects of the API design for C++ futures was informed by category theory. When I spoke to the people who actually wrote the RFCs, they said category theory had no part in their thinking. This is what i…

> lenses solve a problem that no other language has Indeed other languages don't have problems dealing with immutable collections since almost none have good immutable collections. All I can say is that, when working with other languages, I wish they did have that problem! > most Haskell programs seem to me to be completely unreadable by anyone except the author Interesting. That's the opposite of my experience. Hask…

Even where they lack the problem I find myself wanting lenses (or other optics) every couple months at a minimum.

Re: Applied Category Theory Course

#96
post #90

Earlier quoted context omitted.

> Often, they refer to programming language tutorials where these mathematical ideas are already implemented, for example, in Python or C++. The difference is that _someone_ is actually implementing the features they're relying on, and those people know the math, understand its importance, and deliberately apply it. I know because I dig through their git commits so I can interview them about their work for my book. Y…

> describes type families as originating from three specific papers, [3], [4], [5], none of which mention category theory (nor does the much longer Haskell Wiki [6]). It seems to suggest, what is obvious to me, that not _all_ features of Haskell are related to category theory. Since you've mentioned it, one of the inventors of type families is Simon Peyton Jones. He is quite renowned within the Haskell community as h…

I'm aware the Haskell designers like category theory, and so yes, the question boils down to the degree of influence of category theory on particular language features.

Still, to your last point, the existence of an equivalence doesn't automatically count as an application of all sides of the equivalence. Coming up with a post-hoc math explanation for some practical idea doesn't make the practical idea an application of the math. The practitioners have to adopt that framing or rely on theorems proved via the math that they didn't otherwise rely on. It would be like saying that all mathematical theorems are an "application" of the typed lambda calculus because of the Curry–Howard correspondence. It's a disingenuous and fruitless way to think about what it means to apply an idea to solve a problem.

Automated theorem verification may use category theory (does it?), and I'd love to talk to the main contributors to Lean, which appears to be the system that's gaining the most traction among average mathematicians, to discuss that.

Re: Applied Category Theory Course

#97
post #96

Earlier quoted context omitted.

> describes type families as originating from three specific papers, [3], [4], [5], none of which mention category theory (nor does the much longer Haskell Wiki [6]). It seems to suggest, what is obvious to me, that not _all_ features of Haskell are related to category theory. Since you've mentioned it, one of the inventors of type families is Simon Peyton Jones. He is quite renowned within the Haskell community as h…

I'm aware the Haskell designers like category theory, and so yes, the question boils down to the degree of influence of category theory on particular language features. Still, to your last point, the existence of an equivalence doesn't automatically count as an application of all sides of the equivalence. Coming up with a post-hoc math explanation for some practical idea doesn't make the practical idea an application…

> I'm aware the Haskell designers like category theory, and so yes, the question boils down to the degree of influence of category theory on particular language features.

So, if only a segment of Haskell's language design is based on Category Theory (CT), and only a fraction of popular programming languages are based on Haskell, then this percentage, possibly in the single digits for a given mainstream language, is too minor for you to consider it a valid application of CT. That's a valid perspective; I'll leave it at that.

> Still, to your last point, the existence of an equivalence doesn't automatically count as an application of all sides of the equivalence. ... The practitioners have to adopt that framing or rely on theorems proved via the math ...

I really don't agree with your definition of application. If I have an equivalence between three different concepts - types, propositions, and objects within CCC, then, in my viewpoint, you don't need to explicitly consider your application of a concept in the other two fields for it to be recognized as an application. To me, that's akin to saying that you can only do math in a certain way, exactly how mathematicians portray it in their textbooks. If you don't know that because you learned math more indirectly, like from programming blogs with code snippets that encapsulate the same definitions, then, according to that view, you won't be doing applied math.

To me, it simply boils down to a different perspective on the term application, one that isn't specifically about CT.

> Automated theorem verification may use category theory (does it?), and I'd love to talk to the main contributors to Lean

I have listen to some podcasts with the main contributors and creators of Lean. Lean is based on (Lean's kernel) homotopy type theory (a flavor of type theory – specifically of intensional dependent type theory).

> most traction among average mathematicians

Yes. Many math graduate students are using Lean to apply concepts from textbook math, such as HoTT, which has a strong connection to Category Theory. Basically, you can't read the HoTT book without knowing CT, and can then apply it in Lean. I think this would even satisfy your definition of applied math.

Re: Applied Category Theory Course

#98

Earlier quoted context omitted.

here you go: https://arxiv.org/pdf/1009.1166.pdf

This paper is actually interesting and talks about real-world schemas. I particularly like the concept of distinguishable nulls that define a sane equality operator, unlike the traditional SQL NULL. The paper I was referring to used the category Poly, and literally just stated that Poly could be used for database migrations without elaborating further.

That might be a case of the author be really used to a certain crowd and writing for them. The work by Spivak on databases is well-known in ACT so the connection comes pretty easily. Also, in fairness, is pretty easy to Google your way around that claim.

Re: Applied Category Theory Course

#99
post #11

I'm writing a book [1] about "bona fide" applications of mathematics to practical programming problems, where bona fide is my own personal definition [2]. I've had my eye on claims of applications of category theory for many years, and none of them have quite fit the bill (sorry, John, if you're reading this). When they talk about applications to databases it seems quite unrealistic or lacking in sufficient detail to…

You might want to check the most recent work on epidemiogical modeling. Baez blogs extensively about it.

Re: Applied Category Theory Course

#100
post #93
post #66

Earlier quoted context omitted.

So, just to offer a few counterpoints there is Tom Leinster’s work on diversity/entropy [1], where people working in mathematical ecology have been happy with his contributions. I’ve also see the Penn robotics group start to use categorical machinery to nail down concepts like bisimulation of dynamical systems and develop a ‘type theory’ for motion plans that has its semantics in a category of dynamical systems [2].…

And then the difficult part becomes, how could I verify that this is used in practical robotics products? There are a handful of citations to [2], many of which are more category theory. One non-category-theory citation seems to say, "there is this formalization that's still a work in progress, and go read that paper if you're interested", hard to tell as an outsider how much they use it. Unless I can prove it is use…

I would say that at that point you’re probably just digging in your heels - that’s a major group that does serious work.

You can also look at Aaron Ames’s PhD thesis and how that work in hybrid dynamical systems, driven by category theory, has shaped his current output (which is 20-50 papers/year as a full professor at CalTech).

Post reply on HN