[step:Uniqueness — a prime $\mathfrak{p}_1$ dividing $\mathfrak{q}_1 \cdots \mathfrak{q}_s$ must equal some $\mathfrak{q}_i$]Suppose
\begin{align*}
\mathfrak{p}_1 \mathfrak{p}_2 \cdots \mathfrak{p}_r = \mathfrak{q}_1 \mathfrak{q}_2 \cdots \mathfrak{q}_s
\end{align*}
with all $\mathfrak{p}_i, \mathfrak{q}_j$ nonzero prime ideals. We show $r = s$ and the two sequences agree up to reordering, by induction on $r$ (with $r = 0$ as base).
[claim:A prime ideal divides a product of primes iff it equals one of them]
Let $\mathfrak{p}, \mathfrak{q}_1, \ldots, \mathfrak{q}_s \unlhd \mathcal{O}_L$ be nonzero prime ideals. If $\mathfrak{p} \supseteq \mathfrak{q}_1 \cdots \mathfrak{q}_s$, then $\mathfrak{p} = \mathfrak{q}_j$ for some $j$.
[/claim]
[proof]
Induction on $s$. For $s = 1$: $\mathfrak{p} \supseteq \mathfrak{q}_1$ means $\mathfrak{q}_1 \subseteq \mathfrak{p}$. Since $\mathfrak{q}_1$ is a nonzero prime, it is maximal (by $\mathcal{O}_L$ Dedekind); as $\mathfrak{p}$ is proper ($\mathfrak{p} \neq \mathcal{O}_L$, by being prime), and $\mathfrak{q}_1$ is already maximal within proper ideals, the only way $\mathfrak{q}_1 \subseteq \mathfrak{p}$ with both proper is $\mathfrak{q}_1 = \mathfrak{p}$.
For the inductive step $s \geq 2$: We have $\mathfrak{p} \supseteq \mathfrak{q}_1 \cdot (\mathfrak{q}_2 \cdots \mathfrak{q}_s)$. By [Prime Ideals Divide Products](/theorems/1588), applied with $\mathfrak{a} = \mathfrak{q}_1$, $\mathfrak{b} = \mathfrak{q}_2 \cdots \mathfrak{q}_s$, and the prime ideal $\mathfrak{p}$:
\begin{align*}
\mathfrak{q}_1 \subseteq \mathfrak{p} \quad \text{or} \quad \mathfrak{q}_2 \cdots \mathfrak{q}_s \subseteq \mathfrak{p}.
\end{align*}
In the first case, the base case $s = 1$ gives $\mathfrak{q}_1 = \mathfrak{p}$. In the second case, the inductive hypothesis applied to the $s - 1$ primes $\mathfrak{q}_2, \ldots, \mathfrak{q}_s$ gives $\mathfrak{p} = \mathfrak{q}_j$ for some $j \in \{2, \ldots, s\}$. Either way, $\mathfrak{p}$ equals one of the $\mathfrak{q}_j$.
[/proof]
Applying the claim with $\mathfrak{p} = \mathfrak{p}_1$ to the hypothesis $\mathfrak{p}_1 \mathfrak{p}_2 \cdots \mathfrak{p}_r = \mathfrak{q}_1 \mathfrak{q}_2 \cdots \mathfrak{q}_s$ (which in particular gives $\mathfrak{p}_1 \supseteq \mathfrak{q}_1 \cdots \mathfrak{q}_s$, since $\mathfrak{p}_1$ divides the LHS, hence the RHS, hence contains it by [Divisibility Equals Containment](/theorems/1587)), we deduce $\mathfrak{p}_1 = \mathfrak{q}_j$ for some $j$. After reindexing the $\mathfrak{q}$'s (reordering the right-hand product is allowed since ideal multiplication is commutative), we may assume $j = 1$, so $\mathfrak{p}_1 = \mathfrak{q}_1$.[/step]