Let $f(x\_1,\ldots,x\_n)\in\mathbf{Z}[x\_1,\ldots,x\_n]$ be a polynomial. Assume that the variety cut out by $f$ is smooth and connected (so irreducible) over $\overline{\mathbf{Q}}$. Where can I find a proof of the following classical result: for almost all primes $p$, $f\pmod{p}$ is a smooth $\mathbb{F}\_p$-scheme. 


**added**


Let me rephrase the problem a bit differently. 
Let us denote the zero locus in a field $k$ of a family of polynomials $\mathcal{F}$ with $\mathbf{Z}$-coefficients by $Z(\mathcal{F};k)$.
Let $\nabla(f)=(g\_1,g\_2,\ldots,g\_n)$.
So assume that 
$$
Z(g\_1,g\_2,\ldots,g\_n,f;\overline{\mathbf{Q}})=\emptyset
$$
How do you prove that for almost all primes $p$
$$
Z(g\_1,g\_2,\ldots,g\_n,f;\overline{\mathbf{F}\_p})=\emptyset ?
$$



smooth connected affine scheme over Z has good reduction almost everywhere
I will first respond to the added question and then, for the sake of (likely unnecessary) completeness, give a few more details for the sort of argument that Ari proposed.


Let $g\_1,\dotsc,g\_r,f$ be elements of $S = \mathbf{Z}[x\_1,\dotsc,x\_n]$. In the rephrased question, one assumes $Z(g\_1,\dotsc,g\_r,f;\overline{\mathbf{Q}})=\emptyset$. By the Nullstellensatz, one then knows that $g\_1,\dotsc,g\_r,f$ generate the unit ideal in $S\otimes\_\mathbf{Z}\mathbf{Q}$, i.e. that there is a relation
$$
a\_1 g\_1 + \dotsb + a\_r g\_r + b f = 1,
$$
where $a\_1,\dotsc,a\_r,b\in S\otimes\_\mathbf{Z} \mathbf{Q}$. The polynomials $a\_1,\dotsc,a\_r,b$ have a common denominator $N$, and so they belong to $S\otimes\_{\mathbf{Z}}\otimes{\mathbf{Z}[1/N]}$, and the above equation holds in this ring as well. It thus holds in all quotients of this ring, and thus for $p$ prime to $N$, there are no solutions in $\overline{F\_p}$.




---


Perhaps it is also worth making something like Ari's argument even more explicit and concrete to make clear the role $\nabla$ in Hugo's addition. Consider first a more general setting of an ideal $I$ in $S = R[x\_1,\dotsc,x\_n]$. Let $A = S/I$. The scheme morphism ${\rm Spec}(A)\to {\rm Spec}(R)$ is smooth precisely when the usual map $I/I^2\to \Omega^1\_{S/R}\otimes\_S A$ defined by $f\mapsto df\otimes 1$ is a split injection: the nilsquare lifting property for ${\rm Spec}(A)\to {\rm Spec}(R)$ is a direct consequence of the existence of a splitting and of the smoothness of ${\rm Spec}(S)\to{\rm Spec}(R)$.


(I will spell this ``direct consequence'' out: to see the nilsquare lifting property in general, by the smoothness of $S/R$ (for which the lifting property is trivial), it is enough to consider the problem of lifting the identity map $A\to A$ along $S/I^2\to A$. We have the quotient map $S\to S/I^2$, and the splitting $s$ in question tells us exactly how to modify the quotient map so that it vanishes on $I$ and thus factors through $A$; indeed, the map $f\mapsto \overline{f} - s(df\otimes 1)$ is another homomorphism $S\to S/I^2$ lifting $S\to A$, and it vanishes on $I$ by definition. Conversely, if we know that $A/R$ is smooth, then reversing these steps and applying the nilsquare lifting property to lift the identity map $A\to A$ along $S/I^2\to A$ provides us with a splitting.)


Turning to the case in question, we take first $R = \mathbf{Q}$ and $I = (f)$. The $A$-module $I/I^2$ is free of rank $1$ with generator $f$. By the smoothness assumption (which we may make over $\mathbf{Q}$ just as well as over $\overline{\mathbf{Q}}$ without changing the problem), there is a splitting $s:\Omega^1\_{S/R}\otimes\_S A\to I/I^2$. Let $a\_i f = s(dx\_i\otimes 1)$. Since the image of the generator $f$ of $I/I^2$ in $\Omega^1\_{S/R}\otimes\_S A$ is $\sum\_i (\partial f/\partial x\_i) (dx\_i\otimes 1)$, we have
$$
\sum\_i \frac{\partial f}{\partial x\_i} a\_i = 1,
$$
i.e. the $\partial f/\partial x\_i$ generate the unit ideal in $A$. Conversely, if the $\partial f/\partial x\_i$ generate the unit ideal and we have such $a\_i$, we can construct a splitting $dx\_i\mapsto a\_i$. Thus smoothness for $I=(f)$ is equivalent to the fact that the $\partial f/\partial x\_i$ generate the unit ideal in $A$.


Now we can see how smoothness spreads out from the generic fiber: the $a\_i$ all belong to the subring $\mathbf{Z}[1/N][x\_1,\dotsc,x\_n]/(f)$ of $A$ for some $N$. The $\partial f/\partial x\_i$ thus generate the unit ideal in $\mathbf{Z}[1/N][x\_1,\dotsc,x\_n]/(f)$, which allows us to construct the splitting and hence to get smoothness of $\mathbf{Z}[1/N][x\_1,\dotsc,x\_n]/(f)$ over $\mathbf{Z}[1/N]$. Reducing mod $p$, we get smoothness over $\mathbf{F}\_p$ whenever $p$ is prime to $N$.


