Commutative diagrams and equality of composition

1 reply · 1K views · last reply
Mr Davis 97
Messages
1,461
Reaction score
44
I am a little bit confused on how commutative diagrams show equality of two morphisms. For example, one can imagine the diagram for hf = kg, where composing f and g is the same morphism as composing h and k:
https://upload.wikimedia.org/wikipedia/commons/9/91/Commutative_square.svg

Why does the commutativity of this diagram imply equality of the composition h and f, and k and g? Wouldn't the commutativity just show that hf and kg have the same domain and codomain but are not necessarily the same map?
 
The commutativity works elementwise: ##h(f(a))=k(g(a))\,\forall\,a\in A##. There might happen different things in between (at ##B## and ##C##), but the compositions are equal ##h\circ f = k \circ g##.