Is the projective closure of a smooth variety still smooth?

Let $X$ be a closed subscheme of $\mathbb{A^n}$ (over a basefield) defined by an ideal $I$ and consider the immersion $\mathbb{A^n}\to \mathbb{P^n}$, $(x_1,\ldots, x_n)\mapsto [x_1,\ldots,x_n,1]$. One may consider the projective variety $\bar X$ in $\mathbb{P^n}$ given by the homogenized ideal $\bar I$. This ideal consists of the homogenized elements of $I$, so for example if $f=x_1^2+x_2+1$ is in $I$ then $\bar f=x_1^2+x_2x_{n+1}+x_{n+1}^2$ is in $\bar I$. Then $\bar X$ is the projective closure of the image of $X$ under $\mathbb{A^n}\to \mathbb{P^n}$, right? I wonder if smoothness is inherited.

If $X$ is a smooth affine scheme over the base field, is $\bar X$ smooth, too?

Solutions Collecting From Web of "Is the projective closure of a smooth variety still smooth?"

No, smoothness of $X$ is not inherited by $\bar X$.
Take two parallel lines in $\mathbb A^2_k$. Their union $X\subset \mathbb A^2_k$ is a smooth scheme but the lines meet at a singular point of $\bar X $ at infinity, so that $\bar X \subset \mathbb P^2_k$ is no longer smooth.
Renaissance artists, who invented perspective, have given us beautiful paintings of these schemes.

In some sense the opposite is true. Namely, let $X \subset \mathbb{P}^n$ be an irreducible quasi-projective variety (over an algebraically closed field, let us say). Then there is a proper closed subvariety $S \subset X$ consisting of the singular points, so $Y = X \setminus S$ is a smooth quasi-projective variety.

In other words, if the answer to your question were “yes” then all varieties would be smooth!

No. There is no reason for the curve to be smooth at the points at infinity. For simplicity I will give a counterexample for algebraically closed fields of characteristic not $2$ or $3$. Consider the curve $X$ in $\mathbb{A}^2$ defined by the equation
$$x y^2 – 1 = 0$$
It is straightforward to verify that
$$y^2 \, \mathrm{d}x + 2 x y \, \mathrm{d} y$$
is nowhere vanishing on $X$, so $X$ is non-singular.

The projective closure $\overline{X}$ in $\mathbb{P}^2$ is defined by the equation
$$x y^2 – z^3 = 0$$
Now, let us consider the affine piece $\overline{X} \cap \{ x \ne 0 \}$. This is the affine curve defined by the equation
$$y^2 – z^3 = 0$$
and it is readily checked that this curve has a cusp at $(0, 0)$. Thus the curve $\overline{X}$ is singular at the point $(1 : 0 : 0)$ (and, in fact, only there).

That said, at least for non-singular curves $X$, there is always a non-singular projective curve containing $X$ as a dense open subvariety. This is done in e.g. Hartshorne [Ch. I, §6]. The only thing is that this projective curve may live in a projective space of higher dimension than the affine space you started with!

Lots of good answers here already, but here’s another reason why your statement is false. Consider a singular projective variety $X \subseteq \mathbb{P}^n$ and suppose that the singular locus is contained in a hyperplane $H \subseteq \mathbb{P}^n$. (For example, any plane curve with a unique singular point fits this description.) Then $X' = X \setminus X \cap H$ is a smooth affine variety (sitting in $\mathbb{A}^n \cong \mathbb{P}^n \setminus H$) whose projective closure is the singular variety $X$.