hcju/stacksqa huggingface dataset:
Proof of (1). We view $\text{Der}_k(P, P)$ as a $P$-module. If it has finite dimension over $k$, then it has finite length as a $P$-module, hence it is supported in finitely many closed points of $\Spec(P)$ (Algebra, Lemma \ref{algebra-lemma-simple-pieces}). Since $\text{Der}_k(P, P) = \Hom_P(\Omega_{P/k}, P)$ we see that $\text{Der}_k(P, P)_\mathfrak p = \text{Der}_k(P_\mathfrak p, P_\mathfrak p)$ for any prime $\mathfrak p \subset P$ (this uses Algebra, Lemmas \ref{algebra-lemma-differentials-localize}, \ref{algebra-lemma-differentials-finitely-presented}, and \ref{algebra-lemma-hom-from-finitely-presented}). Let $\mathfrak p$ be a minimal prime ideal of $P$ corresponding to an irreducible component of dimension $d > 0$. Then $P_\mathfrak p$ is an Artinian local ring essentially of finite type over $k$ with residue field and $\Omega_{P_\mathfrak p/k}$ is nonzero for example by Algebra, Lemma \ref{algebra-lemma-characterize-smooth-over-field}. Any nonzero finite module over an Artinian local ring has both a sub and a quotient module isomorphic to the residue field. Thus we find that $\text{Der}_k(P_\mathfrak p, P_\mathfrak p) = \Hom_{P_\mathfrak p}(\Omega_{P_\mathfrak p/k}, P_\mathfrak p)$ is nonzero too. Combining all of the above we find that (1) is true. \medskip\noindent Proof of (2). For a prime $\mathfrak p$ of $P$ we will use that $\NL_{P_\mathfrak p/k} = (\NL_{P/k})_\mathfrak p$ (Algebra, Lemma \ref{algebra-lemma-localize-NL}) and we will use that $\text{Ext}_P^1(\NL_{P/k}, P)_\mathfrak p = \text{Ext}_{P_\mathfrak p}^1(\NL_{P_\mathfrak p/k}, P_\mathfrak p)$ (More on Algebra, Lemma \ref{more-algebra-lemma-pseudo-coherence-and-base-change-ext}). Given a prime $\mathfrak p \subset P$ then $k \to P$ is smooth at $\mathfrak p$ if and only if $(\NL_{P/k})_\mathfrak p$ is quasi-isomorphic to a finite projective module placed in degree $0$ (this follows immediately from the definition of a smooth ring map but it also follows from the stronger Algebra, Lemma \ref{algebra-lemma-smooth-at-point}). \medskip\noindent Assume that $P$ is smooth over $k$ at all but finitely many primes. Then these ``bad'' primes are maximal ideals $\mathfrak m_1, \ldots, \mathfrak m_n \subset P$ by Algebra, Lemma \ref{algebra-lemma-finite-type-algebra-finite-nr-primes} and the fact that the ``bad'' primes form a closed subset of $\Spec(P)$. For $\mathfrak p \not \in \{\mathfrak m_1, \ldots, \mathfrak m_n\}$ we have $\text{Ext}^1_P(\NL_{P/k}, P)_\mathfrak p = 0$ by the results above. Thus $\text{Ext}^1_P(\NL_{P/k}, P)$ is a finite $P$-module whose support is contained in $\{\mathfrak m_1, \ldots, \mathfrak m_r\}$. By Algebra, Proposition \ref{algebra-proposition-minimal-primes-associated-primes} for example, we find that the dimension over $k$ of $\text{Ext}^1_P(\NL_{P/k}, P)$ is a finite integer combination of $\dim_k \kappa(\mathfrak m_i)$ and hence finite by the Hilbert Nullstellensatz (Algebra, Theorem \ref{algebra-theorem-nullstellensatz}).
Given a deformation of $P$ we can take the henselization of it to get a deformation of the henselization; this is clear and we encourage the reader to skip the proof. More precisely, let $(A, Q) \to (k, P)$ be a morphism in $\mathcal{F}$, i.e., an object of $\Deformationcategory_P$. Denote $J_Q \subset Q$ the inverse image of $J$ in $Q$. Let $(Q^h, J_Q^h)$ be the henselization of the pair $(Q, J_Q)$. Recall that $Q \to Q^h$ is flat (More on Algebra, Lemma \ref{more-algebra-lemma-henselization-flat}) and hence $Q^h$ is flat over $A$. By More on Algebra, Lemma \ref{more-algebra-lemma-henselization-integral} we see that the map $Q^h \to P^h$ induces an isomorphism $Q^h \otimes_A k = Q^h \otimes_Q P = P^h$. Hence $(A, Q^h) \to (k, P^h)$ is the desired object of $\Deformationcategory_{P^h}$.
Given a deformation of $P$ we can take the strict henselization of it to get a deformation of the strict henselization; this is clear and we encourage the reader to skip the proof. More precisely, let $(A, Q) \to (k, P)$ be a morphism in $\mathcal{F}$, i.e., an object of $\Deformationcategory_P$. Since the kernel of the surjection $Q \to P$ is nilpotent, we find that $Q$ is a local ring with the same residue field as $P$. Let $Q^{sh}$ be the strict henselization of $Q$. Recall that $Q \to Q^{sh}$ is flat (More on Algebra, Lemma \ref{more-algebra-lemma-dumb-properties-henselization}) and hence $Q^{sh}$ is flat over $A$. By Algebra, Lemma \ref{algebra-lemma-quotient-strict-henselization} we see that the map $Q^{sh} \to P^{sh}$ induces an isomorphism $Q^{sh} \otimes_A k = Q^{sh} \otimes_Q P = P^{sh}$. Hence $(A, Q^{sh}) \to (k, P^{sh})$ is the desired object of $\Deformationcategory_{P^{sh}}$.
Given a deformation of $P$ we can take the completion of it to get a deformation of the completion; this is clear and we encourage the reader to skip the proof. More precisely, let $(A, Q) \to (k, P)$ be a morphism in $\mathcal{F}$, i.e., an object of $\Deformationcategory_P$. Observe that $Q$ is a Noetherian ring: the kernel of the surjective ring map $Q \to P$ is nilpotent and finitely generated and $P$ is Noetherian; apply Algebra, Lemma \ref{algebra-lemma-completion-Noetherian}. Denote $J_Q \subset Q$ the inverse image of $J$ in $Q$. Let $Q^\wedge$ be the $J_Q$-adic completion of $Q$. Recall that $Q \to Q^\wedge$ is flat (Algebra, Lemma \ref{algebra-lemma-completion-flat}) and hence $Q^\wedge$ is flat over $A$. The induced map $Q^\wedge \to P^\wedge$ induces an isomorphism $Q^\wedge \otimes_A k = Q^\wedge \otimes_Q P = P^\wedge$ by Algebra, Lemma \ref{algebra-lemma-completion-tensor} for example. Hence $(A, Q^\wedge) \to (k, P^\wedge)$ is the desired object of $\Deformationcategory_{P^\wedge}$.
Proof of (1). Consider the derivations $\partial/\partial x_i$ of $k[[x_1, \ldots, x_n]]$ over $k$. Write $f_i = \partial f/\partial x_i$. The derivation $$ \theta = \sum h_i \partial/\partial x_i $$ of $k[[x_1, \ldots, x_n]]$ induces a derivation of $P = k[[x_1, \ldots, x_n]]/(f)$ if and only if $\sum h_i f_i \in (f)$. Moreover, the induced derivation of $P$ is zero if and only if $h_i \in (f)$ for $i = 1, \ldots, n$. Thus we find $$ \Ker((f_1, \ldots, f_n) : P^{\oplus n} \longrightarrow P) \subset \text{Der}_k(P, P) $$ The left hand side is a finite dimensional $k$-vector space only if $n = 1$; we omit the proof. We also leave it to the reader to see that the right hand side has finite dimension if $n = 1$. This proves (1). \medskip\noindent Proof of (2). Let $Q$ be a flat deformation of $P$ over $k[\epsilon]$ as in the proof of Lemma \ref{lemma-rings-TI}. Choose lifts $q_i \in Q$ of the image of $x_i$ in $P$. Then $Q$ is a complete local ring with maximal ideal generated by $q_1, \ldots, q_n$ and $\epsilon$ (small argument omitted). Thus we get a surjection $$ k[\epsilon][[x_1, \ldots, x_n]] \longrightarrow Q,\quad x_i \longmapsto q_i $$ Choose an element of the form $f + \epsilon g \in k[\epsilon][[x_1, \ldots, x_n]]$ mapping to zero in $Q$. Observe that $g$ is well defined modulo $(f)$. Since $Q$ is flat over $k[\epsilon]$ we get $$ Q = k[\epsilon][[x_1, \ldots, x_n]]/(f + \epsilon g) $$ Finally, if we changing the choice of $q_i$ amounts to changing the coordinates $x_i$ into $x_i + \epsilon h_i$ for some $h_i \in k[[x_1, \ldots, x_n]]$. Then $f + \epsilon g$ changes into $f + \epsilon (g + \sum h_i f_i)$ where $f_i = \partial f/\partial x_i$. Thus we see that the isomorphism class of the deformation $Q$ is determined by an element of $$ k[[x_1, \ldots, x_n]]/ (f, \partial f/\partial x_1, \ldots,  \partial f/\partial x_n) $$ This has finite dimension over $k$ if and only if its support is the closed point of $k[[x_1, \ldots, x_n]]$ if and only if $\sqrt{(f, \partial f/\partial x_1, \ldots,  \partial f/\partial x_n)} = (x_1, \ldots, x_n)$.
Let $A_1 \to A$ and $A_2 \to A$ be morphisms of $\mathcal{C}_\Lambda$. Assume $A_2 \to A$ is surjective. According to Formal Deformation Theory, Lemma \ref{formal-defos-lemma-RS-2-categorical} it suffices to show that the functor $\mathcal{F}(A_1 \times_A A_2) \to \mathcal{F}(A_1) \times_{\mathcal{F}(A)} \mathcal{F}(A_2)$ is an equivalence of categories. Observe that $$ \xymatrix{ \Spec(A) \ar[r] \ar[d] & \Spec(A_2) \ar[d] \\ \Spec(A_1) \ar[r] & \Spec(A_1 \times_A A_2) } $$ is a pushout diagram as in More on Morphisms, Lemma \ref{more-morphisms-lemma-pushout-along-thickening}. Thus the lemma is a special case of More on Morphisms, Lemma \ref{more-morphisms-lemma-equivalence-categories-schemes-over-pushout-flat}.
Recall that $\text{Inf}(\Deformationcategory_X)$ is the set of automorphisms of the trivial deformation $X' = X \times_{\Spec(k)} \Spec(k[\epsilon])$ of $X$ to $k[\epsilon]$ equal to the identity modulo $\epsilon$. By Deformation Theory, Lemma \ref{defos-lemma-deform} this is equal to $\text{Ext}^0_{\mathcal{O}_X}(\NL_{X/k}, \mathcal{O}_X)$. The equality $\text{Ext}^0_{\mathcal{O}_X}(\NL_{X/k}, \mathcal{O}_X) = \Hom_{\mathcal{O}_X}(\Omega_{X/k}, \mathcal{O}_X)$ follows from More on Morphisms, Lemma \ref{more-morphisms-lemma-netherlander-quasi-coherent}. The equality $\Hom_{\mathcal{O}_X}(\Omega_{X/k}, \mathcal{O}_X) = \text{Der}_k(\mathcal{O}_X, \mathcal{O}_X)$ follows from Morphisms, Lemma \ref{morphisms-lemma-universal-derivation-universal}. \medskip\noindent Recall that $T_{x_0}\Deformationcategory_X$ is the set of isomorphism classes of flat deformations $X'$ of $X$ to $k[\epsilon]$, more precisely, the set of isomorphism classes of $\Deformationcategory_X(k[\epsilon])$. Thus the second statement of the lemma follows from Deformation Theory, Lemma \ref{defos-lemma-deform}.
By the lemma we have to show $\Ext^1_{\mathcal{O}_X}(\NL_{X/k}, \mathcal{O}_X)$ and $\Ext^0_{\mathcal{O}_X}(\NL_{X/k}, \mathcal{O}_X)$ are finite dimensional. By More on Morphisms, Lemma \ref{more-morphisms-lemma-netherlander-fp} and the fact that $X$ is Noetherian, we see that $\NL_{X/k}$ has coherent cohomology sheaves zero except in degrees $0$ and $-1$. By Derived Categories of Schemes, Lemma \ref{perfect-lemma-ext-finite} the displayed $\Ext$-groups are finite $k$-vector spaces and the proof is complete.
The existence of a hull follows immediately from Lemmas \ref{lemma-schemes-RS} and \ref{lemma-proper-schemes-TI} and Formal Deformation Theory, Lemma \ref{formal-defos-lemma-RS-implies-S1-S2} and Remark \ref{formal-defos-remark-compose-minimal-into-iso-classes}. \medskip\noindent Assume $\text{Der}_k(\mathcal{O}_X, \mathcal{O}_X) = 0$. Then $\Deformationcategory_X$ and $F$ are equivalent by Formal Deformation Theory, Lemma \ref{formal-defos-lemma-infdef-trivial}. Hence $F$ is a deformation functor (because $\Deformationcategory_X$ is a deformation category) with finite tangent space and we can apply Formal Deformation Theory, Theorem \ref{formal-defos-theorem-Schlessinger-prorepresentability}.
It suffices to show that the functors of Lemma \ref{lemma-open} define an equivalence $$ \Deformationcategory_X \longrightarrow \Deformationcategory_{U_1} \times_{\Deformationcategory_{U_{12}}} \Deformationcategory_{U_2} $$ because then we can apply Lemma \ref{lemma-affine} to translate into rings. To do this we construct a quasi-inverse. Denote $F_i : \Deformationcategory_{U_i} \to \Deformationcategory_{U_{12}}$ the functor of Lemma \ref{lemma-open}. An object of the RHS is given by an $A$ in $\mathcal{C}_\Lambda$, objects $(A, V_1) \to (k, U_1)$ and $(A, V_2) \to (k, U_2)$, and a morphism $$ g : F_1(A, V_1) \to F_2(A, V_2) $$ Now $F_i(A, V_i) = (A, V_{i, 3 - i})$ where $V_{i, 3 - i} \subset V_i$ is the open subscheme whose base change to $k$ is $U_{12} \subset U_i$. The morphism $g$ defines an isomorphism $V_{1, 2} \to V_{2, 1}$ of schemes over $A$ compatible with $\text{id} : U_{12} \to U_{12}$ over $k$. Thus $(\{1, 2\}, V_i, V_{i, 3 - i}, g, g^{-1})$ is a glueing data as in Schemes, Section \ref{schemes-section-glueing-schemes}. Let $Y$ be the glueing, see Schemes, Lemma \ref{schemes-lemma-glue}. Then $Y$ is a scheme over $A$ and the compatibilities mentioned above show that there is a canonical isomorphism $Y \times_{\Spec(A)} \Spec(k) = X$. Thus $(A, Y) \to (k, X)$ is an object of $\Deformationcategory_X$. We omit the verification that this construction is a functor and is quasi-inverse to the given one.
Let $A_1 \to A$ and $A_2 \to A$ be morphisms of $\mathcal{C}_\Lambda$. Assume $A_2 \to A$ is surjective. According to Formal Deformation Theory, Lemma \ref{formal-defos-lemma-RS-2-categorical} it suffices to show that the functor $\mathcal{F}(A_1 \times_A A_2) \to \mathcal{F}(A_1) \times_{\mathcal{F}(A)} \mathcal{F}(A_2)$ is an equivalence of categories. Observe that $$ \xymatrix{ \Spec(A) \ar[r] \ar[d] & \Spec(A_2) \ar[d] \\ \Spec(A_1) \ar[r] & \Spec(A_1 \times_A A_2) } $$ is a pushout diagram as in More on Morphisms, Lemma \ref{more-morphisms-lemma-pushout-along-thickening}. Thus the lemma follows immediately from More on Morphisms, Lemma \ref{more-morphisms-lemma-equivalence-categories-schemes-over-pushout-flat} as this describes the category of schemes flat over $A_1 \times_A A_2$ as the fibre product of the category of schemes flat over $A_1$ with the category of schemes flat over $A_2$ over the category of schemes flat over $A$.
The obvious map of deformation categories $\Deformationcategory_{X \to Y} \to \Deformationcategory_X \times \Deformationcategory_Y$ gives two of the arrows in the exact sequence of the lemma. Recall that $\text{Inf}(\Deformationcategory_{X \to Y})$ is the set of automorphisms of the trivial deformation $$ f' :  X' = X \times_{\Spec(k)} \Spec(k[\epsilon]) \xrightarrow{f \times \text{id}} Y' = Y \times_{\Spec(k)} \Spec(k[\epsilon]) $$ of $X \to Y$ to $k[\epsilon]$ equal to the identity modulo $\epsilon$. This is clearly the same thing as pairs $(\alpha, \beta) \in \text{Inf}(\Deformationcategory_X \times \Deformationcategory_Y)$ of infinitesimal automorphisms of $X$ and $Y$ compatible with $f'$, i.e., such that $f' \circ \alpha = \beta \circ f'$. By Deformation Theory, Lemma \ref{defos-lemma-huge-diagram-ringed-spaces} for an arbitrary pair $(\alpha, \beta)$ the difference between the morphism $f' : X' \to Y'$ and the morphism $\beta^{-1} \circ f' \circ \alpha : X' \to Y'$ defines an elment in $$ \text{Der}_k(\mathcal{O}_Y, f_*\mathcal{O}_X) = \Hom_{\mathcal{O}_Y}(\Omega_{Y/k}, f_*\mathcal{O}_X) $$ Equality by More on Morphisms, Lemma \ref{more-morphisms-lemma-netherlander-quasi-coherent}. This defines the last top horizontal arrow and shows exactness in the first two places. For the map $$ \text{Der}_k(\mathcal{O}_Y, f_*\mathcal{O}_X) \to T\Deformationcategory_{X \to Y} $$ we interpret elements of the source as morphisms $f_\epsilon : X' \to Y'$ over $\Spec(k[\epsilon])$ equal to $f$ modulo $\epsilon$ using Deformation Theory, Lemma \ref{defos-lemma-huge-diagram-ringed-spaces}. We send $f_\epsilon$ to the isomorphism class of $(f_\epsilon : X' \to Y')$ in $T\Deformationcategory_{X \to Y}$. Note that $(f_\epsilon : X' \to Y')$ is isomorphic to the trivial deformation $(f' : X' \to Y')$ exactly when $f_\epsilon  = \beta^{-1} \circ f \circ \alpha$ for some pair $(\alpha, \beta)$ which implies exactness in the third spot. Clearly, if some first order deformation $(f_\epsilon : X_\epsilon \to Y_\epsilon)$ maps to zero in $T(\Deformationcategory_X \times \Deformationcategory_Y)$, then we can choose isomorphisms $X' \to X_\epsilon$ and $Y' \to Y_\epsilon$ and we conclude we are in the image of the south-west arrow. Therefore we have exactness at the fourth spot. Finally, given two first order deformations $X_\epsilon$, $Y_\epsilon$ of $X$, $Y$ there is an obstruction in $$ ob(X_\epsilon, Y_\epsilon) \in \text{Ext}^1_{\mathcal{O}_X}(Lf^*\NL_{Y/k}, \mathcal{O}_X) $$ which vanishes if and only if $f : X \to Y$ lifts to $X_\epsilon \to Y_\epsilon$, see Deformation Theory, Lemma \ref{defos-lemma-huge-diagram-ringed-spaces}. This finishes the proof.
The existence of a hull follows immediately from Lemmas \ref{lemma-schemes-morphisms-RS} and \ref{lemma-proper-schemes-morphisms-TI} and Formal Deformation Theory, Lemma \ref{formal-defos-lemma-RS-implies-S1-S2} and Remark \ref{formal-defos-remark-compose-minimal-into-iso-classes}. \medskip\noindent Assume $\text{Der}_k(\mathcal{O}_X, \mathcal{O}_X) = \text{Der}_k(\mathcal{O}_Y, \mathcal{O}_Y) = 0$. Then the exact sequence of Lemma \ref{lemma-schemes-morphisms-TI} combined with Lemma \ref{lemma-schemes-TI} shows that $\text{Inf}(\Deformationcategory_{X \to Y}) = 0$. Then $\Deformationcategory_{X \to Y}$ and $F$ are equivalent by Formal Deformation Theory, Lemma \ref{formal-defos-lemma-infdef-trivial}. Hence $F$ is a deformation functor (because $\Deformationcategory_{X \to Y}$ is a deformation category) with finite tangent space and we can apply Formal Deformation Theory, Theorem \ref{formal-defos-theorem-Schlessinger-prorepresentability}.
We construct a quasi-inverse to the forgetful functor of the lemma. Namely, suppose that $(A, U)$ is an object of $\Deformationcategory_X$. The given map $X \to U$ is a finite order thickening and we can use it to identify the underlying topological spaces of $U$ and $X$, see More on Morphisms, Section \ref{more-morphisms-section-thickenings}. Thus we may and do think of $\mathcal{O}_U$ as a sheaf of $A$-algebras on $X$; moreover the fact that $U \to \Spec(A)$ is flat, means that $\mathcal{O}_U$ is flat as a sheaf of $A$-modules. In particular, we have a filtration $$ 0 = \mathfrak m_A^n\mathcal{O}_U \subset \mathfrak m_A^{n - 1}\mathcal{O}_U \subset \ldots \subset \mathfrak m_A^2\mathcal{O}_U \subset \mathfrak m_A\mathcal{O}_U \subset \mathcal{O}_U $$ with subquotients equal to $\mathcal{O}_X \otimes_k \mathfrak m_A^i/\mathfrak m_A^{i + 1}$ by flatness, see More on Morphisms, Lemma \ref{more-morphisms-lemma-deform} or the more general Deformation Theory, Lemma \ref{defos-lemma-deform-module}. Set $$ \mathcal{O}_V = f_*\mathcal{O}_U $$ viewed as sheaf of $A$-algebras on $Y$. Since $R^1f_*\mathcal{O}_X = 0$ we find by the description above that $R^1f_*(\mathfrak m_A^i\mathcal{O}_U/\mathfrak m_A^{i + 1}\mathcal{O}_U) = 0$ for all $i$. This implies that the sequences $$ 0 \to (f_*\mathcal{O}_X) \otimes_k \mathfrak m_A^i/\mathfrak m_A^{i + 1} \to f_*(\mathcal{O}_U/\mathfrak m_A^{i + 1}\mathcal{O}_U) \to f_*(\mathcal{O}_U/\mathfrak m_A^i\mathcal{O}_U) \to 0 $$ are exact for all $i$. Reading the references given above backwards (and using induction) we find that $\mathcal{O}_V$ is a flat sheaf of $A$-algebras with $\mathcal{O}_V/\mathfrak m_A\mathcal{O}_V = \mathcal{O}_Y$. Using More on Morphisms, Lemma \ref{more-morphisms-lemma-first-order-thickening} we find that $(Y, \mathcal{O}_V)$ is a scheme, call it $V$. The equality $\mathcal{O}_V = f_*\mathcal{O}_U$ defines a morphism of ringed spaces $U \to V$ which is easily seen to be a morphism of schemes. This finishes the proof by the flatness already established.
Let $A_1 \to A$ and $A_2 \to A$ be morphisms of $\mathcal{C}_\Lambda$. Assume $A_2 \to A$ is surjective. According to Formal Deformation Theory, Lemma \ref{formal-defos-lemma-RS-2-categorical} it suffices to show that the functor $\mathcal{F}(A_1 \times_A A_2) \to \mathcal{F}(A_1) \times_{\mathcal{F}(A)} \mathcal{F}(A_2)$ is an equivalence of categories. Observe that $$ \xymatrix{ \Spec(A) \ar[r] \ar[d] & \Spec(A_2) \ar[d] \\ \Spec(A_1) \ar[r] & \Spec(A_1 \times_A A_2) } $$ is a pushout diagram as in Pushouts of Spaces, Lemma \ref{spaces-pushouts-lemma-pushout-along-thickening}. Thus the lemma is a special case of Pushouts of Spaces, Lemma \ref{spaces-pushouts-lemma-equivalence-categories-spaces-pushout-flat}.
Recall that $\text{Inf}(\Deformationcategory_X)$ is the set of automorphisms of the trivial deformation $X' = X \times_{\Spec(k)} \Spec(k[\epsilon])$ of $X$ to $k[\epsilon]$ equal to the identity modulo $\epsilon$. By Deformation Theory, Lemma \ref{defos-lemma-deform-spaces} this is equal to $\text{Ext}^0_{\mathcal{O}_X}(\NL_{X/k}, \mathcal{O}_X)$. The equality $\text{Ext}^0_{\mathcal{O}_X}(\NL_{X/k}, \mathcal{O}_X) = \Hom_{\mathcal{O}_X}(\Omega_{X/k}, \mathcal{O}_X)$ follows from More on Morphisms of Spaces, Lemma \ref{spaces-more-morphisms-lemma-netherlander-quasi-coherent}. The equality $\Hom_{\mathcal{O}_X}(\Omega_{X/k}, \mathcal{O}_X) = \text{Der}_k(\mathcal{O}_X, \mathcal{O}_X)$ follows from More on Morphisms of Spaces, Definition \ref{spaces-more-morphisms-definition-sheaf-differentials} and Modules on Sites, Definition \ref{sites-modules-definition-module-differentials}. \medskip\noindent Recall that $T_{x_0}\Deformationcategory_X$ is the set of isomorphism classes of flat deformations $X'$ of $X$ to $k[\epsilon]$, more precisely, the set of isomorphism classes of $\Deformationcategory_X(k[\epsilon])$. Thus the second statement of the lemma follows from Deformation Theory, Lemma \ref{defos-lemma-deform-spaces}.
By the lemma we have to show $\Ext^1_{\mathcal{O}_X}(\NL_{X/k}, \mathcal{O}_X)$ and $\Ext^0_{\mathcal{O}_X}(\NL_{X/k}, \mathcal{O}_X)$ are finite dimensional. By More on Morphisms of Spaces, Lemma \ref{spaces-more-morphisms-lemma-netherlander-fp} and the fact that $X$ is Noetherian, we see that $\NL_{X/k}$ has coherent cohomology sheaves zero except in degrees $0$ and $-1$. By Derived Categories of Spaces, Lemma \ref{spaces-perfect-lemma-ext-finite} the displayed $\Ext$-groups are finite $k$-vector spaces and the proof is complete.
The existence of a hull follows immediately from Lemmas \ref{lemma-spaces-RS} and \ref{lemma-proper-spaces-TI} and Formal Deformation Theory, Lemma \ref{formal-defos-lemma-RS-implies-S1-S2} and Remark \ref{formal-defos-remark-compose-minimal-into-iso-classes}. \medskip\noindent Assume $\text{Der}_k(\mathcal{O}_X, \mathcal{O}_X) = 0$. Then $\Deformationcategory_X$ and $F$ are equivalent by Formal Deformation Theory, Lemma \ref{formal-defos-lemma-infdef-trivial}. Hence $F$ is a deformation functor (because $\Deformationcategory_X$ is a deformation category) with finite tangent space and we can apply Formal Deformation Theory, Theorem \ref{formal-defos-theorem-Schlessinger-prorepresentability}.
Suppose that $M'$ is as in (1). Then $$ M = M' \otimes_P P' = M' \otimes_{A'} A = M' \otimes_A^\mathbf{L} A' = M' \otimes_{P'}^\mathbf{L} P $$ The first two equalities are clear, the third holds because $M'$ is flat over $A'$, and the fourth holds by More on Algebra, Lemma \ref{more-algebra-lemma-base-change-comparison}. Thus (2) holds. Conversely, suppose $K'$ is as in (2). We may and do assume $M$ is nonzero. Let $t$ be the largest integer such that $H^t(K')$ is nonzero (exists because $M$ is nonzero). Then $H^t(K') \otimes_{P'} P = H^t(K' \otimes_{P'}^\mathbf{L} P)$ is zero if $t > 0$. Since the kernel of $P' \to P$ is nilpotent this implies $H^t(K') = 0$ by Nakayama's lemma a contradiction. Hence $t = 0$ (the case $t < 0$ is absurd as well). Then $M' = H^0(K')$ is a $P'$-module such that $M = M' \otimes_{P'} P$ and the spectral sequence for Tor gives an injective map $$ \text{Tor}_1^{P'}(M', P) \to H^{-1}(M' \otimes_{P'}^\mathbf{L} P) = 0 $$ By the reference on derived base change above $0 = \text{Tor}_1^{P'}(M', P) = \text{Tor}_1^{A'}(M', A)$. We conclude that $M'$ is $A'$-flat by Algebra, Lemma \ref{algebra-lemma-what-does-it-mean}.