How to prove this sufficient condition for when a monomial ideal is primary. This answer does a good job at explaining that if $I$ is primary monomial ideal in $k[x_1, \dots, x_n]$, then $I = (x_{i_1}^{a_1}, \ldots, x_{i_m}^{a_m}, m_1, \ldots, m_k)$ where $m_1, \ldots, m_k$ only involve variables among $x_{i_1}, \ldots, x_{i_m}$.

However, it doesn't show that if $I = (x_{i_1}^{a_1}, \ldots, x_{i_m}^{a_m}, m_1, \ldots, m_k)$ as above, then $I$ is primary.
How do we prove this?
One thing we know is that if $I = (x_{i_1}^{a_1}, \ldots, x_{i_m}^{a_m}, m_1, \ldots, m_k)$ where $m_1, \ldots, m_k$ only involve variables among $x_{i_1}, \ldots, x_{i_m}$, then ${\rm rad}(I)=(x_{i_1}, \ldots, x_{i_m})$ which is prime.
 A: As you mentioned, $\sqrt{I} = (x_{i_1}, \ldots, x_{i_m})$ is prime.
Now suppose that $ab \in I$ and that $b^n \notin I$ for all $n \in \mathbb{N}$, i.e. $b \notin \sqrt{I}$.  We want to conclude that $a \in I$.
That $b \notin \sqrt{I}$ implies that $b$ has a monomial component $b_\lambda$ such that $x_{i_l} \nmid b_\lambda$ for each $1 \leq l \leq m$.
Recall that a polynomial $f$ is in a monomial ideal $J$ iff each monomial of $f$ is in the ideal $J$.
Pick a lexicographic ordering that prioritizes all of the $x_{i_l}$, $1\leq l \leq m$, over the other $x_j$. Assume WLOG that $b_\lambda$ is the monomial summand of $b$ with the lowest degree with respect to this ordering.
Now with this lexicographic ordering in mind, consider the product $ab \in I$.  The contributions to the lowest degree term of the product come exclusively from $b_\lambda$ and the lowest degree term $a_\gamma$ of $a$.  Thus $b_\lambda a_\gamma \in I$, and hence is a constant multiple of either $m_i$ or $x_{i_l}^{a_l}$.  In either case we can deduce from $x_{i_l} \nmid b_\lambda$ that $m_i$ or $x_{i_l}^{a_l}$, respectively, divides $a_\gamma$.  Thus $a_\gamma \in I$, and we can iterate the reasoning on the product $(a - a_\gamma)b \in I$ and so on to conclude that every monomial term of $a$ is in $I$, thus $a \in I$.
A: After a reordering of indeterminates we may assume that $i_1=1,\dots,i_m=m$. Let $I'$ be the ideal generated by $x_1^{a_1},\dots,x_m^{a_m},m_1,\dots,m_k$ in the polynomial ring $k[x_1,\dots,x_m]$. Then $\sqrt{I'}=(x_1,\dots,x_m)$ is a maximal ideal, hence $I'$ is primary.
Then notice that $I=I'[x_{m+1},\dots,x_n]$, that is, $I$ is the extension of $I'$ to $k[x_1,\dots,x_n]$. But the extension of a primary ideal to a polynomial ring is also primary; see Extension of primary ideal in polynomial ring.
