Let $A$ be a nonzero commutative ring with $1$, and $n$ a positive integer. If $b_1,\ldots,b_n\in A^n$ generate $A^n$ as an $A$-module, is it true that $b_1,\ldots,b_n$ are linearly independent over $A$ (hence a basis)? I suspect this is true (It is true if $n=1$), but I can't seem to prove it.
I guess an equivalent way of asking this question is: if a linear map $A^n\to A^n$ is surjective, is it necessarily injective?
Any help is welcome!
Yes. Let $B$ be the $n\times n$ matrix consisting of $b_1 \cdots b_n$ as its columns, and $e_1,\ldots,e_n\in A^n$ the standard basis. Since $b_1,\ldots,b_n$ generate $A^n$, there exist $c_{ij}\in A$ such that $e_i=c_{i1}b_1+\cdots+c_{in}b_n$ for each $i$. Let $C$ be the $n\times n$ matrix whose $ij$-th entry is $c_{ji}$. Then $BC=I$, where $I$ is the $n\times n$ identity matrix. This implies that $\det B\in A$ is a unit, hence the linear map $B:A^n\to A^n$ is injective.