[proofplan]
The zero ideal is generated by $0$, so the only substantive case is a nonzero ideal. In that case we choose a nonzero element of minimal degree and normalize it to be monic. Euclidean division by this minimal-degree polynomial shows that every element of the ideal is a multiple of it, because any nonzero remainder would have smaller degree and still lie in the ideal. Finally, if two monic polynomials generate the same ideal, divisibility in both directions forces their degrees to be equal and the quotient to be a nonzero constant; monicity makes that constant equal to $1$.
[/proofplan]
[step:Handle the zero ideal separately]
If $I = (0)$, then $I$ is principal because
\begin{align*}
I = (0).
\end{align*}
This proves the first assertion for the zero ideal. The uniqueness statement is intentionally restricted to $I \ne (0)$, since the zero polynomial is not monic.
[/step]
[step:Choose a monic element of minimal degree in the nonzero ideal]
Assume $I \ne (0)$. Let $\deg f \in \mathbb{N} \cup \{0\}$ denote the degree of a nonzero polynomial $f \in k[x]$. Since $I$ contains a nonzero polynomial, the set
\begin{align*}
S := \{\deg f : f \in I,\ f \ne 0\}
\end{align*}
is a nonempty subset of $\mathbb{N} \cup \{0\}$. By the [well-ordering principle](/theorems/721), $S$ has a least element. Choose $g \in I$ with $g \ne 0$ and $\deg g = \min S$.
Let $a \in k^\times$ be the leading coefficient of $g$. Define
\begin{align*}
d := a^{-1}g \in k[x].
\end{align*}
Because $I$ is an ideal and $a^{-1} \in k \subset k[x]$, we have $d \in I$. The polynomial $d$ is monic, nonzero, and satisfies
\begin{align*}
\deg d = \deg g = \min S.
\end{align*}
[/step]
[step:Use Euclidean division to force every remainder to vanish]
Let $f \in I$. By Euclidean division for polynomials over a field (citing a result not yet in the wiki: Euclidean division for polynomials over a field), applied to the dividend $f \in k[x]$ and the nonzero divisor $d \in k[x]$, there exist polynomials $q, r \in k[x]$ such that
\begin{align*}
f = qd + r
\end{align*}
and either $r = 0$ or $\deg r < \deg d$.
Since $d \in I$ and $I$ is an ideal, $qd \in I$. Since $f \in I$ and $qd \in I$, closure of the additive group of the ideal under subtraction gives
\begin{align*}
r = f - qd \in I.
\end{align*}
If $r \ne 0$, then $\deg r \in S$ and $\deg r < \deg d = \min S$, which contradicts the minimality of $\deg d$. Therefore $r = 0$, and hence
\begin{align*}
f = qd \in (d).
\end{align*}
[guided]
We now prove the main point: the minimal-degree element $d$ actually generates the whole ideal. Fix an arbitrary polynomial $f \in I$. Because $k$ is a field and $d \ne 0$, Euclidean division for polynomials over a field applies to the pair $(f,d)$. It gives polynomials $q, r \in k[x]$ with
\begin{align*}
f = qd + r
\end{align*}
where the remainder satisfies either $r = 0$ or $\deg r < \deg d$.
Why is this useful? The remainder is not just any polynomial; it still lies in the ideal. Indeed, $d \in I$, and because $I$ is an ideal of $k[x]$, multiplying $d$ by $q \in k[x]$ gives $qd \in I$. Since $f \in I$ and ideals are additive subgroups, subtracting gives
\begin{align*}
r = f - qd \in I.
\end{align*}
Now the minimality of $d$ becomes decisive. If $r \ne 0$, then $r$ is a nonzero element of $I$, so $\deg r$ belongs to the set of degrees of nonzero elements of $I$. But Euclidean division gave $\deg r < \deg d$, contradicting the choice of $d$ as an element of $I$ with minimal possible degree. Therefore the only possible remainder is
\begin{align*}
r = 0.
\end{align*}
Thus $f = qd$, so the arbitrary element $f \in I$ belongs to the principal ideal $(d)$.
[/guided]
[/step]
[step:Conclude that the ideal is generated by the chosen polynomial]
The previous step proves $I \subset (d)$, since every $f \in I$ is a multiple of $d$. Conversely, because $d \in I$ and $I$ is an ideal, every multiple of $d$ by a polynomial in $k[x]$ lies in $I$, so
\begin{align*}
(d) \subset I.
\end{align*}
Therefore
\begin{align*}
I = (d).
\end{align*}
Thus every nonzero ideal of $k[x]$ has a monic generator, and together with the zero ideal case every ideal of $k[x]$ is principal.
[/step]
[step:Prove uniqueness of the monic generator]
Let $d,e \in k[x]$ be monic polynomials such that
\begin{align*}
I = (d) = (e).
\end{align*}
Since $d \in (e)$, there exists $u \in k[x]$ such that
\begin{align*}
d = ue.
\end{align*}
Since $e \in (d)$, there exists $v \in k[x]$ such that
\begin{align*}
e = vd.
\end{align*}
The polynomials $d$ and $e$ are nonzero because they are monic.
From $d = ue$ and $e \ne 0$, the degree formula for products in $k[x]$ gives
\begin{align*}
\deg d = \deg u + \deg e
\end{align*}
if $u \ne 0$. Since $d \ne 0$, necessarily $u \ne 0$. Hence $\deg e \le \deg d$. Similarly, $v \ne 0$ and
\begin{align*}
\deg e = \deg v + \deg d,
\end{align*}
so $\deg d \le \deg e$. Therefore
\begin{align*}
\deg d = \deg e.
\end{align*}
It follows from $\deg d = \deg u + \deg e$ that $\deg u = 0$, so $u \in k^\times$ is a nonzero constant. The leading coefficient of $d = ue$ is $u$ times the leading coefficient of $e$. Since both $d$ and $e$ are monic, this gives $1 = u \cdot 1$, hence $u = 1$. Therefore $d = e$.
Thus the monic generator of a nonzero ideal of $k[x]$ is unique.
[/step]