Lemma 1.6.11 (Pasting lemma for pullback squares). Consider a commutative diagram
(1) There is a preferred equivalence \(D_1 \times_{D_3} C_3 \iso D_1 \times_{D_2} (D_2 \times_{D_3} C_3)\).
(2) If the right-hand square is a pullback square, then the left-hand square is a pullback square if and only if the outer rectangle is a pullback square.
Proof
For part (1), we define the functor as \((\pr_1, (h_1 \circ \pr_1, \pr_2))\). We claim that an inverse is given by the functor \[ (\pr_1, \pr_2 \circ \pr_2)\colon D_1 \times_{D_2} (D_2 \times_{D_3} C_3) \to D_1 \times_{D_3} C_3. \] To show that the two composites are identified with the respective identities, it suffices to construct these identifications after projecting to the two components and verifying that these identifications agree after composing with the functors to \(D_3\). But after unwinding the definitions, this holds tautologically by the very construction of the two functors in both directions.
Part (2) is an immediate consequence of the 2-out-of-3 property from Lemma 1.3.6 applied to the following commutative square:
where the right vertical map is an equivalence by applying Exercise 1.6.8 to the equivalence \(C_2 \iso D_2 \times_{D_3} C_3\).