How to show that ${\Bbb Q}[x,y]/(x^2+y^2+1)$ is a PID? I know that ${\Bbb Q}[x,y]/(x^2+y^2-1)$ is not a PID, because it is not a UFD.

But ${\Bbb Q}[x,y]/(x^2+y^2+1)$ is a PID.

I heard about some proof using Hochschild-Serre spectral sequence. I was wondering if there an elementary proof? Here's my attempt:
Let $A=\Bbb Q[x]$, $B=\Bbb Q[x,y]/(x^2+y^2+1)$, $\phi:A\to B$ the natural inclusion homomorphism. For a nonzero prime ideal $I$ of $B$, we have that $\phi^{-1}(I)$ is a prime ideal of $A$.

*

*$\phi^{-1}(I)$ is a nonzero prime ideal of $A$. If $g(x)+yf(x)\in I$, then $(g(x)-yf(x))(g(x)+yf(x)) = g(x)^2-y^2f(x)^2=g(x)^2+(1+x^2)(f(x)^2\in A$.

*$\phi^{-1}(I)=(h(x))$, where $h(x)$ is irreducible in $\Bbb Q[x]$.

*$F=\Bbb Q[x]/(h(x))$ is a field.

*$\phi$ induces a ring homomorphism $F=A/(h(x)) \to B/(h(x)) \to B/I$.

*$B/(h(x))\cong F[y]/(y^2+x^2+1)$.

*If $y^2+x^2+1$ is irreducible in $F[y]$, then $F[y]/(y^2+x^2+1)$ is a field, so $(h(x))$ is a maximal ideal of $B$, so $I=(h(x))$ is principal.

*Otherwise, $y^2+x^2+1$ is reducible in $F[y]$, so $y^2+x^2+1=(y-k(x))(y+k(x)) \in F[y]$. This is equivalent to $h(x)\mid 1+x^2+k(x)^2\in \Bbb Q[x]$.

*Claim (hard): If $h(x)\mid 1+x^2+k(x)^2 \in \Bbb Q[x]$, then $h(x)=f(x)^2+(1+x^2)g(x)^2$ for some $f,g\in\Bbb Q[x]$.

*$(f(x)+yg(x))(f(x)-yg(x)) = h(x)\in I\subset B$, $I$ being prime implies WLOG $f-yg\in I$.

*$B/(f-yg)\cong F[y]/(f-yg,y^2+x^2+q)\cong F$, so $(f-yg)$ is a maximal ideal, so $I=(f-yg)$ is principal.

But I was not sure about the step 8.
If we replace $\Bbb Q$ by $\Bbb R$, then the problem become easier because the only field extension of $\Bbb R$ is $\Bbb C$. But for $\Bbb Q$, it is much harder.
 A: Related: https://math.stackexchange.com/a/489215, https://math.stackexchange.com/a/864627
You can find a general statement in Samuel's lecture notes, page 27:

Let $k$ be a field and $C\subseteq\mathbb P_k^2$ a (nonsingular) conic. Let $U=C\cap\mathbb A_k^2$. Suppose that there is no $k$-rational point on $C$, then $A:=\mathcal O_C(U)$ is a UFD.

The proof goes as follows: Exercise 14.2.T of Vakil's notes shows that a Noetherian integral domain is a UFD if and only if it is integrally closed and the divisor class group $\DeclareMathOperator\Cl{Cl}\Cl(U)$ is trivial. By the excision sequence $\mathbb Z\to\Cl(C)\to\Cl(U)\to0$, it suffices to show that the map $[Z]\colon\mathbb Z\to\Cl(C)$ is surjective, where $Z=C\setminus U$. Note that $\deg [Z]=2$ and every Weil divisor of zero degree on $C$ is linearly equivalent to $0$ (since the genus of $C$ is $0$). It remains to show that there is no divisor $D$ on $C$ is of degree $1$.
Otherwise, let $D$ be a divisor of degree $1$. It follows from the Riemann-Roch theorem that $l(D)\ge\deg D+1=2$, thus there exists a rational functor $f$ on $C$ such that $\DeclareMathOperator\div{div}\div(f)+D\ge0$, but $\deg(\div(f)+D)=1$, we get a $k$-rational point on $C$, contradiction.
For your original question, note that your ring is normal (see Exercise 5.4.H of Vakil's notes) and finite over $\mathbb Q[x]$, therefore Dedekind. Since it is a UFD, it is also a PID.
