Let $R$ be a commutative ring with unit. Let $M\_A$ denote the submodule of $R^m$ generated by columns of a matrix $A$ with entries in $R$. Suppose we are given two matrices $A,B \in R^{m \times k}$. I want to know if the following statement is true:


1. $M\_A = M\_B$ if and only if there exists an invertible matrix $P \in R^{k \times k}$ such that $A = BP$.


Note that one direction is super-easy: if $A = BP$ for invertible $P$, then the columns of both $A$ and $B$ generate the same submodule of $R^m$. So really the question is about the other direction. This is what I have tried for the "only if" direction: since $M\_A = M\_B$, we know that one can find matrices $P, Q \in R^{k \times k}$ such that $A = BP$ and $B = AQ$. From this we deduce that $A(I - QP)= B(I - PQ) = 0$. From here on, I don't really know what to do, but most likely this approach is just too naive.


However, I think the answer is true for a ring $R$ when $R$ is a principal ideal ring. Does anybody have a reference to this result (the particular case I want is when $R = \mathbb{Z}\_d$, so a reference to this will also suffice)? More generally, I'd like to know for which rings does this property hold, and where can I find a proof of this result.


EDIT: Actually now I'm beginning to think that the result may not be true in general for PIRs. However, some special cases are true. I know the following facts:


(i) If you replace PIR by PID (principal integral domain), then the result is true.


(ii) If you have a PIR, and both $A,B$ have one row, then the result is true. Proof goes like this: Since a PIR is a Hermite ring, there exists an invertible matrices $K,K'$ such that $AK = (s,0,\dots,0)$ and $BK' = (s',0,\dots,0)$. Thus $s,s'$ generate the same ideal, and thus they must be associates (which is a property of PIRs by a result of I.Kaplansky). The result now follows.


(iii) If you are allowed to add zero columns to both $A,B$, then also the result is true, because of the existence of the Howell normal form. (see [this](https://en.wikipedia.org/wiki/Howell_normal_form) and the references therein).


I'd like to stress that I'm interested in the case when the ring is $\mathbb{Z}\_d$.



Condition for equality of modules generated by columns of matrices
Interpreting the various matrices as maps between free modules in the usual way, the question becomes:


If $M$ is a submodule of $R^m$, and $\alpha,\beta: R^k\to M$ are epimorphisms, then must $\alpha$ and $\beta$ be equivalent, in the sense that there is an automorphism $f:R^k\to R^k$ with $\alpha = \beta f$?


For $R=\mathbb{Z}/d\mathbb{Z}$, or indeed any artinian $R$, the answer is yes, since then for finitely generated modules we have projective covers and a Krull-Schmidt theorem, so both $\alpha$ and $\beta$ are equivalent to the same epimorphism $\gamma:R^k=P(M)\oplus Q\to M$, where $P(M)$ is the projective cover of $M$, and $\gamma$ restricts to the usual map $P(M)\to M$ on $P(M)$ and the zero map on $Q$.


However, the answer is no if $R$ has a stably free module $P$ that is not free. For then, suppose $P\oplus R^n\cong R^k$. Then we have two epimorphisms $R^k\to R^n$, one with kernel $P$, and one with kernel $R^{k-n}$. Since they have non-isomorphic kernels, these epimorphisms can't be equivalent.


