Proposition 6.5.5 (Interval test for local fibrations). A functor \(p\colon E\to S\) is a locally cocartesian fibration if and only if, for every anima \(A\) and functor \(A\times[1]\to S\), its pullback to \(A\times[1]\) is a cocartesian fibration.
Proof
Suppose that all the indicated pullbacks are cocartesian fibrations. Apply this to the evaluation functor \(\Map([1],S)\times[1]\to S\). In context \(\Map([1],S)\), cocartesian lifts over \(0\to1\) give locally \(p\)-cocartesian lifts of the universal morphism in \(S\). Hence \(p\) is locally cocartesian. Conversely, suppose that \(p\) has local cocartesian lifts and put \(p'\colon E'\to A\times[1]\) for such a pullback. Local cocartesian lifts are stable under base change. Up to the identifications in \(A\), a morphism in \(A\times[1]\) is either invertible or goes from \(0\) to \(1\) in the second factor. A local lift of an invertible morphism is invertible by Proposition 4.8.7. A local lift ending over \(1\) is cocartesian: every subsequent base morphism is invertible, so the local universal property gives its full universal property after transport along that identification. This is the same argument as Lemma 4.8.8. Hence all these local lifts are cocartesian. The recognition principle gives that \(p'\) is a cocartesian fibration.
From Section 6.5, Pointwise and fiberwise criteria for fibrations.