Corollary 5.1.2.6 (Transitivity). Let $p: \operatorname{\mathcal{C}}\rightarrow \operatorname{\mathcal{D}}$ and $q: \operatorname{\mathcal{D}}\rightarrow \operatorname{\mathcal{E}}$ be inner fibrations of simplicial sets, and let $e: Y \rightarrow Z$ be an edge of the simplicial set $\operatorname{\mathcal{C}}$.
Assume that $p(e)$ is a $q$-cartesian edge of $\operatorname{\mathcal{D}}$. Then $e$ is $p$-cartesian if and only if it is $(q \circ p)$-cartesian.
Assume that $p(e)$ is a $q$-cocartesian edge of $\operatorname{\mathcal{D}}$. Then $e$ is $p$-cocartesian if and only if it is $(q \circ p)$-cocartesian.
Proof.
We will prove the first assertion; the second follows by a similar argument. Using Remark 5.1.1.13, we can reduce to the case where $\operatorname{\mathcal{E}}$ is an $\infty $-category (or even a simplex), so that $\operatorname{\mathcal{C}}$ and $\operatorname{\mathcal{D}}$ are also $\infty $-categories (Remark 4.1.1.9). Fix an object $X \in \operatorname{\mathcal{C}}$, and set $r = q \circ p$. We have a commutative diagram of Kan complexes
\[ \xymatrix@R =50pt@C=50pt{ \operatorname{Hom}_{\operatorname{\mathcal{C}}}(X,Y,Z) \times _{ \operatorname{Hom}_{\operatorname{\mathcal{C}}}(Y,Z) } \{ e\} \ar [r] \ar [d] & \operatorname{Hom}_{\operatorname{\mathcal{C}}}(X,Z) \ar [d] \\ \operatorname{Hom}_{\operatorname{\mathcal{D}}}( p(X), p(Y), p(Z) ) \times _{ \operatorname{Hom}_{\operatorname{\mathcal{C}}}( p(Y), p(Z) ) } \{ q(e) \} \ar [r] \ar [d] & \operatorname{Hom}_{\operatorname{\mathcal{D}}}( p(X), p(Z) ) \ar [d] \\ \operatorname{Hom}_{\operatorname{\mathcal{E}}}( r(X), r(Y), r(Z) ) \times _{ \operatorname{Hom}_{\operatorname{\mathcal{E}}}( r(Y), r(Z) ) } \{ r(e) \} \ar [r] & \operatorname{Hom}_{\operatorname{\mathcal{E}}}( r(X), r(Z) ). } \]
If $p(e)$ is a $q$-cartesian morphism of $\operatorname{\mathcal{D}}$, then the bottom square is a homotopy pullback (Proposition 5.1.2.1). Invoking Proposition 3.4.1.11, we deduce that the upper square is a homotopy pullback if and only if the outer rectangle is a homotopy pullback. Allowing $X$ to vary and invoking Proposition 5.1.2.1, we conclude that $e$ is $p$-cartesian if and only if is $r$-cartesian.
$\square$