= Solution
Let $\mathcal I_Y$ be the <coherent ideal sheaf> of $Y$, and let $\mathfrak m_P$ be the <ideal sheaf of a closed point>. Because $P\notin Y$, the <stalk> $(\mathcal I_Y)_P$ is $\mathcal O_{X,P}$. Evaluation at $P$ therefore gives a <surjective morphism of sheaves> $\mathcal I_Y\to k_P$ to the <skyscraper sheaf> at $P$. Its <kernel> $\mathcal J=\mathcal I_Y\cap\mathfrak m_P$ is again a <coherent ideal sheaf>. From
$$
0\to\mathcal J\to\mathcal I_Y\to k_P\to0
$$
and $H^1(X,\mathcal J)=0$, the <long exact sequence in sheaf cohomology> shows that $\Gamma(X,\mathcal I_Y)\to k$ is onto. Choose $f$ mapping to $1$. It vanishes on $Y$ and satisfies $f(P)=1$. Hence $X_f\subseteq U$, and inside the <affine variety> $U$ it is the <principal open subset> defined by $f|_U$. A principal open of an <affine variety> is affine. This gives <affine principal neighbourhoods from ideal-sheaf vanishing>.
Back to article page