## book reviews

**An Invitation to Applied Category Theory. Seven Sketches in Compositionality**. By Brendan Fong and David I. Spivak. Cambridge University Press, 2019. Paperback, pp. 348. Price GBP 37.99. ISBN 9781108711821.

^{a}X-Ray Centre, TU Wien, Getreidemarkt 9, Wien, 1060, Austria^{*}Correspondence e-mail: bstoeger@mail.tuwien.ac.at

Keywords: book review; category theory.

Category theory was developed in the second part of the 20th century as a tool to study algebraic structures and their relationships. Being overly abstract, it was originally received with scepticism and semi-jokingly referred to as `abstract nonsense'. Ultimately, however, the categorical approach has proven extremely useful and category theory has successfully conquered many branches of mathematics.

Mathematical crystallography encompasses many topics, such as vector spaces, symmetry groups or graph theory, which lend themselves to being treated in category theoretical terms. However, apart from humble attempts in the context of the order–disorder (OD) theory (Fichtner, 1977), category theory never managed to take hold in the crystallographic community, most likely due to a lack of awareness.

*An Invitation to Applied Category Theory* by B. Fong and D. I. Spivak is an introduction to category theory written for the layperson. In seven `sketches,' the reader is gradually introduced to the mindset of a category theorist, using examples from the real world, such as databases or electrical circuits.

In category theory, there are two aspects to consider: the structures under investigation and the categorical structures themselves. The loop closes itself when category theory is used to analyse category theory! Concerning the former, the book is a roller-coaster ride from order theory via graph theory and algebraic structures to topological spaces and many other topics. Highly abstract notions such as free algebras are presented in a surprisingly accessible way. The more basic notions are discussed with great rigour, whereas `heavy' topics are, naturally and thankfully, treated more superficially. Likewise, the discussed category theoretical constructs cover a wide range from basic categories via diagrams, functors and natural transformations to enriched categories, sheaves and toposes. Again, the more basic, the more rigorous the treatment.

The book is sprinkled with a large number of didactically excellent examples and exercises (with suggested solutions in the appendix), ranging in difficulty from easy to hard. Some exercises are open, allowing for creative solutions. Numerous backreferences and repetitions strengthen the understanding. At the end of each `sketch' advanced reading is suggested. The `real world' examples are, as expected from a mathematics book, at times far-fetched. Their usefulness lies not so much in showing how category theory can deepen our understanding in, for example, chemistry, but rather in demonstrating that categories may behave like, for example, dependency graphs. These abstract concepts are not as scary as they first appear!

The book is not structured like a classical mathematical text. For example, enriched categories are introduced via their properties before the basic concept of category. Therefore, the reader might miss the `big picture', but that is clearly not the goal of the book. What it does surprisingly well though is to demonstrate how to create mathematics by successive abstractions and by ascending to meta-levels, such as categories enriched over themselves.

At some places the text is arguably too idiosyncratic. For example, the composition of functions is written in a left-to-right manner instead of the common right-to-left (`*f* after *g*') manner, with which most readers will be familiar.

There are a few minor inconsistencies, which might trip up the layperson more so than the experienced mathematician. For example, reflexivity is omitted in the context of `connectivity', *i.e.* equivalence relations (p. 3); it might be useful to notationally distinguish the preimage from the inverse of a function (p. 11); *p, q, r* should be *x, y, z* in Definition 4.14 (p. 127); it should read *m*′ + *g*(*i* − *m*) instead of *m*′ + *g*(*i*) in Example 5.2 (p. 149). It appears that in the version under review some exercises were changed or added, without adapting the solutions, notably Ex. 3.83 (solution missing); Ex. 6.22 (sets are upside down); Ex. 7.30 (case 3 is erroneous); Ex. 7.41 (uses *G*′ instead of *H* in the solution); Ex. 7.44 (uses T and ⊥ instead of true and false in the solution).

The final question to answer is who should read the book? For the trained mathematician, the book is probably too `fluffy'. They need no basic introduction to equivalence relations, order theory *etc*. For the working crystallographer, it depends. Many may find the mathematics too much focused on computer science and related topics to offset the work needed to plough through the book. For those, however, who have basic experience in discrete mathematics, who enjoy mathematical thinking and who have ample amounts of time to solve the exercises, the book is highly recommended. It provides a glimpse into a fascinating branch of mathematics and, once hooked, the reader may proceed to the more classical texts to get a fuller and more rigorous picture of the field. The numerous potential applications of category theory to mathematical crystallography will then impose themselves.

### References

Fichtner, K. (1977). *Beitr. Algebra Geom.* **6**, 71–99. Google Scholar

This article is published by the International Union of Crystallography. Prior permission is not required to reproduce short quotations, tables and figures from this article, provided the original authors and source are cited. For more information, click here.