Proposition 1.4.9 (Associativity). For composable morphisms \(f\colon x \to y\), \(g\colon y \to z\) and \(h\colon z \to w\) in an \(\infty \)-category \(C\), there is an identification \[ h \circ (g \circ f) = (h \circ g) \circ f \] in \(\Ar (C)\).

Proof. Throughout this proof we display a morphism in \(\Ar (C)\) as a commutative square whose two vertical arrows are its source and its target, so that the horizontal direction records the morphism in \(\Ar (C)\); the identification \(\Fun ([1],\Ar (C)) \simeq \Fun ([1] \times [1],C)\) we use is the one that swaps the two factors of \([1] \times [1]\) relative to the convention of Definition 1.4.1. With this reading, consider the following two morphisms in \(\Ar (C)\):

Commutative square with maps x to y labeled f, x to z labeled g circ f, x to x labeled \id x, y to z labeled g.
Commutative square with maps y to w labeled h circ g, z to w labeled h, y to z labeled g, w to w labeled \id w.

These morphisms are natural in \(f\), \(g\) and \(h\): we have functors \[ \Ar (C) \times _{s,C,t} \Ar (C) \quad \iso \quad \Fun ([2], C) \quad \xrightarrow {p_0^*} \quad \Fun ([1] \times [1],C), \]

Commutative triangle with vertices x, y, z and arrows labeled f, g.
Commutative triangle with vertices x, y, z and arrows labeled f, g circ f, g.
Commutative square with maps x to y labeled f, x to z labeled g circ f, x to x labeled \id x, y to z labeled g.

and similarly for the other diagram. Forming the composite of these two morphisms in \(\Ar (C)\), we thus obtain a commutative square in \(C\) of the form

Commutative square with maps x to w labeled (h circ g) circ f, x to w labeled h circ (g circ f), x to x labeled \id x, w to w labeled \id w.

natural in \(f\), \(g\) and \(h\). Using Lemma 1.4.8, the diagonal of this square is then identified with both \((h \circ g) \circ f\) and \(h \circ (g \circ f)\), finishing the proof. โ–ก