Artificial intelligent assistant

Ring map-integers proof Prove that there is a ring map from $\mathbb{Z}/n\mathbb{Z}$ to $\mathbb{Z}/m\mathbb{Z}$ iff $m|n$. I am not able to prove this with the appropriate rigour, could someone show the steps for a proof?

$\def\Z{\mathbb Z}$ First suppose that there is a ring morphism $\phi\colon\Z/n\Z \to \Z/m\Z$. Then $0= \phi(0) = \phi(n \cdot 1) = n \cdot \phi(1) = n$, hence $n + m\Z = 0$, which gives $m \mid n$.

If on the other hand $m \mid n$, define $\phi\colon \Z/n\Z \to \Z/m\Z$ by $\phi(a + n\Z) = a + m\Z$, this is well defined: If $a + n\Z = b+n\Z$, then $n \mid a-b$, hence $m \mid a-b$, so $a + m\Z = b+m\Z$. Obviously $\phi$ is a homomorphism.

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy 220850d2e9edce0a8d0f025a3ffd6c79