**Categories in linguistics**

Now students in the Applied Category Theory class are reading about categories applied to linguistics. Read the blog article here for more:

https://tinyurl.com/baez-linguistics

This was written by my grad student Jade Master along with Cory Griffith, an undergrad at Stanford.

What's the basic idea? I don't know much about this, but I can say a bit.

Since category theory is great for understanding the semantics of programming languages, it makes sense to try it for human languages, even though they're much harder. The first serious attempt I know was by Jim Lambek, who introduced

**pregroup grammars**in 1958:

• Joachim Lambek, The mathematics of sentence structure,

*Amer. Math. Monthly*

**65**, 154–170 (1958). Available at http://lecomte.al.free.fr/ressources/PARIS8_LSL/Lambek.pdf

In this article he hid the connection to category theory. But when you start diagramming sentences or phrases using his grammar, as below, you get planar string diagrams. So it's not surprising - if you're in the know - that he's secretly using monoidal categories where every object has a right dual and, separately, a left dual.

This fact is just barely mentioned in the Wikipedia article:

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

but it's explained in more detail here:

• A. Preller and J. Lambek, Free compact 2-categories,

*Mathematical Structures in Computer Science*

**17**(2005), 309-340. Available at https://pdfs.semanticscholar.org/9785/d43e34b8111f858ac14246dadd9c09a446ba.pdf

This stuff is hugely fun, so I'm wondering why I never looked into it before! When I talked to Lambek, who is sadly no longer with us, it was mainly about his theories relating particle physics to quaternions.

Recently Mehrnoosh Sadrzadeh and Bob Coecke have taken up Lambek's ideas, relating them to the category of finite-dimensional vector spaces. Choosing a monoidal functor from a pregroup grammar to this category allows one to study linguistics using linear algebra! This simplifies things, perhaps a bit too much - but it makes it easy to do massive computations, which is very popular in this age of "big data" and machine learning.

It also sets up a weird analogy between linguistics and quantum mechanics, which I'm a bit suspicious of. While the category of finite-dimensional vector spaces with its usual tensor product is monoidal, and has duals, it's symmetric, so the difference between writing a word to the left of another and writing it to the right of another gets washed out! I think instead of using vector spaces one should use modules of some non-cocommutative Hopf algebra, or something like that. Hmm... I should talk to those folks.

View 37 previous comments

- I have an embarrassingly simple question. I see that peopl e have been using category theory and Universal Algebra in all sorts of different ways for languages. But I'm a little confused on the concept of an "algebraic category" and [quasi-]varieties. For instance, I can see how quantales or even (partially) ordered {semigroups,monoids,groups} can be made over as categories. But are they all "algebraic categories" and "quasi-varieties" too? In the last case, with what signatures/equations?31w
- +Lydia Marie Williamson "Just" a difference of kind?

Last time I looked, differences of kind were the big ones... as compared to differences of degree.

True and False, that's a difference of degree (in human brains, considering the likely impossibility of true boolean values in a biological neural network).

Differences of kind are all greater than that, like "the Sun vs a watermelon" or "Arithmetic vs a hammerhead shark".31w - +Lydia Marie Williamson - it's easy to get confused about algebraic categories because several different, truly inequivalent definitions of "algebraic category" are in use. They're all discussed here:

ncatlab.org - ncatlab.org/nlab/show/algebraic+category

The definitions of "algebraic category" are somewhat abstract, but they're justified by these theorems:

A concrete category is bounded monadic if and only if it is equationally presentable (presented by a variety) with a small set of operations (and hence equations).

A concrete category is bounded algebraic if and only if it is presented by a quasivariety with a small set of operations.

A concrete category is finitary monadic if and only if it is the category of algebras for some finitary variety; that is, we have only a small set of finitary operations.

A concrete category is finitary algebraic if and only if it is the category of algebras for some finitary quasivariety.

If you are interested in quasivarieties, you want one of the last two kinds of "algebraic categories".

Note that groups, rings, and other structures defined by purely equational laws are much better than quasivarieties - they're varieties! I would only move into studying quasivarieties after understanding varieties quite well. (Maybe you do.)31w - +John Baez Is there a standard way to turn ordered algebras into [quasi-]varieties ... other than adding in a boolean sort? I can sort of see how a quantale could be presented by equational Horn clauses; but with a really large signature and a lot of clauses! How about the category of ordered {semigroup,group,monoid}s? Adding T and F and turning the partial ordering relation into a T-F valued function seems like the easy way out; as opposed to something that's self-contained and single-sorted.31w
- +Lydia Marie Williamson - Sadly, I've never thought about quasivarieties of ordered structures. I probably should.
*Adding T and F and turning the partial ordering relation into a T-F valued function seems like the easy way out.*

I would be perfectly happy to add a boolean sort to do this. Easy ways out are good! I like multisorted theories (of various kinds, I've mainly thought about multisorted Lawvere theories, which are less general than what we're talking about).

Do partially ordered sets form a quasivariety if we allow a boolean sort? Can we do in a one-sorted way? - I doubt it, but it would be fun to prove that. To prove it, use some classic theorems about single-sorted quasivarieties, and show their conclusions don't hold for partially ordered sets. I think I see a possible way to do this....31w - +John Baez Interesting. I never thought about a no-go proof! But I can see how to make it work with quantales with one sort; though I'm a little queasy about throwing in a proper class worth of sup operators of every cardinal degree!31w
- +Lydia Marie Williamson - all 4 kinds of algebraic category I listed above (bounded algebraic, bounded monadic, finitary algebraic, finitary monadic) only allow a
*set*(aka "small set") of operations. Thus, they don't allow a proper class of sup operators, one with each cardinal as its arity.

I believe the reason for avoiding this is not out of general queasiness with proper classes, but because some theorems don't work, or at least not so generally.

For example when you're trying to construct the "free" algebraic gadget of some sort on a set, it will usually no longer be a set if your gadget has a proper class of operations.

Thus, you won't get a monad on Set sending each set to the underlying set of the free algebraic gadget on that set. And that's bad, because in the categorical approach to universal algebra this sort of monad plays an important role.31w

Add a comment...