Hartshorne exercise 1.3.8 I'm trying to solve exercise 1.3.8 from Hartshorne's Algebraic Geometry:


  Let $ H_{i} $ and $ H_{j} $ be the hyperplanes in $ \mathbb{P}^n $ defined by $ x_i = 0 $ and $ x_j = 0 $ with $ i \neq j $. I Show that any regular function on $\Bbb{P}^n - (H_i \cap H_j)$ is constant.


I found a solution set online claiming that $ \mathcal{O}(\mathbb{P}^n - H_i) \cong (k[x_0,\ldots,x_n]_{x_i})_{0} $. This is used to show that any regular function is equal to $ f_i/x_i^a = f_j/x_j^b $ and then this forces the function to be constant.

I don't know where the first isomorphism comes from. I can't find such a theorem in the book up to the end of section 3 in chapter 1. The difficulty I'm having is that $ \mathbb{P}^n - H_i $ is not closed, so it is not a projective variety. The theorems up until that point in the book are only applicable to projective varieties as far as I can tell.

I feel that I'm missing something obvious here. Any help would be appreciated.
This isomorphism appears in the first paragraph of the proof of Theorem 3.4.

More generally, if $Y$ is projective, $Y - \{f=0\}$ is isomorphic to the affine variety $\operatorname{Spec} (({S(Y)}_f)_0)$.  We have $K(Y)=S(Y)_0$, and a function is defined on all of $Y-\{f = 0\}$ exactly when its denominator is a power of $f$.
This isomorphism appears in the first paragraph of the proof of Theorem 3.4.

More generally, if $Y$ is projective, $Y - \{f=0\}$ is isomorphic to the affine variety $\operatorname{Spec} (({S(Y)}_f)_0)$.  We have $K(Y)=S(Y)_0$, and a function is defined on all of $Y-\{f = 0\}$ exactly when its denominator is a power of $f$.