hcju/stacksqa huggingface dataset:
The map $c_{h'}$ is the map defined in Morphisms, Lemma \ref{morphisms-lemma-functoriality-differentials}. If $i : Z \to Z'$ is the given closed immersion, then $i^*c_{h'}$ is a map $h^*\Omega_{X/S} \to \Omega_{Z'/S} \otimes \mathcal{O}_Z$. Checking that it is an isomorphism reduces to the affine case by localization, see Lemma \ref{lemma-universal-thickening-localize} and Morphisms, Lemma \ref{morphisms-lemma-differentials-restrict-open}. In this case the result is Algebra, Lemma \ref{algebra-lemma-differentials-universal-thickening}.
We know that there is a canonical exact sequence $$ \mathcal{C}_{Z/Z'} \to \Omega_{Z'/S} \otimes \mathcal{O}_Z \to \Omega_{Z/S} \to 0. $$ see Morphisms, Lemma \ref{morphisms-lemma-differentials-relative-immersion}. Hence the result follows on applying Lemma \ref{lemma-differentials-universally-unramified}.
Denote $Z \to Z'$ the universal first order thickening of $Z$ over $X$. Denote $Z \to Z''$ the universal first order thickening of $Z$ over $Y$. By Lemma \ref{lemma-universally-unramified-differentials-sequence} here is a canonical morphism $Z' \to Z''$ so that we have a commutative diagram $$ \xymatrix{ Z \ar[r]_{i'} \ar[rd]_{j'} & Z' \ar[r] \ar[d] & X \ar[d] \\ & Z'' \ar[r] & Y } $$ Apply Morphisms, Lemma \ref{morphisms-lemma-two-immersions} to the left triangle to get an exact sequence $$ \mathcal{C}_{Z/Z''} \to \mathcal{C}_{Z/Z'} \to (i')^*\Omega_{Z'/Z''} \to 0 $$ As $Z''$ is formally unramified over $Y$ (see Lemma \ref{lemma-universal-thickening-unramified}) we have $\Omega_{Z'/Z''} = \Omega_{Z/Y}$ (by combining Lemma \ref{lemma-formally-unramified-differentials} and Morphisms, Lemma \ref{morphisms-lemma-triangle-differentials}). Then we have $(i')^*\Omega_{Z'/Y} = i^*\Omega_{X/Y}$ by Lemma \ref{lemma-differentials-universally-unramified}.
The map $h : Z' \to Y'$ in (1) comes from Lemma \ref{lemma-universal-thickening-functorial}. The assertion that $Y \times_{Y'} Z'$ is the universal first order thickening of $Z$ over $Y$ is clear from the universal properties of $Z'$ and $Y'$. By Morphisms, Lemma \ref{morphisms-lemma-transitivity-conormal} we have an exact sequence $$ (i')^*\mathcal{C}_{Y \times_{Y'} Z'/Z'} \to \mathcal{C}_{Z/Z'} \to \mathcal{C}_{Z/Y \times_{Y'} Z'} \to 0 $$ where $i' : Z \to Y \times_{Y'} Z'$ is the given morphism. By Morphisms, Lemma \ref{morphisms-lemma-conormal-functorial-flat} there exists a surjection $h^*\mathcal{C}_{Y/Y'} \to \mathcal{C}_{Y \times_{Y'} Z'/Z'}$. Combined with the equalities $\mathcal{C}_{Y/Y'} = \mathcal{C}_{Y/X}$, $\mathcal{C}_{Z/Z'} = \mathcal{C}_{Z/X}$, and $\mathcal{C}_{Z/Y \times_{Y'} Z'} = \mathcal{C}_{Z/Y}$ this proves the lemma.
Let $T' = \bigcup T'_i$ be an affine open covering, and let $T_i = T \cap T'_i$. Then we get morphisms $a'_i : T'_i \to X$ fitting into the diagram. By uniqueness we see that $a'_i$ and $a'_j$ agree on any affine open subscheme of $T'_i \cap T'_j$. Hence $a'_i$ and $a'_j$ agree on $T'_i \cap T'_j$. Thus we see that the morphisms $a'_i$ glue to a global morphism $a' : T' \to X$. The uniqueness of $a'$ we have seen in Lemma \ref{lemma-formally-unramified-not-affine}.
Consider a solid diagram $$ \xymatrix{ U \ar[d]_{f|_U} & T \ar[d]^i \ar[l]^a \\ V & T' \ar[l] \ar@{-->}[lu] } $$ as in Definition \ref{definition-formally-etale}. If $f$ is formally ramified, then there exists exactly one $S$-morphism $a' : T' \to X$ such that $a'|_T = a$. Since $|T'| = |T|$ we conclude that $a'(T') \subset U$ which gives our unique morphism from $T'$ into $U$.
Actually, the last assertion only make sense because $\Omega_{X/S} = 0$ implies that $\mathcal{C}_{X/S}$ is defined via Lemma \ref{lemma-formally-unramified-differentials} and Definition \ref{definition-universal-thickening}. This also makes it clear that (3) and (4) are equivalent. \medskip\noindent Either of the assumptions (1), (2), and (3) imply that $f$ is formally unramified. Hence we may assume $f$ is formally unramified. The equivalence of (1), (2), and (3) follow from the universal property of the universal first order thickening $X'$ of $X$ over $S$ and the fact that $X = X' \Leftrightarrow \mathcal{C}_{X/S} = 0$ since after all by definition $\mathcal{C}_{X/S} = \mathcal{C}_{X/X'}$ is the ideal sheaf of $X$ in $X'$.
Say $X \to S$ is unramified and flat. Then $\Delta : X \to X \times_S X$ is an open immersion, see Morphisms, Lemma \ref{morphisms-lemma-diagonal-unramified-morphism}. We have to show that $\mathcal{C}_{X/S}$ is zero. Consider the two projections $p, q : X \times_S X \to X$. As $f$ is formally unramified (see Lemma \ref{lemma-unramified-formally-unramified}), $q$ is formally unramified (see Lemma \ref{lemma-base-change-formally-unramified}). As $f$ is flat, $p$ is flat, see Morphisms, Lemma \ref{morphisms-lemma-base-change-flat}. Hence $p^*\mathcal{C}_{X/S} = \mathcal{C}_q$ by Lemma \ref{lemma-universal-thickening-fibre-product-flat} where $\mathcal{C}_q$ denotes the conormal sheaf of the formally unramified morphism $q : X \times_S X \to X$. But $\Delta(X) \subset X \times_S X$ is an open subscheme which maps isomorphically to $X$ via $q$. Hence by Lemma \ref{lemma-universal-thickening-localize} we see that $\mathcal{C}_q|_{\Delta(X)} = \mathcal{C}_{X/X} = 0$. In other words, the pullback of $\mathcal{C}_{X/S}$ to $X$ via the identity morphism is zero, i.e., $\mathcal{C}_{X/S} = 0$.
Assume $f$ is \'etale. An \'etale morphism is locally of finite presentation, flat and unramified, see Morphisms, Section \ref{morphisms-section-etale}. Hence $f$ is locally of finite presentation and formally \'etale, see Lemma \ref{lemma-unramified-flat-formally-etale}. \medskip\noindent Conversely, suppose that $f$ is locally of finite presentation and formally \'etale. Being \'etale is local in the Zariski topology on $X$ and $S$, see Morphisms, Lemma \ref{morphisms-lemma-etale-characterize}. By Lemma \ref{lemma-formally-etale-on-opens} we can cover $X$ by affine opens $U$ which map into affine opens $V$ such that $U \to V$ is formally \'etale (and of finite presentation, see Morphisms, Lemma \ref{morphisms-lemma-locally-finite-presentation-characterize}). By Lemma \ref{lemma-affine-formally-etale} we see that the ring maps $\mathcal{O}(V) \to \mathcal{O}(U)$ are formally \'etale (and of finite presentation). We win by Algebra, Lemma \ref{algebra-lemma-formally-etale-etale}. (We will give another proof of this implication when we discuss formally smooth morphisms.)
We simply set $b = a$ and we define $(b')^\sharp$ to be the map $$ (a')^\sharp + D : a^{-1}\mathcal{O}_{Y'} \to \mathcal{O}_{X'} $$ where $D$ is as in Equation (\ref{equation-D}). We omit the verification that $(b')^\sharp$ is a map of sheaves of $\mathcal{O}_S$-algebras and that (1) and (2) of Lemma \ref{lemma-difference-derivation} hold. Equation (\ref{equation-D}) holds by construction.
We recall that an \'etale morphism $U \to V$ is a smooth morphism with $\Omega_{U/V} = 0$. Using this we see that Morphisms, Lemma \ref{morphisms-lemma-triangle-differentials} implies $\Omega_{X_2/S_2} = \Omega_{X_2/S_1}$ and Morphisms, Lemma \ref{morphisms-lemma-triangle-differentials-smooth} implies that the map $f^*\Omega_{X_1/S_1} \to \Omega_{X_2/S_1}$ (for the morphism $f$ seen as a morphism over $S_1$) is an isomorphism. Hence the lemma follows.
The equality sign comes from the identification $f^*\Omega_{X_1/S_1} = \Omega_{X_2/S_2}$ of Lemma \ref{lemma-sheaf-differentials-etale-localization}. Namely, using this we have $a_2^*\Omega_{X_2/S_2} = a_2^*f^*\Omega_{X_1/S_1} = h^*a_1^*\Omega_{X_1/S_1}$ because $f \circ a_2 = a_1 \circ h$. Having said this, the commutativity of the diagram may be checked on affine opens. Hence we may assume the schemes in the initial big diagram are affine. Thus we obtain commutative diagrams $$ \vcenter{ \xymatrix{ (B'_2, I_2) & & (A'_2, J_2) \ar[ll]^{a_2'} \\ (B'_1, I_1) \ar[u]^{h'} & & (A'_1, J_1) \ar[ll]_{a_1'} \ar[u]_{f'} } } \quad\text{and}\quad \vcenter{ \xymatrix{ A'_2 & & R_2 \ar[ll] \\ A'_1 \ar[u] & & R_1 \ar[ll] \ar[u] } } $$ The notation signifies that $I_1, I_2, J_1, J_2$ are ideals of square zero and maps of pairs are ring maps sending ideals into ideals. Set $A_1 = A'_1/J_1$, $A_2 = A'_2/J_2$, $B_1 = B'_1/I_1$, and $B_2 = B'_2/I_2$. We are given that $$ A_2 \otimes_{A_1} \Omega_{A_1/R_1} \longrightarrow \Omega_{A_2/R_2} $$ is an isomorphism. Then $\theta_1 : B_1 \otimes_{A_1} \Omega_{A_1/R_1} \to I_1$ is $B_1$-linear. This gives an $R_1$-derivation $D_1 = \theta_1 \circ \text{d}_{A_1/R_1} : A_1 \to I_1$. In a similar way we see that $\theta_2 : B_2 \otimes_{A_2} \Omega_{A_2/R_2} \to I_2$ gives rise to a $R_2$-derivation $D_2 = \theta_2 \circ \text{d}_{A_2/R_2} : A_2 \to I_2$. The construction of $\theta_2$ implies the following compatibility between $\theta_1$ and $\theta_2$: for every $x \in A_1$ we have $$ h'(D_1(x)) = D_2(f'(x)) $$ as elements of $I_2$. We may view $D_1$ as a map $A'_1 \to B'_1$ using $A'_1 \to A_1 \xrightarrow{D_1} I_1 \to B_1$ similarly we may view $D_2$ as a map $A'_2 \to B'_2$. Then the displayed equality holds for $x \in A'_1$. By the construction of the action in Lemma \ref{lemma-action-by-derivations} and Remark \ref{remark-action-by-derivations} we know that $\theta_1 \cdot a_1'$ corresponds to the ring map $a_1' + D_1 : A'_1 \to B'_1$ and $\theta_2 \cdot a_2'$ corresponds to the ring map $a_2' + D_2 : A'_2 \to B'_2$. By the displayed equality we obtain that $h' \circ (a_1' + D_1) = (a_2' + D_2) \circ f'$ as desired.
As the problem is local on $X'$ we may assume that $X, X', S, S'$ are affine schemes. Say $S' = \Spec(A')$, $X' = \Spec(B')$, $S = \Spec(A)$, $X = \Spec(B)$ with $A = A'/I$ and $B = B'/J$ for some square zero ideals. Then we obtain the following commutative diagram $$ \xymatrix{ 0 \ar[r] & J \ar[r] & B' \ar[r] & B \ar[r] & 0 \\ 0 \ar[r] & I \ar[r] \ar[u] & A' \ar[r] \ar[u] & A \ar[r] \ar[u] & 0 } $$ with exact rows. The canonical map of the lemma is the map $$ I \otimes_A B = I \otimes_{A'} B' \longrightarrow J. $$ The assumption that $f$ is flat signifies that $A \to B$ is flat. \medskip\noindent Assume (1). Then $A' \to B'$ is flat and $J = IB'$. Flatness implies $\text{Tor}_1^{A'}(B', A) = 0$ (see Algebra, Lemma \ref{algebra-lemma-characterize-flat}). This means $I \otimes_{A'} B' \to B'$ is injective (see Algebra, Remark \ref{algebra-remark-Tor-ring-mod-ideal}). Hence we see that $I \otimes_A B \to J$ is an isomorphism. \medskip\noindent Assume (2). Then it follows that $J = IB'$, so that $X = S \times_{S'} X'$. Moreover, we get $\text{Tor}_1^{A'}(B', A'/I) = 0$ by reversing the implications in the previous paragraph. Hence $B'$ is flat over $A'$ by Algebra, Lemma \ref{algebra-lemma-what-does-it-mean}.
Consider a solid diagram $$ \xymatrix{ U \ar[d]_{f|_U} & T \ar[d]^i \ar[l]^a \\ V & T' \ar[l] \ar@{-->}[lu] } $$ as in Definition \ref{definition-formally-smooth}. If $f$ is formally smooth, then there exists an $S$-morphism $a' : T' \to X$ such that $a'|_T = a$. Since the underlying sets of $T$ and $T'$ are the same we see that $a'$ is a morphism into $U$ (see Schemes, Section \ref{schemes-section-open-immersion}). And it clearly is a $V$-morphism as well. Hence the dotted arrow above as desired.
Choose $U \subset X$ and $V \subset Y$ affine open such that $f(U) \subset V$. By Lemma \ref{lemma-formally-smooth-on-opens} $f|_U : U \to V$ is formally smooth. Hence $\Gamma(V, \mathcal{O}_V) \to \Gamma(U, \mathcal{O}_U)$ is a formally smooth ring map, see Lemma \ref{lemma-affine-formally-smooth}. Hence by Algebra, Lemma \ref{algebra-lemma-characterize-formally-smooth-again} the $\Gamma(U, \mathcal{O}_U)$-module $\Omega_{\Gamma(U, \mathcal{O}_U)/\Gamma(V, \mathcal{O}_V)}$ is projective. Hence $\Omega_{U/V}$ is locally projective, see Properties, Section \ref{properties-section-locally-projective}.
By the definition of a locally projective sheaf on a scheme (see Properties, Definition \ref{properties-definition-locally-projective}) we see that $\mathcal{F}$ is a direct summand of a free $\mathcal{O}_T$-module. Hence we may assume that $\mathcal{F} = \bigoplus_{i \in I} \mathcal{O}_T$ is a free module. In this case $\mathcal{H} = \prod_{i \in I} \mathcal{G}$ is a product of quasi-coherent modules. By Cohomology, Lemma \ref{cohomology-lemma-cohomology-products} we conclude that $H^1 = 0$ because the cohomology of a quasi-coherent sheaf on an affine scheme is zero, see Cohomology of Schemes, Lemma \ref{coherent-lemma-quasi-coherent-affine-cohomology-zero}.
The implications (1) $\Rightarrow$ (2), (1) $\Rightarrow$ (3), and (2) $\Rightarrow$ (4) follow from Lemma \ref{lemma-formally-smooth-on-opens}. The implication (3) $\Rightarrow$ (4) is immediate. \medskip\noindent Assume (4). The proof that $f$ is formally smooth is the same as the second part of the proof of Lemma \ref{lemma-smooth-formally-smooth}. Consider a solid commutative diagram $$ \xymatrix{ X \ar[d]_f & T \ar[d]^i \ar[l]^a \\ Y & T' \ar[l] \ar@{-->}[lu] } $$ as in Definition \ref{definition-formally-smooth}. We will show the dotted arrow exists thereby proving that $f$ is formally smooth. Let $\mathcal{F}$ be the sheaf of sets on $T'$ of Lemma \ref{lemma-sheaf} as in the special case discussed in Remark \ref{remark-special-case}. Let $$ \mathcal{H} = \SheafHom_{\mathcal{O}_T}(a^*\Omega_{X/Y}, \mathcal{C}_{T/T'}) $$ be the sheaf of $\mathcal{O}_T$-modules on $T$ with action $\mathcal{H} \times \mathcal{F} \to \mathcal{F}$ as in Lemma \ref{lemma-action-sheaf}. The action $\mathcal{H} \times \mathcal{F} \to \mathcal{F}$ turns $\mathcal{F}$ into a pseudo $\mathcal{H}$-torsor, see Cohomology, Definition \ref{cohomology-definition-torsor}. Our goal is to show that $\mathcal{F}$ is a trivial $\mathcal{H}$-torsor. There are two steps: (I) To show that $\mathcal{F}$ is a torsor we have to show that $\mathcal{F}$ locally has a section. (II) To show that $\mathcal{F}$ is the trivial torsor it suffices to show that $H^1(T, \mathcal{H}) = 0$, see Cohomology, Lemma \ref{cohomology-lemma-torsors-h1}. \medskip\noindent First we prove (I). To see this, for every $t \in T$ we can choose an affine open $W \subset T$ neighbourhood of $t$ such that $a(W)$ is contained in $U_{ji}$ for some $i, j$. Let $W' \subset T'$ be the corresponding open subscheme. By assumption (4) we can lift $a|_W : W \to U_{ji}$ to a $V_j$-morphism $a' : W' \to U_{ji}$ showing that $\mathcal{F}(W')$ is nonempty. \medskip\noindent Finally we prove (II). By Lemma \ref{lemma-formally-smooth-sheaf-differentials} we see that $\Omega_{U_{ji}/V_j}$ locally projective. Hence $\Omega_{X/Y}$ is locally projective, see Properties, Lemma \ref{properties-lemma-locally-projective}. Hence $a^*\Omega_{X/Y}$ is locally projective, see Properties, Lemma \ref{properties-lemma-locally-projective-pullback}. Hence $$ H^1(T, \mathcal{H}) = H^1(T, \SheafHom_{\mathcal{O}_T}(a^*\Omega_{X/Y}, \mathcal{C}_{T/T'}) = 0 $$ by Lemma \ref{lemma-h1-is-zero} as desired.
The algebraic version of this lemma is the following: Given ring maps $A \to B \to C$ with $B \to C$ formally smooth, then the sequence $$ 0 \to C \otimes_B \Omega_{B/A} \to \Omega_{C/A} \to \Omega_{C/B} \to 0 $$ of Algebra, Lemma \ref{algebra-lemma-exact-sequence-differentials} is exact. This is Algebra, Lemma \ref{algebra-lemma-ses-formally-smooth}.
Let $Z \to Z'$ be the universal first order thickening of $Z$ over $X$. From the proof of Lemma \ref{lemma-universally-unramified-differentials-sequence} we see that our sequence is identified with the sequence $$ \mathcal{C}_{Z/Z'} \to \Omega_{Z'/S} \otimes \mathcal{O}_Z \to \Omega_{Z/S} \to 0. $$ Since $Z \to S$ is formally smooth we can locally on $Z'$ find a left inverse $Z' \to Z$ over $S$ to the inclusion map $Z \to Z'$. Thus the sequence is locally split, see Morphisms, Lemma \ref{morphisms-lemma-differentials-relative-immersion-section}.
Denote $Z \to Z'$ the universal first order thickening of $Z$ over $X$. Denote $Z \to Z''$ the universal first order thickening of $Z$ over $Y$. By Lemma \ref{lemma-universally-unramified-differentials-sequence} here is a canonical morphism $Z' \to Z''$ so that we have a commutative diagram $$ \xymatrix{ Z \ar[r]_{i'} \ar[rd]_{j'} & Z' \ar[r]_a \ar[d]^k & X \ar[d]^f \\ & Z'' \ar[r]^b & Y } $$ In the proof of Lemma \ref{lemma-two-unramified-morphisms} we identified the sequence above with the sequence $$ \mathcal{C}_{Z/Z''} \to \mathcal{C}_{Z/Z'} \to (i')^*\Omega_{Z'/Z''} \to 0 $$ Let $U'' \subset Z''$ be an affine open. Denote $U \subset Z$ and $U' \subset Z'$ the corresponding affine open subschemes. As $f$ is formally smooth there exists a morphism $h : U'' \to X$ which agrees with $i$ on $U$ and such that $f \circ h$ equals $b|_{U''}$. Since $Z'$ is the universal first order thickening we obtain a unique morphism $g : U'' \to Z'$ such that $g = a \circ h$. The universal property of $Z''$ implies that $k \circ g$ is the inclusion map $U'' \to Z''$. Hence $g$ is a left inverse to $k$. Picture $$ \xymatrix{ U \ar[d] \ar[r] & Z' \ar[d]^k \\ U'' \ar[r] \ar[ru]^g & Z'' } $$ Thus $g$ induces a map $\mathcal{C}_{Z/Z'}|_U \to \mathcal{C}_{Z/Z''}|_U$ which is a left inverse to the map $\mathcal{C}_{Z/Z''} \to \mathcal{C}_{Z/Z'}$ over $U$.
Choose an affine neighbourhood $V \subset S$ of $f(x)$ and choose an affine neighbourhood $U \subset X$ of $x$ such that $f(U) \subset V$. For any ``test'' diagram as in (2) the morphism $\alpha$ will map $\Spec(B)$ into $U$ and the morphism $\beta$ will map $\Spec(B')$ into $V$ (see Schemes, Section \ref{schemes-section-points}). Hence the lemma reduces to the morphism $f|_U : U \to V$ of affines. (Indeed, $V$ is Noetherian and $f|_U$ is of finite type, see Properties, Lemma \ref{properties-lemma-locally-Noetherian} and Morphisms, Lemma \ref{morphisms-lemma-locally-finite-type-characterize}.) In this affine case the lemma is identical to Algebra, Lemma \ref{algebra-lemma-smooth-test-artinian}.
If $f$ is smooth, then the infinitesimal lifting criterion (Lemma \ref{lemma-smooth-formally-smooth}) says $f$ is formally smooth and (2) holds. \medskip\noindent Assume (2). The set of points $x \in X$ where $f$ is not smooth forms a closed subset $T$ of $X$. By the discussion in Morphisms, Section \ref{morphisms-section-points-finite-type}, if $T \not = \emptyset$ there exists a point $x \in T \subset X$ such that the morphism $$ \Spec(\kappa(x)) \to X \to S $$ is of finite type (namely, pick any point $x$ of $T$ which is closed in an affine open of $X$). By Morphisms, Lemma \ref{morphisms-lemma-artinian-finite-type} given any local Artinian ring $B'$ with residue field $\kappa(x)$ then any morphism $\beta : \Spec(B') \to S$ is of finite type. Thus we see that all the diagrams used in Lemma \ref{lemma-lifting-along-artinian-at-point} (4) correspond to diagrams as in the current lemma (2). Whence $X \to S$ is smooth a $x$ a contradiction.
From the construction of $\NL_{X/Y}$ in Modules, Section \ref{modules-section-netherlander} we see there is a canonical map of complexes $\NL_{\mathcal{O}_X(U)/f^{-1}\mathcal{O}_Y(U)} \to \NL_{X/Y}(U)$ of $A = \mathcal{O}_X(U)$-modules, which is compatible with further restrictions. Using the canonical map $R \to f^{-1}\mathcal{O}_Y(U)$ we obtain a canonical map $\NL_{A/R} \to \NL_{\mathcal{O}_X(U)/f^{-1}\mathcal{O}_Y(U)}$ of complexes of $A$-modules. Using the universal property of the $\widetilde{\ }$ functor (see Schemes, Lemma \ref{schemes-lemma-compare-constructions}) we obtain a map as in the statement of the lemma. We may check this map is an isomorphism on cohomology sheaves by checking it induces isomorphisms on stalks. This follows from Algebra, Lemma \ref{algebra-lemma-NL-localize-bottom} and \ref{algebra-lemma-localize-NL} and Modules, Lemma \ref{modules-lemma-stalk-NL} (and the description of the stalks of $\mathcal{O}_X$ and $f^{-1}\mathcal{O}_Y$ at a point $\mathfrak p \in \Spec(A)$ as $A_\mathfrak p$ and $R_\mathfrak q$ where $\mathfrak q = R \cap \mathfrak p$; references used are Schemes, Lemma \ref{schemes-lemma-spec-sheaves} and Sheaves, Lemma \ref{sheaves-lemma-stalk-pullback}).
By construction of the naive cotangent complex in Modules, Section \ref{modules-section-netherlander} we have that $\NL_{X/Y}$ is a complex sitting in degrees $-1$, $0$ and that its cohomology in degree $0$ is $\Omega_{X/Y}$. The sheaf of differentials is quasi-coherent (by Morphisms, Lemma \ref{morphisms-lemma-differentials-diagonal}). To finish the proof it suffices to show that $H^{-1}(\NL_{X/Y})$ is quasi-coherent. This follows by checking over affines using Lemma \ref{lemma-NL-affine}.
By Lemma \ref{lemma-NL-affine} it suffices to show that $\NL_{A/R}$ has this shape if $R \to A$ is a finitely presented ring map. Write $A = R[x_1, \ldots, x_n]/I$ with $I$ finitely generated. Then $I/I^2$ is a finite $A$-module and $\NL_{A/R}$ is quasi-isomorphic to $$ \ldots \to 0 \to I/I^2 \to \bigoplus\nolimits_{i = 1, \ldots, n} A\text{d}x_i \to 0 \to \ldots $$ by Algebra, Section \ref{algebra-section-netherlander} and in particular Algebra, Lemma \ref{algebra-lemma-NL-homotopy}.
A formally \'etale morphism is formally smooth and hence we have $H^{-1}(\NL_{X/Y}) = 0$ by Lemma \ref{lemma-NL-formally-smooth}. On the other hand, we have $\Omega_{X/Y} = 0$ by Lemma \ref{lemma-characterize-formally-etale}. Conversely, if (2) holds, then $f$ is formally smooth by Lemma \ref{lemma-NL-formally-smooth} and formally unramified by Lemma \ref{lemma-formally-unramified-differentials} and hence formally \'etale by Lemmas \ref{lemma-formally-etale-unramified-smooth}.
This follows from the definition of a smooth ring homomorphism (Algebra, Definition \ref{algebra-definition-smooth}), Lemma \ref{lemma-NL-affine}, and the definition of a smooth morphism of schemes (Morphisms, Definition \ref{morphisms-definition-smooth}). We also use that finite locally free is the same as finite projective for modules over rings (Algebra, Lemma \ref{algebra-lemma-finite-projective}).
It suffices to show the canonical map $$ f^*\NL_{Y/Z} \to \text{Cone}(\NL_{X/Y} \to \NL_{X/Z})[-1] $$ of Modules, Lemma \ref{modules-lemma-exact-sequence-NL-ringed-topoi} is an isomorphism in $D(\mathcal{O}_X)$. In order to show this, it suffices to show that the $6$-term sequence has a zero on the left, i.e., that $H^{-1}(f^*\NL_{Y/Z}) \to H^{-1}(\NL_{X/Z})$ is injective. Affine locally this follows from the corresponding algebra result in More on Algebra, Lemma \ref{more-algebra-lemma-transitive-lci-at-end}. To translate into algebra use Lemma \ref{lemma-NL-affine}.
The morphism $X \to Y$ is locally of finite presentation by Morphisms, Lemma \ref{morphisms-lemma-finite-presentation-permanence}. By Lemma \ref{lemma-NL-smooth} we have $H^{-1}(\NL_{X/Z}) = 0$ and the module $\Omega_{X/Z}$ is finite locally free. By Lemma \ref{lemma-NL-etale} we have $H^{-1}(\NL_{Y/Z}) = H^0(\NL_{Y/Z}) = 0$. By Lemma \ref{lemma-exact-sequence-NL} we get $H^{-1}(\NL_{X/Y}) = 0$ and $\Omega_{X/Y} \cong \Omega_{X/Z}$ is finite locally free. By Lemma \ref{lemma-NL-smooth} the morphism $X \to Y$ is smooth.
(For the parenthetical statement see Lemma \ref{lemma-smooth-formally-smooth}.) By Lemmas \ref{lemma-NL-immersion} and \ref{lemma-NL-formally-smooth} we have $\NL_{X/P} = \mathcal{C}_{X/P}[1]$ and $\NL_{P/Y} = \Omega_{P/Y}$ with $\Omega_{P/Y}$ locally projective. This implies that $i^*\NL_{P/Y} \to i^*\Omega_{P/Y}$ is a quasi-isomorphism too (small detail omitted; the reason is that $i^*\NL_{P/Y}$ is the same thing as $\tau_{\geq -1}Li^*\NL_{P/Y}$, see More on Algebra, Lemma \ref{more-algebra-lemma-tensor-NL}). Thus the canonical map $$ i^*\NL_{P/Y} \to \text{Cone}(\NL_{X/Y} \to \NL_{X/P})[-1] $$ of Modules, Lemma \ref{modules-lemma-exact-sequence-NL-ringed-topoi} is an isomorphism in $D(\mathcal{O}_X)$ because the cohomology group $H^{-1}(i^*\NL_{P/Y})$ is zero by what we said above. In other words, we have a distinguished triangle $$ i^*\NL_{P/Y} \to \NL_{X/Y} \to \NL_{X/P} \to i^*\NL_{P/Y}[1] $$ Clearly, this means that $\NL_{X/Y}$ is the cone on the map $\NL_{X/P}[-1] \to i^*\NL_{P/Y}$ which is equivalent to the statement of the lemma by our computation of the cohomology sheaves of these objects in the derived category given above.