This is regarding a question about Theorem 3.2 in Chapter I of Hartshorne's Algebraic Geometry.
Let $Y \subset \mathbb{A}^n$ be an affine variety with affine coordinate ring $A(Y)$. The final item (d) in the statement is
(d) $K(Y)$, the function field of $Y$, is isomorphic to the quotient field of $A(Y)$....
The argument is given as " From (c) it follows that the quotient field of $A(Y)$ is isomorphic to the quotient field of $\mathcal{O}_P$ for every $P$, and this is equal to $K(Y)$, because every rational function is actually in some $\mathcal{O}_P$."
Could somebody explain this statement in detail? How is the quotient field of $\mathcal{O}_P$ isomorphic to $K(Y)$, and how does this follow as explained in "because every rational function is actually in some $\mathcal{O}_P$. It is true that $\bigcup_{P \in Y} \mathcal{O}_P = K(Y)$, but how does taking the quotient field of ONE $\mathcal{O}_P$ gives us $K(Y)$?
Thanks for the help.
Question: "Could somebody explain this statement in detail?"
Answer: Let $A:=A(Y)$ be the coordinate ring of $Y$, which is an integral domain. There is for every $V \subseteq Y \subseteq Y$ pair of open subsets, canonical maps $\rho_{Y,U}: A(Y) \rightarrow \mathcal{O}(U)$ commuting with the restriction map
$$\mathcal{O}(U) \rightarrow \mathcal{O}(V).$$
Here $\mathcal{O}(U)$ is the ring of regular functions on $U$. For any element $f \in\mathcal{O}(U)$ it follows the equivalence class $<U,f> \in K(Y)$ (this is the notation in HH, CH.I.3). In particular we get a canonical map
$$\rho: A(Y) \rightarrow K(Y)$$
defined by
$$\rho(s):=<Y,s> \in K(Y).$$
if $s\neq 0$ it follows $Z(s) \subsetneq Y$ is a strict closed subset and $U:=Y-Z(s) \subseteq Y$ is a non-empty open set. It follows $<U,1/s>\in K(Y)$ hence $\rho(s)\in K(Y)$ is invertible and there is an induced sequence of injections
$$A(Y) \rightarrow K(A(Y)) \rightarrow^{\eta} K(Y)$$
hence $K(A(Y)) \subseteq K(Y)$ is an inclusion. Given any element $<U,f>\in K(Y)$ and a point $p\in U$ there is an open subset $p \in U_p \subseteq U$ and regular functions $g,h\in A(Y)$ with $h \neq 0$ on $U_p$ and $<U,f> \cong <U_p,g/h>$ in $K(Y)$. It follows $g/h \in K(A(Y))$ and $\eta(g/h)=<U,f>.$ Hence the map $\eta: K(A(Y)) \rightarrow K(Y)$ is surjective. This implies the inclusion $K(A(Y)) \subseteq K(Y)$ is an isomorphism.