**Proof.**
Since at least one $a_ i$ is not a unit we find that $\mathfrak m$ is not an associated prime of $A$. Moreover, for any $A \subset B$ as in the statement $\mathfrak m$ is not an associated prime of $B$ and $\mathfrak m_ j$ is not an associate prime of $B_ j$. Keeping this in mind will help check the arguments below.

First, we claim that it suffices to prove the lemma for $r = 2$. We will argue this by induction on $r$; we suggest the reader skip the proof. Suppose we are given $A \subset B$ and $\pi _ j$ in $B_ j = B_{\mathfrak m_ j}$ and factorizations $a_ i = u_{i, j} \pi _ j^{e_{i, j}}$ for $i = 1, \ldots , r - 1$ in $B_ j$ with $u_{i, j} \in B_ j$ units and $e_{i, j} \geq 0$. Then by the case $r = 2$ for $\pi _ j$ and $a_ r$ in $B_ j$ we can find extensions $B_ j \subset C_ j$ and for every maximal ideal $\mathfrak m_{j, k}$ of $C_ j$ a nonzerodivisor $\pi _{j, k} \in C_{j, k} = (C_ j)_{\mathfrak m_{j, k}}$ and factorizations

\[ \pi _ j = v_{j, k} \pi _{j, k}^{f_{j, k}} \quad \text{and}\quad a_ r = w_{j, k} \pi _{j, k}^{g_{j, k}} \]

as in the lemma. There exists a unique finite extension $B \subset C$ with $C/B$ annihilated by a power of $\mathfrak m$ such that $C_ j \cong C_{\mathfrak m_ j}$ for all $j$, see Lemma 42.4.1. The maximal ideals of $C$ correspond $1$-to-$1$ to the maximal ideals $\mathfrak m_{j, k}$ in the localizations and in these localizations we have

\[ a_ i = u_{i, j} \pi _ j^{e_{i, j}} = u_{i, j} v_{j, k}^{e_{i, j}} \pi _{j, k}^{e_{i, j}f_{j, k}} \]

for $i \leq r - 1$. Since $a_ r$ factors correctly too the proof of the induction step is complete.

Proof of the case $r = 2$. We will use induction on

\[ \ell = \min (\text{length}_ A(A/a_1A),\ \text{length}_ A(A/a_2A)). \]

If $\ell = 0$, then either $a_1$ or $a_2$ is a unit and the lemma holds with $A = B$. Thus we may and do assume $\ell > 0$.

Suppose we have a finite extension of rings $A \subset A'$ such that $A'/A$ is annihilated by a power of $\mathfrak m$ and such that $\mathfrak m$ is not an associated prime of $A'$. Let $\mathfrak m_1, \ldots , \mathfrak m_ r \subset A'$ be the maximal ideals and set $A'_ i = A'_{\mathfrak m_ i}$. If we can solve the problem for $a_1, a_2$ in each $A'_ i$, then we can apply Lemma 42.4.1 to produce a solution for $a_1, a_2$ in $A$. Choose $x \in \{ a_1, a_2\} $ such that $\ell = \text{length}_ A(A/xA)$. By Lemma 42.2.5 and (42.2.2.1) we have $\text{length}_ A(A/xA) = \text{length}_ A(A'/xA')$. On the other hand, we have

\[ \text{length}_ A(A'/xA') = \sum [\kappa (\mathfrak m_ i) : \kappa (\mathfrak m)] \text{length}_{A'_ i}(A'_ i/xA'_ i) \]

by Algebra, Lemma 10.52.12. Since $x \in \mathfrak m$ we see that each term on the right hand side is positive. We conclude that the induction hypothesis applies to $a_1, a_2$ in each $A'_ i$ if $r > 1$ or if $r = 1$ and $[\kappa (\mathfrak m_1) : \kappa (\mathfrak m)] > 1$. We conclude that we may assume each $A'$ as above is local with the same residue field as $A$.

Applying the discussion of the previous paragraph, we may replace $A$ by the ring constructed in Lemma 42.4.2 for $a_1, a_2 \in A$. Then since $A$ is local we find, after possibly switching $a_1$ and $a_2$, that $a_2 \in (a_1)$. Write $a_2 = a_1^ m c$ with $m > 0$ maximal. In fact, by Lemma 42.4.3 we may assume $m$ is maximal even after replacing $A$ by any finite extension $A \subset A'$ as in the previous paragraph. If $c$ is a unit, then we are done. If not, then we replace $A$ by the ring constructed in Lemma 42.4.2 for $a_1, c \in A$. Then either (1) $c = a_1 c'$ or (2) $a_1 = c a'_1$. The first case cannot happen since it would give $a_2 = a_1^{m + 1} c'$ contradicting the maximality of $m$. In the second case we get $a_1 = c a'_1$ and $a_2 = c^{m + 1} (a'_1)^ m$. Then it suffices to prove the lemma for $A$ and $c, a'_1$. If $a'_1$ is a unit we're done and if not, then $\text{length}_ A(A/cA) < \ell $ because $cA$ is a strictly bigger ideal than $a_1A$. Thus we win by induction hypothesis.
$\square$

## Comments (2)

Comment #6810 by Laurent Moret-Bailly on

Comment #6953 by Johan on

There are also: