Let $R$ be a ring. Can we have two $R$-module maps $A, B: R^n \to R^m$ such that $\mathrm{Ker}(A) \cong \mathrm{Ker}(B)$, $\mathrm{Im}(A) \cong \mathrm{Im}(B)$ and $\mathrm{CoKer}(A) \cong \mathrm{CoKer}(B)$, but such that there is **no** commutative diagram
$$\begin{matrix}
R^n & \overset{A}{\longrightarrow} & R^m \\
\cong && \cong \\
 R^n & \overset{B}{\longrightarrow} & R^m \\
\end{matrix} \quad ?$$


**Comments:** I have examples where any two of kernel, image and cokernel match but the third doesn't. The trickiest is to get just the image different: Take $R = \mathbb{R}[x,y,z]/(x^2+y^2+z^2-1)$ and the matrices $\left[ \begin{smallmatrix} 1&0&0 \\ 0&1&0 \\ 0&0&0 \\ \end{smallmatrix} \right]$ and $\left[ \begin{smallmatrix} 1-x^2&-xy&-xz \\ -xy&1-y^2&-yz \\ -xz&-yz&1-z^2 \\ \end{smallmatrix} \right]$. To get just kernel or just cokernel different, use the same ring and the matrices $\left( \left[ \begin{smallmatrix} 1\\0\\0 \end{smallmatrix} \right], \left[ \begin{smallmatrix} x\\y\\z \end{smallmatrix} \right] \right)$ or $\left( \left[ \begin{smallmatrix} 1&0&0 \end{smallmatrix} \right], \left[ \begin{smallmatrix} x&y&z \end{smallmatrix} \right] \right)$


We can make short exact sequences $0 \to \mathrm{Ker}(A) \to R^n \to \mathrm{Im}(A) \to 0$ and $0 \to \mathrm{Im}(A) \to R^m \to \mathrm{CoKer}(A) \to 0$, giving classes $E\_A \in \mathrm{Ext}^1(\mathrm{Im}(A), \mathrm{Ker}(A))$ and $F\_A \in \mathrm{Ext}^1(\mathrm{CoKer}(A), \mathrm{Im}(A))$. One can show that the diagram exists if and only if one can choose the isomorprhisms between Ker, Im and CoKer to make $E\_A = E\_B$ and $F\_A = F\_B$. Thus, a closely related question is: Can you find a ring $R$, finitely generated $R$-modules $M$ and $N$ and two short exact sequences $0 \to M \to R^k \to N \to 0$ whose classes in $\mathrm{Ext}^1(N,M)$ are in different orbits for the action of $\mathrm{Aut}(M) \times \mathrm{Aut}(N)$? If we don't ask for the middle term to be free, there are counterexamples [here](https://mathoverflow.net/questions/42174/can-a-module-be-an-extension-in-two-really-different-ways?rq=1) and [here](https://mathoverflow.net/questions/157938/short-exact-sequences-with-no-commutative-diagram-between-them), but I don't see how to tweak any of those counterexamples to make the middle term free.



Non isomorphic two term complexes with isomorphic kernel, image and cokernel
Let $R=k[x,y,z]/\left((xy-1)z\right)$, for $k$ some field.


Let $A:R\to R$ be multiplication by $z$.


Let $B:R\to R$ be multiplication by $xz$.


Then $A$ and $B$ have the same image, since $z=xyz$, and therefore isomorphic cokernels.


They also have the same kernel, namely the set of polynomials $p(x,y)$ that are multiples of $xy-1$.


The only units in $R$ are scalars, so there are no isomorphisms that complete a commutative square.


