Dragging Proofs Out of Pictures
String diagrams provide category theory with a different and very distinctive visual flavour. We demonstrate that they are an effective tool for equational reasoning using a variety of examples evolving around the composition of monads. A deductive approach is followed, discovering necessary concepts as we go along. In particular, we show that the Yang–Baxter equation arises naturally when composing three monads. We are also concerned with the pragmatics of string diagrams. Diagrams are carefully arranged to provide geometric intution for the proof steps being followed. We introduce thick wires to distinguish composite functors and suggest a two-dimensional analogue of parenthesis to partition diagrams.
KeywordsNatural Transformation Proof Obligation Baxter Equation Proof Step Triangular Number
The authors are very grateful to Tarmo Uustalu for bringing compatible compositions and iterated distributive laws to their attention. We would also like to thank the two anonymous reviewers for their helpful comments and feedback. This work has been partially funded by EPSRC grant numbers EP/J010995/1, EP/I03808X/1 and AFSOR grant “Algorithmic and Logical Aspects when Composing Meanings”. The main part of the work was done while the first author was affiliated with the University of Oxford.
- Cheng, E.: Iterated distributive laws. ArXiv e-prints, October 2007Google Scholar
- Hinze, R., Marsden, D.: Equational reasoning with lollipops, forks, cups, caps, snakes, and speedometers. José Oliveira Festschrift (2015, to appear)Google Scholar
- Marsden, D.: Category theory using string diagrams (2014). arXiv preprint arXiv:1401.7220
- Penrose, R.: Applications of negative dimensional tensors. In: Welsh, D.J.A. (ed.) Combinatorial Mathematics and its Applications, pp. 221–244. Academic Press, New York (1971)Google Scholar
- Peyton Jones, S.L., Wadler, P.: Imperative functional programming. In: Proceedings of the 20th Annual ACM Symposium on Principles of Programming Languages, pp. 71–84, Charleston, South Carolina, January 1993Google Scholar
- Wadler, P.: Comprehending monads. In: Proceedings of the 1990 ACM Conference on LISP and Functional Programming, Nice, pp. 61–78. ACM Press, June 1990Google Scholar
- Wadler, P.: The essence of functional programming. In: Proceedings of the 19th Annual ACM Symposium on Principles of Programming Languages, Sante Fe, New Mexico, pp. 1–14, January 1992Google Scholar