# Commutative Diagrams Explained

/Have you ever come across the words "commutative diagram" before? Perhaps you've read or heard someone utter a sentence that went something like

"For every [bla bla] there exists

a [yadda yadda] such that**the following diagram commutes."**

and perhaps it left you wondering what it all meant. I was certainly mystified when I first came across a commutative diagram. And it didn't take long to realize that the phrase "the following diagram commutes" was (and is) quite ubiquitous. It appears in theorems, propositions, lemmas and corollaries almost everywhere!

So what's the big deal with diagrams? And what does *commute* mean anyway?? It turns out the answer is quite simple.

Do you know what a composition of two functions is?

*Then you know what a commutative diagram is!*

## A commutative diagram is simply

the picture behind function composition.

*that*simple. To see this, suppose $A$ and $B$ are sets and $f$ is a function from $A$ to $B$. Since $f$

*maps*(i.e. assigns) elements in $A$ to elements in $B$, it is often helpful to denote that process by an arrow.

*That's*an example of a diagram. But suppose we have another function $g$ from sets $B$ to $C$, and suppose $f$ and $g$ are composable. Let's denote their composition by $h=g\circ f$. Then both $g$ and $h$ can be depicted as arrows, too.

*really*? Really it's just the arrows $f$ and $g$ lined up side-by-side.

**diagram**because it's a schematic picture of arrows that represent functions. And it

**commutes**because the diagonal function IS EQUAL TO the composition of the vertical and horizontal functions, i.e. $h(a)=g(f(a))$ for every $a\in A$. So a diagram "commutes" if all paths that share a common starting and ending point are the same. In other words, your diagram commutes if it doesn't matter how you

*commute*from one location to another in the diagram.

But be careful.

*Not every diagram is a commutative diagram.*

*not*commutative. If we trace the number $1$ around the diagram, it maps to $0$ along the diagonal arrow, but it maps to $1$ itself if we take the horizontal-then-vertical route. And $0\neq 1$. So to indicate if/when a given diagram

*is*commutative, we have to say it explicitly. Or sometimes folks will use the symbols shown below to indicate commutativity:

*assumed*that $f,g$ and $h=g\circ f$ already existed. But suppose we only knew about the existence of $f:A\to B$ and

*some other*map, say, $z:A\to C$. Then we might like to know, "Does there exist a map $g:B\to C$ such that $z=g\circ f$? Perhaps the answer is no. Or perhaps the answer is yes, but only under certain hypotheses.* Well, if such a $g$

*does*exists, then we'll say "...there exists a map $g$ such that the following diagram commutes:

"...there exists a map $g$ such that $z$ **factors** through $g$"

*factor*of $z$, analogous to how $2$ is a factor of $6$ since $6=2\cdot 3$.

And as you can imagine, there are more complicated diagrams than triangular ones. For instance, suppose we have two more maps $i:A\to D$ and $j:D\to C$ such that $h$ is equal to not only $g\circ f$ but also $j\circ i$. Then we can express the equality $g\circ f=h=j\circ i$ by a square:

*literally*writing down "$A$" and "$B$" (or "$\bullet$" and "$\bullet$") and by

*literally*drawing a path---in the form of an arrow---between them.

Next time we'll see that diagrams not only help us keep track of compositions of maps, but are *themselves* the image of some map.

How's that for a brain teaser?

*A map of*you may be wondering.

*WHAT?**And what in the world are the domain and codomain*? It turns out that the answer is fairly simple---and pretty cool!---using the language of category theory.

Until next time!