Doubt in my proof of Hartshorne I (4.7). Let $X,Y$ be varieties, and choose points $P$ and $Q$ so that there exists an isomorphism of k-algebras $f^*\colon \mathcal{O}_{P,X} \to \mathcal{O}_{Q,Y}$. Then show that there exists open sets $P \in U \hookrightarrow X$ and $Q \in V \hookrightarrow Y$, so that there is an isomorphism $f\colon U \to V$.
This was my approach:
Let $f\colon X \to Y$. Suppose there exists a k-algebra isomorphism $f^*\colon \mathcal{O}_{P,X} \to \mathcal{O}_{Q,Y}$. Then using corollary 1.4.5, and using that fact that $\mathcal{O}_{P,X} \hookrightarrow K(X)$, we then have that $K(X) \cong K(Y)$. This is precisely the definition of birational equivalence between $X$ and $Y$, by corollary 1.4.5. Thus also noting that $\mathcal O_{P,X}$ is an invariant for any open set $U \hookrightarrow X$, we obtain a birational equivalence between two open sets $U$ and $V$. Namely, there exists a point $Q \in Y$, so that a point $P \in X$ gets mapped through some morphism $f$ to $Q$. //
Is this proof correct? If not, could I have some intuition or motivation (not an answer, I want to do it myself) for a correct proof?
 A: There are couple of issues I notice in your proof:

*

*First, a smaller issue of giving proper justifications: To conclude that $K(X) \cong K(Y)$, you're using more than just that $\mathcal{O}_{P, X}$ is a subset of $K(X)$; you're using that $K(X)$ is the field of fractions of $\mathcal{O}_{P, X}$ (and likewise for $\mathcal{O}_{Q, Y}$ and $K(Y)$).

*Second, a bigger issue with the proof: At this point you've proved that $X$ and $Y$ are birationally equivalent, and hence there are some dense open subsets $U \subseteq X$ and $V \subseteq Y$ such that $U \cong V$. But how do you know you can find such subsets such that $P \in U$ and $Q \in V$? You've essentially swapped some quantifiers here—the points $P$ and $Q$ are fixed from the outset, and cannot depend on the open subsets you construct.

In fact, it's not enough to know that $X$ and $Y$ are birationally equivalent. For example, if $X$ is a singular curve with smooth projective model $Y$, and $P \in X$ is a singular point, then $\mathcal{O}_{P, X}$ is not isomorphic to the local ring $\mathcal{O}_{Q, Y}$ for any point $Q \in Y$, because the local ring detects whether a point is singular.
Here's a hint for a different approach to the problem: You'll likely need to use the definition of the local ring of a variety at a point, and not just the fact that it's a subring of the field of fractions. How is this local ring constructed, and what can you deduce from an isomorphism between such local rings?
