Exercise 1.7.17 (Pasting lemma for pullback squares). Consider a commutative diagram

Commutative diagram involving X, Y, Z, X', Y', Z', with arrows labeled g 1, f 1, g 2, f 2, f 3, h 1, h 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. Hint: compare with Lemma 1.3.15.