I have a question about the deformation theory as presented in Hartshorne's book. It is about the deformation problem $D$, maybe better known as abstract deformations, concerning deformations without an ambient scheme. Let me cite how Hartshorne defines the problem:
Consider the diagram $X \to \text{Spec}(k) \leftarrow \text{Spec}(A)$ with $A$ Artinian. A deformation of $X$ over $A$ is scheme $X'$ flat over $A$ with a closed immersion $X \hookrightarrow X'$ such that the induced map $X \to X' \times_A k$ is an iso. (Roughly speaking $X$ is is the fibered product in a nice way.)
Now Hartshorne considers deformations of affine schemes first, i.e. $X = \text{Spec}(R)$ say. Now what bothers me is that he supposes that any deformation $X'$ of $\text{Spec}(R)$ over $A$ is affine without explaining why. Could you please explain why $X'$ should be affine in this case?
My thoughts
Here I review my own ideas so that you know what I tried to solve the issue. Basically what we have to show that the following implications holds:
$$ X' \times_A k \ \text{ is affine} \quad \quad \Longrightarrow \quad \quad X' \ \text{ is affine}. $$ I have very little feeling for fibered products of schemes, but this seems to me that passing from $X'$ to $X' \times_A k$ is like replacing a (maybe rather involved) ring $A$ by a (simpler) field. Couldn't that dramaticly simplify things. It would not surprise me if $X' \times_A k$ would suddenly become affine even though $X$ isn't. (What is wrong about this idea?)
I assume that $(A,m_A,k)$ is artinian local. The base change $X\to X'$ of the closed immersion $\rm{Spec}k\to\rm{Spec}A$ is also a closed immersion. Claim: the corresponding ideal sheaf $\mathcal{I}$ on $X'$ is nilpotent. (The result follows by EGA-I, ChI, 5.1.9.)
$X'$ has an affine cover. To show the claim, it suffices to work on each affine open. Assume that $X'$ is the affine scheme $\rm{Spec}(B)$ (this assumption $\neq$ we proved the desired result).
Then $X=\rm{Spec}(B\otimes_Ak)=\rm{Spec}(B/m_AB)$. Since $A$ is artinian, $m_A^n=0$ for some $n\ge1$, then $(m_AB)^n=0$. This $n$ is independent of the affine open we picked. So, $\mathcal{I}^n=0$. The claim is proved.