In these two questions, it is mentioned that easy proofs of "magic square" identities can be given using the Yoneda lemma to reduce to the case of sets.
Can someone explain exactly how to do this?
In particular, how exactly to use the Yoneda lemma to prove the following lemma via the category of sets? I don't understand how to "encode these arrows as elements".
Lemma. In an arbitrary category, consider the following commutative diagram: $$\begin{matrix} X_1 & \longrightarrow & X_0 & \longleftarrow & X_2 \\\\ \downarrow & & \downarrow & & \downarrow \\\\\ S_1 & \longrightarrow & S_0 & \longleftarrow & S_2 \\\\ \uparrow & & \uparrow & & \uparrow \\\\\ Y_1 & \longrightarrow & Y_0 & \longleftarrow & Y_2 \end{matrix}$$ Assuming all the pullbacks exist, we have $$(X_1 \times_{S_1} Y_1) \times_{X_0 \times_{S_0} Y_0} (X_2 \times_{S_2} Y_2) = (X_1 \times_{X_0} X_2) \times_{S_1 \times_{S_0} S_2} (Y_1 \times_{Y_0} Y_2)$$