TITLE: The Unit Circle over $\mathbb R$ is not a UFD
QUESTION [5 upvotes]: This is exercise 14.2 N in Vakil, self-study. Similar questions have been asked a few times on this site, but none of the answers use a method that I believe Vakil intended: here, here, and here.
We are to show $\mathbb R[x, y]/(x^2 + y^2 -1)$ is not a UFD, but over $\mathbb C$, it is, using exercise 14.2 L, which says, among other things, that $\mathbb P^n - Y$ is not the spectrum of a UFD if $Y$ is a hypersurface of degree $d > 1$.
The issue is that I don't see how to write the unit circle as the complement of a degree $d > 1$ hypersurface in a projective space, if indeed that is what we are supposed to do, nor do I see how, supposing we have done this, the result will change over $\mathbb C$, since presumably 14.2 L still applies.

REPLY [2 votes]: This is quite a late answer but maybe better late than never. I just want to spell out your nice attempted answer which should basically be Vakil's intended idea.
We note that there is an isomorphism $k[x,y]_{(x^2+y^2)} \cong k[x,y]/(x^2+y^2-1)$ for $\operatorname{char}{k} \neq 2$.* (This could for instance be seen and motivated from the isomorphism between $\mathbb{P}^1$ and the projective circle.) Therefore,
$$ k[x,y]/(x^2+y^2-1) = \mathbb{P}_k^1 \setminus V_+(x^2+y^2).$$ The difference between $k= \mathbb{R}$ and $k = \mathbb{C}$ lies in the distinction of whether $x^2+y^2$ is an irreducible polynomial.

If $k = \mathbb{R}$, then $x^2+y^2$ is irreducible (of degree 2). We have seen in 14.2.L that $\mathbb{P}_\mathbb{R}^1 \setminus V_+(x^2+y^2)$ has non-trivial class group.
If $k = \mathbb{C}$, then $x^2+y^2 = (x+iy)(x-iy)$ splits into two hyperplanes. Then, $$\mathbb{P}_{\mathbb{C}}^1 \setminus V_+(x^2+y^2) = \mathbb{P}_{\mathbb{C}}^1 - V_+(x+iy) - V_+(x-iy). $$ By 14.2.L (after changing coordinates) this is the spectrum of a UFD.

*The embedding of the projective unit circle is given by a map of graded rings (see MSE/4086633) via $$\mathbb{P}_k^1 \cong \operatorname{Proj}{k[x,y]^{(2)}} \overset{\varphi}{\hookrightarrow} \mathbb{P}_k^2.$$ The  patch $\operatorname{Spec}{k[x_{02}, x_{12}]/(x_{02}^2+x_{12}^2 - 1)}$ is given by the preimage of $D_+(x_2)$ which is $D_+(\varphi^*x_2) = D_+(x^2 + y^2)$. On homogeneous localizations, there is an isomorphism between a ring and its Veronese subrings, so this pulls back to $D_+(x^2+y^2)$ through $\mathbb{P}_k^1 \cong \operatorname{Proj}{k[x,y]^{(2)}}$.