Lemma 24.1.14 (Right cancellation of cocartesian morphisms). Let \(p\colon E \to C\) be a functor and let \(f\colon x \to y\) and \(g\colon y \to z\) be morphisms in \(E\) such that \(f\) is \(p\)-cocartesian. Then \(g\) is \(p\)-cocartesian if and only if \(gf\) is \(p\)-cocartesian.

Proof. For every other object \(w \in E\), we consider the following commutative diagram:

Commutative diagram involving \Hom E(z,w), \Hom E(y,w), \Hom E(x,w), \Hom C(pz,pw), \Hom C(py,pw), \Hom C(px,pw), with arrows labeled p, - circ g, - circ f, - circ p(g), - circ p(f).

Since \(f\) is \(p\)-cocartesian, the right square is a pullback square. It follows from the pasting law for pullback squares that the left square is a pullback if and only if the outer square is a pullback. This proves the claim. โ–ก