[proofplan]
We prove both directions. For the forward direction, take a height-one prime ideal $\mathfrak{p}$ and pick any nonzero $a \in \mathfrak{p}$. Factor $a$ into irreducibles using the UFD property; since $\mathfrak{p}$ is prime, it must contain at least one irreducible factor $p$. In a UFD, irreducibles are prime, so $(p)$ is a prime ideal contained in $\mathfrak{p}$. The height-one condition forces $(0) \subsetneq (p) \subseteq \mathfrak{p}$ to be an equality $\mathfrak{p} = (p)$. For the reverse direction, we show that any principal prime ideal $(p)$ generated by a prime element has height one by verifying that no prime ideal can sit strictly between $(0)$ and $(p)$.
[/proofplan]
[step:Show that a height-one prime contains an irreducible element]
Let $\mathfrak{p} \trianglelefteq R$ be a prime ideal of height one. By definition of height, $\operatorname{ht}(\mathfrak{p}) = 1$ means $\mathfrak{p} \neq (0)$ and there is no prime ideal $\mathfrak{q}$ with $(0) \subsetneq \mathfrak{q} \subsetneq \mathfrak{p}$. In particular, $\mathfrak{p}$ contains a nonzero element.
Pick any nonzero $a \in \mathfrak{p}$. Since $R$ is a UFD and $a \neq 0_R$, if $a$ is a unit then $\mathfrak{p} = R$, contradicting the fact that prime ideals are proper. So $a$ is a nonzero non-unit, and the UFD property provides a factorisation
\begin{align*}
a = u \, q_1 q_2 \cdots q_m,
\end{align*}
where $u \in R^\times$ is a unit, $m \ge 1$, and each $q_i$ is an irreducible element of $R$.
Since $a \in \mathfrak{p}$ and $\mathfrak{p}$ is a prime ideal, the product $q_1 q_2 \cdots q_m = u^{-1} a \in \mathfrak{p}$ (because $u^{-1} \in R$ and $\mathfrak{p}$ is an ideal). By iterated application of the prime ideal property -- $\mathfrak{p}$ is prime, so if a product of elements lies in $\mathfrak{p}$, at least one factor lies in $\mathfrak{p}$ -- there exists an index $i$ with $1 \le i \le m$ such that $q_i \in \mathfrak{p}$.
Set $p := q_i$. This is an irreducible element of $R$ lying in $\mathfrak{p}$.
[guided]
The goal is to find a single generator for $\mathfrak{p}$. Where should we look? Since $\mathfrak{p}$ has height one, it is nonzero, so it contains some nonzero element $a$. In a UFD, every nonzero non-unit factors into irreducibles, and the prime ideal property lets us extract a single irreducible factor from $\mathfrak{p}$.
Pick any nonzero $a \in \mathfrak{p}$. The element $a$ cannot be a unit, since prime ideals are proper ($\mathfrak{p} \neq R$). By the UFD property, write
\begin{align*}
a = u \, q_1 q_2 \cdots q_m,
\end{align*}
with $u \in R^\times$, $m \ge 1$, and each $q_i$ irreducible. Since $\mathfrak{p}$ is an ideal and $u$ is a unit, $u^{-1} a = q_1 \cdots q_m \in \mathfrak{p}$.
Now we use the defining property of a prime ideal: if a product belongs to a prime ideal, at least one factor must belong to it. For $m = 1$ this is immediate. For $m \ge 2$, write $q_1 \cdots q_m = q_1 \cdot (q_2 \cdots q_m)$. Since $\mathfrak{p}$ is prime, either $q_1 \in \mathfrak{p}$ or $q_2 \cdots q_m \in \mathfrak{p}$. In the latter case, repeat the argument on the shorter product. After at most $m - 1$ applications, we find some $q_i \in \mathfrak{p}$.
Set $p := q_i$. This irreducible element will turn out to generate $\mathfrak{p}$.
[/guided]
[/step]
[step:Use the UFD property to show $(p)$ is a prime ideal contained in $\mathfrak{p}$]
By [Irreducible Elements Are Prime in a Unique Factorisation Domain](/theorems/3243), since $R$ is a UFD and $p$ is irreducible, $p$ is a prime element. Therefore the principal ideal $(p) = pR$ is a prime ideal of $R$.
Since $p \in \mathfrak{p}$, every multiple of $p$ lies in $\mathfrak{p}$, so $(p) \subseteq \mathfrak{p}$. Moreover, $p$ is a nonzero non-unit, so $(p) \neq (0)$ (because $p \neq 0_R$) and $(p) \neq R$ (because $p \notin R^\times$). Thus we have a chain of prime ideals
\begin{align*}
(0) \subsetneq (p) \subseteq \mathfrak{p}.
\end{align*}
[guided]
This is where the connection between irreducible and prime elements matters. In a general integral domain, an irreducible element need not be prime, so $(p)$ need not be a prime ideal. But in a UFD, [irreducibles are prime](/theorems/3243), which gives us $(p)$ as a prime ideal.
Since $p \in \mathfrak{p}$ and $\mathfrak{p}$ is an ideal, every multiple of $p$ lies in $\mathfrak{p}$, so $(p) = \{rp : r \in R\} \subseteq \mathfrak{p}$.
We check that $(p)$ is a proper nonzero ideal. Is $(p) \neq R$? If $(p) = R$ then $1_R \in (p)$, so $1_R = rp$ for some $r \in R$, making $p$ a unit — but irreducible elements are not units by definition, a contradiction.
Is $(p) \neq (0)$? Yes: $p = 1_R \cdot p \in (p)$ and $p \neq 0_R$ since irreducible elements are nonzero by definition.
We therefore have the chain of prime ideals $(0) \subsetneq (p) \subseteq \mathfrak{p}$. The height-one hypothesis on $\mathfrak{p}$ will now force the inclusion $(p) \subseteq \mathfrak{p}$ to be an equality.
Note that the primality of $(p)$ is essential here: the height-one condition constrains chains of *prime* ideals, so we need $(p)$ to be prime (not merely a proper ideal) for the chain to be relevant.
[/guided]
[/step]
[step:Apply the height-one condition to conclude $\mathfrak{p} = (p)$]
Since $\operatorname{ht}(\mathfrak{p}) = 1$, there is no prime ideal $\mathfrak{q}$ satisfying $(0) \subsetneq \mathfrak{q} \subsetneq \mathfrak{p}$. But $(p)$ is a prime ideal with $(0) \subsetneq (p) \subseteq \mathfrak{p}$. The only possibility consistent with the height-one condition is $(p) = \mathfrak{p}$.
Since $p$ is a prime element of $R$, we have exhibited $\mathfrak{p}$ as a principal ideal generated by a prime element. This completes the forward direction.
[guided]
The height-one hypothesis is doing all the work in this step. Recall: $\operatorname{ht}(\mathfrak{p}) = 1$ means that the longest strictly ascending chain of prime ideals ending at $\mathfrak{p}$ has length exactly one, so the only such chain is $(0) \subsetneq \mathfrak{p}$ itself.
Suppose for contradiction that $(p) \subsetneq \mathfrak{p}$ strictly. Then $(0) \subsetneq (p) \subsetneq \mathfrak{p}$ is a chain of prime ideals of length two (since $(p)$ is prime, as established in the previous step). This gives $\operatorname{ht}(\mathfrak{p}) \ge 2$, contradicting the assumption $\operatorname{ht}(\mathfrak{p}) = 1$.
Therefore $(p) = \mathfrak{p}$, and we have shown that every height-one prime ideal in a UFD is principal, generated by a prime element. This completes the forward direction of the biconditional.
What if $\mathfrak{p}$ had height $\ge 2$? Then the argument would not yield a contradiction: $(p)$ could sit strictly below $\mathfrak{p}$, and $\mathfrak{p}$ might require more than one generator. For example, in $\mathbb{Z}[x]$ the prime ideal $(2, x)$ has height two and is not principal.
This illustrates why height one is precisely the correct condition for principality in a UFD.
[/guided]
[/step]
[step:Prove the converse: a principal prime ideal $(p)$ has height one]
Conversely, let $p \in R$ be a prime element and set $\mathfrak{p} = (p)$. We must show $\operatorname{ht}(\mathfrak{p}) = 1$, i.e., $\mathfrak{p} \neq (0)$ and there is no prime ideal $\mathfrak{q}$ with $(0) \subsetneq \mathfrak{q} \subsetneq \mathfrak{p}$.
First, $\mathfrak{p} \neq (0)$ because $p \neq 0_R$ (prime elements are nonzero by definition).
Suppose for contradiction that there exists a prime ideal $\mathfrak{q}$ with $(0) \subsetneq \mathfrak{q} \subsetneq (p)$. Pick a nonzero element $b \in \mathfrak{q}$. Since $b \in (p)$, we can write $b = rp$ for some $r \in R$. Because $\mathfrak{q}$ is a prime ideal and $rp \in \mathfrak{q}$, either $r \in \mathfrak{q}$ or $p \in \mathfrak{q}$.
If $p \in \mathfrak{q}$, then $(p) \subseteq \mathfrak{q}$, so $\mathfrak{q} = (p)$ (since $\mathfrak{q} \subseteq (p)$ by assumption), contradicting $\mathfrak{q} \subsetneq (p)$.
Therefore $r \in \mathfrak{q}$. But then $r \in \mathfrak{q} \subsetneq (p)$, so $r = r'p$ for some $r' \in R$, and $b = rp = r'p^2$. Repeating the argument: $r' p^2 \in \mathfrak{q}$ and $p \notin \mathfrak{q}$, so $r' p \in \mathfrak{q}$ (since $\mathfrak{q}$ is prime and $r'p \cdot p = r'p^2 \in \mathfrak{q}$ with $p \notin \mathfrak{q}$ forces $r'p \in \mathfrak{q}$). Applying primality again, $r' \in \mathfrak{q}$ or $p \in \mathfrak{q}$; the latter is excluded, so $r' \in \mathfrak{q} \subsetneq (p)$.
By induction, for every $n \ge 1$ we can write $b = r_n p^n$ for some $r_n \in R$. Since $R$ is a UFD, $b$ has a factorisation into finitely many irreducibles, so $b$ can be divisible by at most finitely many powers of $p$. This contradicts $p^n \mid b$ for all $n \ge 1$.
Therefore no such $\mathfrak{q}$ exists, and $\operatorname{ht}((p)) = 1$.
[guided]
For the converse, we need to show that no prime ideal can sit strictly between $(0)$ and $(p)$. The key idea is that any element of such an ideal would be divisible by arbitrarily high powers of $p$, which is impossible in a UFD.
Let $p \in R$ be a prime element, $\mathfrak{p} = (p)$, and suppose for contradiction that $(0) \subsetneq \mathfrak{q} \subsetneq (p)$ for some prime ideal $\mathfrak{q}$. Pick any nonzero $b \in \mathfrak{q}$.
Since $\mathfrak{q} \subseteq (p)$, we have $b \in (p)$, so $b = r_1 p$ for some $r_1 \in R$. Now $r_1 p \in \mathfrak{q}$ and $\mathfrak{q}$ is prime. Can $p \in \mathfrak{q}$? If so, then $(p) \subseteq \mathfrak{q}$, hence $(p) = \mathfrak{q}$ (since $\mathfrak{q} \subseteq (p)$), contradicting $\mathfrak{q} \subsetneq (p)$. So $p \notin \mathfrak{q}$, and primality forces $r_1 \in \mathfrak{q}$.
Now $r_1 \in \mathfrak{q} \subseteq (p)$, so $r_1 = r_2 p$, giving $b = r_2 p^2$. The product $r_2 p^2 = (r_2 p) \cdot p \in \mathfrak{q}$ with $p \notin \mathfrak{q}$ forces $r_2 p \in \mathfrak{q}$. Then $(r_2) \cdot p = r_2 p \in \mathfrak{q}$ with $p \notin \mathfrak{q}$ forces $r_2 \in \mathfrak{q}$. Continuing, $r_2 \in \mathfrak{q} \subseteq (p)$ gives $r_2 = r_3 p$, so $b = r_3 p^3$.
By induction, for every $n \ge 1$, $p^n \mid b$ in $R$. Now use the UFD structure: since $b \neq 0_R$ is a nonzero element of a UFD, write $b = u \, q_1 \cdots q_m$ with $u \in R^\times$ and each $q_i$ irreducible. The number of times $p$ (or an associate of $p$) appears among the $q_i$ is at most $m$. But $p^n \mid b$ for all $n$ means that at least $n$ of the $q_i$ are associates of $p$ -- for $n > m$, this is a contradiction.
Therefore no such $\mathfrak{q}$ exists, and $\operatorname{ht}((p)) = 1$. The converse is proved: every principal ideal generated by a prime element is a height-one prime ideal.
[/guided]
[/step]