Smooth variety contained in another smooth variety

I apologize if this is a trivial question. If $X$ is a smooth irreducible codimension two subvariety of projective space $\mathbb P^n$, then does there always exist a smooth irreducible codimension one subvariety $Y \subset \mathbb P^n$ with $X \subset Y$ ?

-
Perhaps something like this would work? The ideal sheaf $I_Y(m)$ is generated by global sections for $m\gg 0$, by Serre's theorem. Fix such an $m>0$. Note that the general element in the linear system $H^0(I_Y(m))$ is smooth away from $Y$ by Bertini's theorem. So you are reduced to showing that the general element is smooth on $Y$. – J.C. Ottem Feb 22 '12 at 22:35
For curves in $\mathbb{P}^3$, the following argument works: taking cohomology of the conormal sequence shows that global sections of $I_Y(m)$ give global generating sections of $N_Y^*(m)$, which is a vector bundle on $Y$ since $Y$ is assumed smooth. But general sections of $N_Y^*(m)$ do not vanish on on $Y$ (since such such loci have expected codimension 2). – J.C. Ottem Feb 22 '12 at 22:36
In case the complete intersection argument isn't obvious, if the variety is a complete intersection, then if one of the generators had vanishing derivatives somewhere on $Y$, the tangent space would have a dimension too high and form a singularity. – Will Sawin Feb 22 '12 at 22:44

For $n = 3$ this is always true. It is also true when $X$ is a complete intersection.

Suppose $n ≥ 4$, and suppose that $Y$ exists; then by a well known result of Lefschetz $X$ is a hyperplane section of $Y$, and so $X$ is a complete intersection. Now, for $m = 4$ there are subvarieties of $\mathbb P^4$ that are not complete intersections (for example, the image of a generic projection $\mathbb P^2 \to \mathbb P^4$ of a quadratic Veronese embedding of $\mathbb P^2 \subseteq \mathbb P^5$), so the answer is negative for these. For $m ≥ 5$ the existence of codimension 2 subvarieties that are not complete intersections is a big open question; for $m ≥ 7$ it is a particular case of a conjecture of Hartshorne that these should not exist.

-
Thank you Angelo. – Parsa Feb 23 '12 at 7:25

The obvious thing to do is to choose $H$ a general hypersurface containing $X$. In other words, choose a general global section of $I_X \otimes O_{P^n}(k)$ for $k \gg 0$.

Certainly $H$ is smooth away from $X$ by Bertini. I don't see why it should be smooth along $H$ though (unless of course, $X$ is a complete intersection).

In general, you are still ok locally, in other words a regular ring is always locally a complete intersection, so in a neighborhood of every point there is such a variety which is smooth near that point (they might not glue, or be smooth elsewhere though). This follows from page 171 of Matsumura's Commutative Ring Theory. See in particular 21.2(ii).

-
Thank you Karl. So what you're saying is that I can find an irreducible hypersurface containing $X$ that is smooth away from $X$, even if $X$ is not a complete intersection? – Parsa Feb 23 '12 at 7:27
Parsa, that's true. Or for each point $z$ of $X$, you can find one that is smooth near $z$ (but then they don't glue). – Karl Schwede Feb 23 '12 at 12:34
Perhaps one should also point out that you can always guarantee that $H$ is irreducible (also by Bertini). You can also guarantee that $H$ is normal I think, so at least $X$ is a Weil divisor on $H$. – Karl Schwede Feb 23 '12 at 12:45