# How is category theory applied in linguistics?

I am learning monoidal category applied in quantum information and quantum field theory, and several references say that monoidal category is somehow related to linguistics via Hopf algebra of quantum groups. Can someone illustrate more on this connection?

Also, is there other applications of category theory (either abstract or concrete) in linguistics besides monoidal category? In my another question, lemontree mentioned abstract category in formal representations.

• Parsers can be implemented through monads, which are category-theoretic concepts. You might want to read a few texts on parser combinators to get an understanding of how it works and what the underlying concepts are. Commented Jul 16, 2016 at 23:14

Here's a short and perhaps inadequate answer: the correspondence is briefly but clearly sketched in the wikipedia article "pregroup grammar". The simplest pop-sci reference I know of is an article from Bob Coecke, in New Scientist. If you stare at the diagram that appears in that article, you will notice it has a very striking resemblance to the link-grammar diagrams in the original link-grammar papers; and indeed, those authors mumble something about category theory in multiple publications. Once you see this, a light-bulb should go off: the types of type theory (see chapter 1-2 of the HoTT book) are more-or-less exactly the same thing as the link-types of link grammar, which are more-or-less the same things that the type constructors are constructing in the Lambek calculus and the categorial grammars.

To be clear: type theory can be understood as category theory viewed from the side: the types are the types of morphisms; so e.g. simply-typed lambda calculus is the internal language of cartesian-closed categories; in this example, there is only one type. For the more general monoidal case, you have more types, which tell you when and how to form tensor products in the monoidal categories, and dually, when you can "contract indexes" (link them together with links).

The relationship to Hopf algebras is "shallow". So, for example, if you have an ordinary Hilbert space, you can form arbitrary tensors, but there is only one single type of index on those tensors, which you can contract freely. That is, if you have a single Hilbert space, you can form a "tensor algebra" (see wikipedia), and the tensor algebra has a natural Hopf algebra structure. It sounds "deep" but it isn't: it's just saying, in a fancy, rigorous way, that you can form arbitrary tensors and make arbitrary contractions.

In linguistics, the fun starts when you realize that you can have multiple kinds of indexes which can be tensored and contracted. Each distinct "connector" belongs to it's own Hopf algebra; the part that is interesting is that words can have multiple different kinds of connectors - e.g. a verb can connect to a subject and an object but cannot in general connect to some other verb.

This generalizes further to graphs -- instead of thinking of a graph as a set of vertexes and a set of edges connecting them, instead think of a graph as a set of vertexes (e.g. "words") and a set of connectors on each vertex: a connector is "half of an edge", and its type tells you what other connectors (half-edges) it can connect to. Edge types are then connector types. With this picture, you can view e.g. the English language as a sheaf, a la "sheaf theory", where each dictionary word is festooned with connectors that can connect to other words. Then, word-phrases, colocations, "institutional expressions", idioms, etc. are then sections of a sheaf, and obey the usual axioms of sheaf theory. The lexis of natural language obeys the axioms of algebraic topology. So that's kind of neat. Abstract, and fun, but I'm not sure its useful or deep.

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

https://homotopytypetheory.org/book/