A criterion for inclusion in a monomial ideal

Let $I = (m_i \ | i \in I)$ be a monomial ideal in $F[x_1,\ldots,x_n]$. Prove that $p \in I$ if and only if each term in $p$ is divisible by some $m_i$. Use this criterion to show that $p = x^2yz + 3xy^2$ is in $(xyz, y^2)$ but not in $(xz^2, y^2)$.

Certainly, if each term in $p$ is divisible by some $m_i$ then $p \in I$. Suppose now that $p \in I$. We have $p = \sum a_im_i$, where $a_i = \sum n_{i,j}$. (each $n_{i,j}$ is a monomial.) Then $p = \sum_i \sum_j n_{i,j}m_i$. Thus each term in $p$ is divisible by some $m_i$.

Now let $p = x^2yz + 3xy^2$. Since $x^2yz = x(xyz)$ and $3xy^2 = 3x(y^2)$, $p \in (xyz, y^2)$. However, since $xz^2$ does not divide either $x^2yz$ or $3xy^2$, $p \notin (xz^2, y^2)$.