A commutative ring $A$ is a field iff $A$ is a PID

Wikipedia says that a commutative ring $A$ is a field iff $A[x]$ is a PID.

The “only if” part is easy: we just apply the Euclidean algorithm. I’ve stumbled trying to prove the “if” part, though.

$\newcommand{\aa}{\mathfrak{a}}$
My best attempt so far: suppose $\aa$ is an ideal of $A$, and $\aa’$ is the ideal of $A[x]$ spanned by $i(\aa)$, where $i: A \hookrightarrow A[x]$ is the natural embedding. $i^{-1}(\aa’) = \aa$ for grading reasons ($i(A) = A[x]^0$, and multiplication by a non-zero degree polynomial takes us out of $i(A)$, because $A \cong i(A)$ is integral). $A[x]$ is a PID so $\aa’ = (a’)$, where $a’ = i(a)$ for some $a \in A$. Therefore, $\aa = (a)$, and thus $A$ is also a PID.

That’s the best way to use the fact that $A[x]$ is a PID that I’ve found so far. Now I feel like there must be a trick to show that if $a \neq 0$ then $a = 1$, but I don’t know how to do this. Any hints?

Solutions Collecting From Web of "A commutative ring $A$ is a field iff $A$ is a PID"

Consider the surjective map $A[x]\to A[x]/(x)\cong A$. By the Lattice (or Fourth) Isomorphism Theorem the ideals of $A$ are in bijection with those in $A[x]$ containing $(x)$. Since $A[x]$ is a PID, any ideal containing $(x)$ must be of the form $(f)$ for some $f\mid x$. Thus either $f$ is a unit multiple of $x$ or it is a unit, so $(f)=(x)$ or $(f)=(1)$. Thus the only two ideals of $A$ are $(0)$ and $(1)$, so it is a field.

I am sure that this is more complicated than necessary.

Note that since $A[x]$ is a domain, so is $A$, and we can use the identity
$$
\deg(a b) = \deg(a) + \deg(b)\tag{degree}
$$
for $0 \ne a, b \in A[x]$.

Take any $a \in A$, $a \ne 0$, and consider the ideal $(a, x)$ of $A[x]$.

This is principal, so there is $c \in A[x]$ such that $(a, x) = (c)$, and thus $a = b c$ and $x = d c$ for some $b, d \in A[x]$. By (degree) we have that $c \in A$, and thus $d = u + v x$, for $u, v \in A$. Thus $x = (u + v x) c = u c + v c x$, so that $c$ is invertibile and $(a, x) = (c) = A[x]$.

In particular, there are $s, t \in A[x]$ such that $a s + x t = 1$. (This is because $(a, x) = \{ a s + x t : s, t \in A[x] \}$.) Set $x = 0$ to find that $a$ is invertible in $A$.

$1=\dim(A[x]) \geq \dim(A)+1$ gives $\dim(A)=0$, and $A$ is an integral domain, thus $A$ is a field.

The same proof a little bit more detailed: If $A$ is not a field, choose a prime ideal $\mathfrak{p} \neq 0$, then $0 \subseteq \mathfrak{p} \subseteq \mathfrak{p}[x]$ is a proper chain of prime ideals of $A[x]$. In a PID every prime ideal $\neq 0$ is maximal. Hence $A[x]$ is not a PID.