This is Exercise 5.1.20 from Using Algebraic Geometry by Cox et al.
Let $M,N$ be $R$-modules. ($R$ is assumed to be a commutative ring with unity.) If $M$ is presented by $A$ and $N$ is presented by $B$, what conditions must a matrix $C$ representing a homomorphism $\phi: M\rightarrow N$ satisfy? Find a matrix $D$ presenting $\text{hom}(M,N)$.
My attempt: Let $f_1,\dots,f_s$ be a set of generators for $M$, and $g_1,\dots,g_t$ a set of generators for $N$. The homomorphism $\phi: M\rightarrow N$ is determined by $\phi(f_1),\dots,\phi(f_s)$. Write \begin{align*} &\phi(f_1)=c_{11}g_1+\cdots+c_{1t}g_t,\\ &\cdots,\\ &\phi(f_s)=c_{s1}g_1+\cdots+c_{st}g_t. \end{align*} Let $C$ be the matrix with $i$-th column the coefficients of $\phi(f_i)$. We can show that $\phi$ is well-defined if and only if $CA=BC'$, for some $C'$.
Conversely, we can show that if $C$ is a matrix such that $CA=BC'$, then $C$ defines a homomorphism from $M$ to $N$ by mapping $\sum d_if_i$ to $GCd$ where $d=(d_1, \dots, d_s)^T\in R^s$.
Furthermore, if $C_1$ and $C_2$ are two matrices representing the same homomorphism, we must have $B(C_1-C_2)=0$.
My Question:
Are these enough conditions for $C$?
To find a matrix presenting $\text{hom}(M,N)$, we must find a finite generating set. Since the conditions for $C$ are mixed up with $A$ and $B$, I'm not sure how to do that.
Thank you for your help!