TITLE: Hartshorne Ex. 1.3.8 - Where do I take intersections here?
QUESTION [6 upvotes]: Let $H_i$ and $H_j$ be the hyperplanes in $\Bbb{P}^n$ defined by $x_i = 0$ and $x_j = 0$ with $i \neq j$. I want to show that any regular function on $\Bbb{P}^n - (H_i \cap H_j)$ is constant. Now I think I have the proof in my hands which is the following. 
My proof: We have
$$\Bbb{P}^n - (H_i \cap H_j) = (\Bbb{P}^n - H_i) \cup (\Bbb{P}^n - H_j).$$
The ring on regular functions on the left hand side should be equal to $\mathcal{O}(\Bbb{P}^n - H_i)  \cap \mathcal{O}(\Bbb{P}^n - H_j)$. We know that $\mathcal{O}(\Bbb{P}^n - H_i) \cong (k[x_0,\ldots,x_n]_{x_i})_0$ and similarly for $x_j$. Thus for any regular function $h $ on $\Bbb{P}^n - (H_i \cap H_j)$, 
$$h = \frac{f}{x_i^k} = \frac{g}{x_j^m}$$
for some $f,g$ homogeneous polynomials respectively of degrees $k$ and $m$. Then by unique factorization and assuming that the fractions are in the lowest terms I conclude $k = m = 0$ so that $h \in k$.
My problem: The thing is, taking the intersection of two rings of regular functions requires knowing that they are both embedded into something big. What is this thing? I guess it would be the fraction field of $k[x_q,\ldots,x_n]$. Also, I am worried that my answer in some sense is "not canonical" because it requires me to make a choice in embedding the ring of regular functions inside of something.

REPLY [2 votes]: Although I find the comments to the question and user10676's answer  quite satisfying, I'll add a new perspective at Benja's explicit request  to me in a comment to another question here.    
If $X$ is a normal variety (for example a smooth variety), and $Y$ is a closed subvariety of codimension $\geq 2$, then the restriction morphism $\mathcal O(X)\to \mathcal O(X\setminus Y)$ is bijective.
In particular if $X$ is complete we obtain $\mathcal O(X\setminus Y)=\mathcal O(X)=k$ and this applies to your case, where you may take  $X=\mathbb P^n_k$ and $Y=H_i\cap H_j$.  
Unfortunately I could not locate this theorem in Hartshorne, which seems to be your reference book, but it follows from Chapter 4, Theorem 1.14, page 118 of Liu's fine book .