# Prove that for each $p \in Y$ the quotient field of $O_p$ is isomorphic to the field $K(Y)$.

I'm reading Algebraic Geometry of Hartshorne. I have a question about a proof. First of all I'll write the important definitions that Hartshorne uses.

Let $Y\subset \mathbb{A}^n$ be a quasi-affine variety.

• A function $f:Y\to \mathbb{k}$ is said to be regular at $P\in Y$ if is an open neighborhood $U$ of $P$ such that $U\subset Y$ and polynomials $g,h\in A=\mathbb{k}[x_1,...,x_n]$ such that $h$ is nowhere zero on $U$ and $f=g/h$ on $U$. We say that $f$ is regular at $Y$ if is regular at each $P\in Y$.

• We denote by $O(Y)$ the ring of all regular functions on $Y$. If $P\in Y$, we define the local ring of $P$ on $Y$, $O_P$ to be the ring of germs of regular functions on $Y$ near $P$. In other words, an element of $O_P$ is a pair $\left<U,f\right>$ where $U$ is an open neighborhood of $P$ and $f$ is regular on $U$. And where we identify two pairs $\left<U,f \right>$ and $\left<V,g \right>$ if $f=g$ on $U\cap V$.

• Finally we define the function field $K(Y)$ as the set of equivalence relations, given by elements of the form $\left<U,f \right>$ for some $U$ open subset of $Y$ (not necessary containing $P$).

The operations that turns $O_p$ and $K(Y)$ into a rings an actually $K(Y)$ into a field are the usual for germs.

I'm reading the proof of Theorem $3.2$, I don't understand the proof of part $d)$. It uses the following observation:

My question: Prove that for each $p \in Y$ the quotient field of $O_p$ is isomorphic to the field $K(Y)$.

An element $z \in Frac(O_P)$ is writen in the form $z=f/g$ where $f,g\in O_P$ and $g$ is not the zero on $O_P$. Recall that $f,g$ are equivalence classes of the form $\left<U,f \right>$ and $\left<V,g \right>$, without lost of generality we can assume that $U=V$ otherwise we intersect the open sets and restrict the functions. I think that the most natural map is given by $\phi: Frac(O_p) \to K(Y)$ defined by:

$$\left<U,f \right> / \left<U,g \right> \mapsto \left<U,f/g \right>$$

I proved that $\phi$ is an injective ring homomorphism. I think that this is the map that gives the isomorphism, but I'm not sure how to prove that it's surjective (or it's not but I don't think so).

Fix $[(U,f)] \in K(Y)$ an equivalence class of regular functions. Let $V \subseteq U$ be any open subset such that there exist polynomials $g$ and $h$ with $Z(h) \cap V = \emptyset$ and $(U,f) \sim (V,g/h)$. We then have both $[(Y,g)]$ and $[(Y,h)]$ elements of $\mathscr{O}_P$. Since $h$ is not the zero polynomial, it is not the zero element of $\mathscr{O}_P$, and also $Z(h) \neq Y$. So $\phi$ sends the element $[(Y,g)]/[(Y,h)]$ in the field of fractions of $\mathscr{O}_P$ to $[(Y\setminus Z(h),g/h)] \in K(Y)$, and this is precisely $[(U,f)]$.
By the way, you have made a slight error in your definition of $\phi$. You will need to set $$\phi\left(\frac{[(U,f)]}{[(V,g)]}\right) = [(W,f/g)],$$ where $W = (U \cap V) \setminus Z(g)$.