Check that a surface over $\mathbb Z$ is regular Let $X$ be an arithmetic surface over $\mathbb Z$ with smooth generic fibre (which is a curve over $\mathbb Q$). Moreover assume that $X$ is given by one equation $F=0$.
added later: In other words, the generic fibre is expressed as a plane curve over $\mathbb Q$.
Now let $x\in X$ be a closed point. How do I check if $X$ is regular at $X$? Ok, formally I must show that $\mathcal O_{X,x}$ is a regular local ring (of Krull dimension 2). But in more concrete terms what should I do with my $F$? I mean, if $X$ was a variety over a field, I could use the Jacobian criterion, but what about this particular case where the base is $\operatorname{Spec} \mathbb Z$?
Remark: With the term arithmetic surface I mean an integral projective scheme of dimension $2$ which is flat over $\mathbb Z$.
 A: Regularity is a local notion so we can work in affine coordinates $x,y$. The scheme $X$ is automatically regular at every point at which $X/\operatorname{Spec}\mathbb Z$ is smooth by the regularity of $\operatorname{Spec}\mathbb Z$. These are precisely the points satisfying the Jacobian criterion. Now, take a closed point $z$ of $X$ at which $X/\mathbb Z$ is not smooth, you have to show that $X$ is regular at $z$. Since the Krull dimension of $X$ at $z$ is $2$, this is equivalent to saying that the maximal ideal $\mathfrak m$ of $z$ in $\mathcal O_{X,z}$ can be generated by two elements. It is hard to say more without knowing what $F$ you are dealing with. By the answer to this question https://mathoverflow.net/questions/97429/maximal-ideals-of-zx-y you can always write $\mathfrak m=(p,f,g)$ where $p$ is a prime number, $f$ is a polynomial in $x$ irreducible mod $p$, and $g$ is a polynomial in $(x,y)$ irreducible mod $p$; and you could for example try to see if, modulo $F$, one of these three generators is in the ideal spanned by the other two.
As an illustrative example, take $F=xy-n$ for some integer $n\in \mathbb N$. A point $z\in X$ at which $X/\mathbb Z$ is not smooth corresponds to a maximal ideal $\mathfrak m$ of $\mathbb Z[x,y]/(F)$ of the form $(x,y,p)$ where $p$ is a prime dividing $n$. Then, $X$ is regular at $z$ if and only if $\mathfrak m$ is generated by two elements, i.e. if and only if $p^2$ does not divide $n$. In that case, $\mathfrak m$ is spanned by $x$ and $y$.
A: $\def\FF{\mathbb{F}}\def\ZZ{\mathbb{Z}}\def\fm{\mathfrak{m}}$You can approach this problem by a variant of the Jacobian criterion. If $A$ is a regular ring of dimension $n$, $\fm$ a maximal ideal, and $f_1$, $f_2$, ..., $f_m \in \fm$, then $A/\langle f_1,\ldots,f_m \rangle$ is regular of dimension $n-m$ at $\fm$ if and only if images of the $f_j$ in $\fm/\fm^2$ are linearly independent. I'll abbreviate $\fm/\fm^2$ to $V$ from now on; it is called the Zariski cotangent space. For $g \in \fm$, we'll write $\overline{g}$ for the class of $g$ in $V$
When $A = k[x_1, \ldots, x_n]$ and $\fm = \langle x_1, \ldots, x_n \rangle$, then a basis for $V$ is the $\overline{x_j}$. For $f \in \fm$, the expansion of $\overline{f}$ in the $\overline{x_j}$ basis is  $\overline{f} = \sum  \tfrac{\partial f}{\partial x_j}(0) \cdot \overline{x_j}$. This is where the Jacobian criterion comes from.
Let's see how to adopt this to $A = \ZZ[x_1, \ldots, x_n]$ and $\fm = \langle x_1, x_2, \ldots, x_n, p \rangle$. Now a basis for $V$ is $\overline{x_1}$, ..., $\overline{x_n}$, $\overline{p}$. For $f \in \fm$, we have
$$\overline{f} = \sum \frac{\partial f}{\partial x_j} \cdot \overline{x_j}(0) + \frac{f(0)}{p} \cdot \overline{p}.$$
Thus, given $f_1$, $f_2$, ..., $f_m$ in $\langle x_1, x_2, \ldots, x_n, p \rangle$, the quotient $\ZZ[x_1, \ldots, x_n]/\langle f_1, \ldots, f_m \rangle$ is regular of dimension $n+1-m$ if and only if the $m \times (n+1)$ matrix
$$\begin{bmatrix}
\tfrac{\partial f_1}{\partial x_1}(0) & \tfrac{\partial f_1}{\partial x_2}(0) & \cdots & \tfrac{\partial f_1}{\partial x_n}(0) & \tfrac{f_1(0)}{p} \\
\tfrac{\partial f_2}{\partial x_1}(0) & \tfrac{\partial f_2}{\partial x_2}(0) & \cdots & \tfrac{\partial f_2}{\partial x_n}(0) & \tfrac{f_2(0)}{p} \\
\vdots&\vdots&&\vdots&\vdots \\
\tfrac{\partial f_m}{\partial x_1}(0) & \tfrac{\partial f_m}{\partial x_2}(0) & \cdots & \tfrac{\partial f_m}{\partial x_n}(0) & \tfrac{f_m(0)}{p} \\
\end{bmatrix}$$
has rank $m$ over $\FF_p$.
This doesn't fully answer your question because a maximal ideal of $\ZZ[x_1, \ldots, x_n]$ could be the kernel of a map $\ZZ[x_1, \ldots, x_n] \to \FF_q$ for $\FF_q$ an extension of $\FF_p$. (EG the maximal ideal $\langle x^2+1, 3 \rangle$ in $\ZZ[x]$.) I started to write out how to deal with that case, but it started getting messy; I'm going to think if I can think of a simpler way to present it.
