Solution (source code)

= Solution

Suppose first that $\mathfrak a$ is $\mathfrak m$-<primary>. Since $R$ is a <Noetherian ring>, choose a finite <generating set of an ideal> $\mathfrak m=(x_1,\ldots,x_d)$. The equality of <radicals of ideals> $\sqrt{\mathfrak a}=\mathfrak m$ supplies positive integers $e_i$ with $x_i^{e_i}\in\mathfrak a$. Set
$$
n=1+\sum_{i=1}^d(e_i-1).
$$
Every product of $n$ generators has some $x_i$ appearing at least $e_i$ times. Such products generate the <product of ideals> $\mathfrak m^n$, so $\mathfrak m^n\subseteq\mathfrak a$. Also $\mathfrak a\subseteq\sqrt{\mathfrak a}=\mathfrak m$. If $\mathfrak m=0$, take $n=1$ directly.

Conversely, suppose $\mathfrak m^n\subseteq\mathfrak a\subseteq\mathfrak m$. Taking <radicals of ideals> gives
$$
\mathfrak m=\sqrt{\mathfrak m^n}\subseteq\sqrt{\mathfrak a}\subseteq\mathfrak m.
$$
Hence $\sqrt{\mathfrak a}=\mathfrak m$. The only <maximal ideal> containing $\mathfrak a$ is $\mathfrak m$: any such <maximal ideal> contains $\sqrt{\mathfrak a}$ and therefore equals $\mathfrak m$. By the <correspondence theorem for ideals>, the <quotient ring> $R/\mathfrak a$ is a <local ring> with <maximal ideal> $\mathfrak m/\mathfrak a$. Every element outside this <maximal ideal> is a <unit>.

If $ab\in\mathfrak a$ and $a\notin\mathfrak a$, then $b$ cannot be outside $\mathfrak m$, since multiplying by its inverse in the <quotient ring> would give $a\in\mathfrak a$. Thus $b\in\mathfrak m$ and $b^n\in\mathfrak a$, proving the required <primary ideal> condition. We have proved the <maximal-primary ideal criterion>
$$
\boxed{\mathfrak a\text{ is }\mathfrak m\text{-primary}\iff\mathfrak m^n\subseteq\mathfrak a\subseteq\mathfrak m\text{ for some }n\geq1.}
$$