TITLE: injective $R$-module homomorphism vs. injective ring homomorphism
QUESTION [6 upvotes]: The following question has been lingering in my mind for months. 
Let $R$ be a non-zero commutative ring with $1$. Consider $\phi : R^n \rightarrow R^m$,
1) as an injective $R$-module homomorphism.
2) as an injective ring homomorphism. (by definition $\phi(1)=1$.)
In which of the above cases, we can deduce that $n \leq m$? and why?

REPLY [4 votes]: Let $R = \mathbb{Z}/2\mathbb{Z} \times \mathbb{Z}/2\mathbb{Z} \times \ldots \times \mathbb{Z}/2\mathbb{Z}$ (infinitely many times). Then as a ring $R^m = R^n = R$ $\forall m, n \in \mathbb{N}$. So the answer is negative in the case 2. But in the first case the answer is YES. But proof for general commutative ring is complicated. Here I am giving an easy proof assuming $R$ is commutative noetherian ring. After localizing at a minimal prime ideal we may assume that $R$ is a zero dimensional local ring ie artinian ring and $\phi : R^n \rightarrow R^m$ is an injective $R$ module homomorphism. Now length of $R$ as a $R$ module is finite and is equal to $l$ (say). Then comparing the length of both sides we have $ln \leq lm$. This means that $n \leq m$