A diagram composed of commutative diagrams is commutative In the “Logical Prerequisites” section of Lang’s Algebra it says, “... to verify that a diagram consisting of triangles and squares is commutative, it suffices to verify that each triangle and square in it is commutative.” He seems to suggest that this is trivial, but I can’t seem to understand why it is true. Is he perhaps simply stating it as a fact or am I misunderstanding something?
Edit: The objects are sets and the morphisms are maps.
 A: Presumably we are talking about a planar diagram, in which we have some polygon whose interior is subdivided into triangles and squares, having three properties:

*

*Each 0-cell (aka vertex of the subdivision) is labelled by an object;

*Each 1-cell (aka edge of the subdivision) is oriented and labelled by a morphism from the initial object to the terminal object;

*Each 2-cell (aka square or edge of the subdivision) is a commutative diagram.

What has to be proved is that for any two 0-cells labelled by objects $X,Y$, and for any chain of oriented 1-cells from $X$ to $Y$ with corresponding morphism composition
$$f = f_m \circ \cdots \circ f_1 : X \to Y
$$
and for any other chain of oriented 1-cells from $X$ to $Y$ with morphism composition
$$g = g_n \circ \cdots \circ g_1 : X \to Y
$$
we have
$$f=g
$$
The proof is an induction.
First I'll tell you the base case of the induction, and there are two subcases, the first of which is:

Homotopy move across a square: There exists a square with $f_{i+1} \circ f_i$ on two sides of that square and with $g_{j+1} \circ g_j$ on the other two sides, such that $g$ is obtained from $f$ by replacing the two terms $f_{i+1} \circ f_i$ with the two terms $g_{j+1} \circ g_j$.

Since $f_{i+1} \circ f_i = g_{j+1} \circ g_j$, the desired conclusion $f=g$ follows.
The second subcase is:

Homotopy move across a triangle: There exists a triangle with $f_{i+1} \circ f_i$ on two sides and $g_j$ on the other side, or with $f_i$ on one side and $g_{j+1} \circ g_j$ on the other two sides, such that $g$ is obtained from $f$ by the approprate replacement.

Again, $f=g$ follows.
For the induction step, you need a fact which is essentially derived from topology, namely from the fact that a polygon union its interior is simply connected. From this fact, it follows that there exists a finite sequence of homotopy moves which step-by-step transforms the sequence $f_m \circ \cdots \circ f_1$ into the sequence $g_n \circ \cdots \circ g_1$. The induction variable $k$ is simply the number of these homotopy moves.
Assuming the induction hypothesis which says that the number of moves is less than $k$, the map $f$ is unchanged under the first $k-1$ moves, and then it is unchanged under the last single move as well, which produces the map $g$.

I'll point out here that the topology of the diagram is very important. For example, perhaps one might encounter a diagram of commutative triangles and squares which forms an annulus (homeomorphic to the region between two concentric planar circles) instead of a polygon (homeomorphic to a closed disc, i.e. the region inside one circle). An annulus is not simply connected, and an annulus diagram built out of commutative triangles and squares need not be commutative.
