I'm trying to learn some deformation theory, but I'm stuck on the proof of corollary 4.7 in https://math.berkeley.edu/~robin/math274root.pdf
Let $X$ be an affine nonsingular scheme of finite type over some algebraically closed field $k$. Let $D = k[\epsilon]/(\epsilon^2)$, and let $X'$ be an infinitesimal deformation of $X$ over $D$ (ie, the $X'$ is flat over $D$, and the reduced fiber is $X$).
The infinitesimal lifting property for nonsingular affine schemes then implies that if $i : X\rightarrow X'$ is the inclusion, then there exists a map $g : X'\rightarrow X$ such that $g\circ i = \text{id}_X$.
My question is: Why does this imply that $X'$ is the trivial deformation? (ie, that $X' = X\times_k D$)?
Note first of all that $X'$ is affine as well (an extension of an affine scheme by a nilpotent sheaf is affine). So say we have $X=Spec(A)$, $X'=Spec(A')$. Your morphism $g:X'\to X$ and the structure morphism $X'\to Spec(D)$ give you a morphism $X'\to X\times_{k} D$ restricting to the identity on $X$. So we have a morphism $f:A\otimes_{k} D\to A'$ of flat $D$-algebras, inducing an isomorphism $A\cong A'\otimes k$.
Now one can show that $f$ is an isomorphism. Consider for instance the exact sequence $A\otimes_{k} D\xrightarrow{f} A'\to coker(f)\to 0$ over $D$, and tensor this with $k$, then you get $coker(f)\otimes_{D} k=0$, and by Nakayama $coker(f)=0$.
For injectivity take $0\to ker(f) \to A\otimes_{k} D\xrightarrow{f} A'\to 0$. Now since $A'$ is flat over $D$ we get $Tor^{D}_{1}(A',k)=Tor^{D}_{1}(k, A')=0$ and hence $ker(f)\otimes_{D} k=0$. So again by Nakayama we have $ker(f)=0$.
Note that the proof works also if we replace $D$ by any local Artin $k$-algebra