This post is copied (with some small modifications and additional comments) from section 0.4 of my Ph.D. thesis, Towards compositional game theory. It is loosely based on a talk I gave at Logic for Social Behaviour 2016 in Zürich.
The term compositionality is commonplace in computer science, but is not well-known in other subjects. Compositionality is the principle that a system should be designed by composing together smaller subsystems, and reasoning about the system should be done recursively on its structure. When I thought more deeply, however, I realised that there is more to this principle than first meets the eye, and even a computer scientist may not be aware of its nuances.