# Injective Functions into Free Modules

As a follow-up to this question, I am trying to prove the following:

If $F$ be a free $R$-module on a set $S$ via the function $i:S \longrightarrow F$ then $i$ is necessarily injective.

Attempted Proof: This means that for every $R$-module $X$ and every function $f:S \longrightarrow X$ there exists a unique $R$-linear function $\tilde{f}:F \longrightarrow X$ such that $\tilde{f} \circ i = f$. So, consider the function $f:S \longrightarrow X$ defined by $f(x) := 0_X \;\forall\; x \in S$ where $0_X$ denotes the additive identity in $X$. Then, by definition of a free module,

$$\tilde{f} \circ i = f \implies \tilde{f} \circ i = 0_X$$ But, this means that $\tilde{f}$ is a left-inverse for $i$ and $i$ has a left-inverse if and only if it is injective. Therefore, $i$ must be injective.

So, my question is, does this proof work?

-
No, if the composition is the zero function, then this does not mean that $\tilde{f}$ is a left inverse of anything; you would need the composition to be the identity function to get that conclusion. – Arturo Magidin Jan 14 '12 at 22:26
Note that if you have a composition $\overline{f}\circ i$, you want to show that the composition is one-to-one in order to conclude that $i$ is one-to-one. But if the composition is the zero function, then the composition is certainly not one-to-one, you cannot conclude anything about the first function being applied. – Arturo Magidin Jan 14 '12 at 22:41

To show that $i$ is injective, consider $R$ as a module over itself. Then $R$ is cyclic, generated by $1_R$.
Now, let $s,t\in S$ such that $i(s)=i(t)$. Define $f\colon S\to R$ by $$f(u) = \left\{\begin{array}{ll} 1_R &\text{if }u=s,\\ 0 &\text{if }u\neq s. \end{array}\right.$$ Then $f$ extends to a module homomorphism $\overline{f}\colon F\to M$. Then $$1_R = f(s) = \overline{f}(i(s)) = \overline{f}(i(t)) = f(t).$$
(If your rings don't have identity, then pick any $x\in R$, $x\neq 0$, and consider ideal generated by $x$, $\{nx + rx\mid n\in\mathbb{Z}, r\in R\}$; then map $s$ to $x$ and everything else to $0$).