# Given two points $x,y$ in a separated scheme $X$, is there always some function on an open set containing both that distinguishes them?

I'm relatively new to schemes (just started Hartshorne chapter II), and the following question seemed natural to me but I could not determine an answer. Suppose $$X$$ is a separated scheme and $$x,y$$ are two distinct points in $$X$$. Is there always an open set $$U\subset X$$ containing $$x,y$$ and a function $$f\in \mathcal{O}_X(U)$$ so that $$f(x)=0$$ and $$f(y)\neq 0$$ (or the reverse)?

If $$X$$ is affine, say $$\operatorname{Spec} A$$, I think I understand why this has to be the case: saying $$x\notin\overline{\{y\}}$$ is the same thing as saying that the prime ideal corresponding to $$y$$ is not a subset of the prime ideal correpsonding to $$x$$, so we can pick some $$f$$ in the prime ideal corresponding to $$y$$ which isn't in the prime ideal corresponding to $$x$$, and this function vanishes at $$y$$ but not $$x$$. This also handles the case where $$x,y$$ are in a common affine open. But I don't know if $$x,y$$ are always in a common affine open.

Edit: Thanks to the comments (Jyrki Lahtonen and Tabes Bridges) for the advice about including the adjective separated.

Progress: The problem can be reduced to $$X$$ integral (if $$x,y$$ are in different irreducible components, then we can find disjoint neighborhoods and take an indicator function, and nilpotents don't affect the evaluation of functions). Since any two open sets of an irreducible space intersect and the intersection of two affine opens in a separated scheme is again an affine open, we may assume that $$X$$ is the union of $$\operatorname{Spec} A_1$$, containing $$x$$, and $$\operatorname{Spec} A_2$$, containing $$y$$, with intersection $$\operatorname{Spec} B$$ containing neither $$x$$ nor $$y$$. From here the global functions on $$X$$ are the functions in $$A_1\times A_2$$ which lie in the kernel of $$A_1\times A_2\to B$$ by subtracting the images of their components. I don't see how to get the desired function from this, though.

• My first thought is that a line with a double point (at the origin) could give a counterexample. Unfortunately my copy of Hartshorne is inaccessibly in my office. I should, of course, know this without consulting it, but I'm very rusty. The problem could simply be that in this case the functions defined on any open $U$ containing both origins must come from the same rational function, and hence agree on both versions of the origin. Nov 6, 2020 at 8:09
• @JyrkiLahtonen That sounds right, but like something I don't want to think about. Is there a property I can add so that I'm not considering anything with a doubled point like that? In other words, is that sort of point doubling the only way that this can fail? Nov 6, 2020 at 8:17
• @HankScorpio You are looking for separated schemes. Nov 6, 2020 at 12:17
• About your question if two given points on an scheme are both contained in an affine scheme, you can look at math.stackexchange.com/questions/256648/… Nov 6, 2020 at 12:26
• Concretely, if your scheme is quasiprojective over an affine scheme, it is true that any finite set of points is contained in an affine open subscheme. But in general is not an easy question. Nov 6, 2020 at 12:28