Question on the commutativity of a diagram of morphisms Let us consider a category $\mathfrak{A}$ and the following diagram of morphisms:
$\require{AMScd}$
\begin{CD}
A @>{f}>> B\\
@V{h}VV @V{k}VV\\
C @>{g}>> D
\end{CD}
Assume that $k \circ f=g \circ h$ and that there exists a unique $w: B \longrightarrow C$ such that $w \circ f=h$. May I also deduce that $g \circ w=k$?
 A: Another counterexample, using the category of abelian groups and group homomorphisms (just to keep things down to earth):
$\require{AMScd}$
\begin{CD}
0 @>>> \mathbb{Z}/2\\
@VVV @VV{1}V\\
0 @>>> \mathbb{Z}/2
\end{CD}
This clearly commutes. There is a unique morphism $w: \mathbb{Z}/2 \to 0$ which happens to make the upper left triangle commute — that is, not only does the subset $\{w: w \circ f = h\} \subseteq \text{Hom}(B,C)$ have cardinality 1, but in fact $\text{Hom}(B,C)$ has cardinality 1. The bottom right triangle won't commute in this case.
A: No. Consider the category whose only objects are distinct objects $A, B, C, D$, where the only arrows $A \to A$, $B \to B$, $C \to C$, $D \to D$ are the identity arrows, and the following are all the other arrows:

*

*$f : A \to B$

*$h : A \to C$

*$w : B \to C$

*$e : A \to D$

*$k \neq k' : B \to D$

*$g : C \to D$
Note that with the exception of $B \to D$, there is at most one arrow $X \to Y$. So the only nontrivial composition is $g \circ w$, which we define to be $k'$.
This forms a category. And in this category, it is the case that $k \circ f = g \circ h$. But it is not the case that $g \circ w = k$.
