An example of a regular function over an open set

Look at the example 2.1.7 at page 19 of these notes (which is the same example present in Mumford's red book at page 21). The author shows that a regular function isn't a ratio of two polynomial, and in particular in the above example inside the open set $U$ we have the following regular function: $$\phi(p)=\left\{\begin{array} {lll} \frac{X_1}{X_2} & \textrm{if $p\in X_2\neq 0$}\\\\ \frac{X_3}{X_4} & \textrm{if $p\in X_4\neq 0$} \end{array}\right.$$

I agree with the fact that $\frac{X_1}{X_2}=\frac{X_3}{X_4}$ in $K(X)$ when $X_2\neq0$ and $X_4\neq0$, but the point is that such two functions shoud be the same in the whole $V$ to make sensible the example. Infact in in the intersection $\{X_2\neq0\}\cap\{X_4\neq0\}$ we have the regular function described by $\frac{X_1}{X_2}$ or $\frac{X_3}{X_4}$, but what about the rest of $U$?


The situation is that we have a cone $Y\subset \mathbb A^4_k$ of equation $X_1X_4=X_2X_3$, which contains the closed plane $P\subset Y$ given by $X_2=X_4=0$.
We are interested in the complementary open subset $U=Y\setminus P\subset Y$ and its ring of regular functions $\mathcal O_Y(U)$.

The function $\phi\in \mathcal O_Y(U)$ that you describe, which has $P$ as its polar set , cannot be written $\phi=\frac{f\mid U}{g\mid U}$ with $f,g\in \mathcal O_Y(Y)$ (where $\mathcal O_Y(Y)$ consists of restrictions to $Y$ of genuine polynomials of $k[X_1,X_2,X_3,X_4]$).
And why is that?

The reason is that if we had such a description of $\phi$, then the plane $P$ would be the zero locus of the single regular function $g\in \mathcal O_Y(Y)$ i.e. would be a Cartier divisor, and this is actually not the case.