Separations between notions of rank for modules over commutative (semi-)rings with no zero divisors. Let $M$ be an $m$-by-$n$ matrix, here are three definitions$^5$ that we could use for rank:

*

*$rk(M) = \min k$ such that for matrices $P$, and $Q$ with $P$ of size $m$-by-$k$ and $Q$ of size $k$-by-$n$ we have $M = PQ$.


*$rrk_+(M)$ (3. $crk_+(M)$) is the maximum number of linearly independent rows (columns) of $M$. Where a set $S$ of vectors is linearly independent$^1$ if for all $u \in S$ there is no non-zero $k$ such that $ku$ can be written as a linear combination of vectors in $S - \{u\}$.
Now, if the elements of $M$ come from a field then $rk(M) = rrk_+(M) = crk_+(M)$. However, if we work with modules over a (semi-)rings then the story is different.
If we are working over a commutative (semi-)ring with no zero divisors$^2$ then how far apart can $rk$, $rrk_+$, and $crk_+$ be? Can this be bounded in terms of easily computable properties of $M$ and the (semi-)ring? I am primarily interested in finite $M$ and "well-behaved"$^3$ (semi-)rings$^4$.

Notes

*

*This definition of linear independence is not necessarily equivalent to the 'make the $0$-vector' definition for arbitrary (semi-)rings because (semi-)rings lack minus. I added the there is no non-zero $k$ part (instead of just the $k = 1$ case) after @Manos' answer.


*I ask for no zero divisors, because it is easy to come up with separations for general rings. For instance, consider $\begin{pmatrix} 2 & 2 \\ 3 & 3 \end{pmatrix}$ over $\mathbb{Z}_6$ and the obvious generalizations. I am not interested in examples like this because they are in some way an artifact of just the ring, not of the module.


*By "well-behaved", I mean you can assume all the nice properties you want since I want the issue to come from the module-ness aspect, not just the the (semi-)ring itself. In fact, I will be more than happy with an answer just for finite (semi-)rings (that meet my other restrictions).


*I know that semirings are much less studied than rings, so I will be happy with an answer for integral domains if the "semi-" part makes the question too awkward.


*I realize that there are many other definitions of rank and dimension for modules and (semi-)rings. I am interested in these three specific definitions of rank not to generalize fields but because they come up in application and I want to learn how to play with them. I appreciate pointers to other definitions or rank/dimension if you point out how they relate to the definitions I provide.
 A: Consider the ring of integers $\mathbb{Z}$. Then this is a principal ideal domain.
Consider the $1 \times 2$ matrix  $M = \left[ 2 \, \, \,  3 \right]$. Then $rk(M)=1=rrk_+(M)$, if we make the convention that any non-zero element of a $\mathbb{Z}$-module is linearly independent, but $crk_+(M)=2$ because $2 (3)$ can not be expressed as a linear combination of $3 (2)$ (maybe you can come up with more general examples using this idea).
I believe that in general these notions can be quite far apart, but even more importantly for algebraic purposes, they are inconsistent. Also, one can not go far with defining linear dependence in terms of expressing an element as a linear combination of others. A more general notion is that of algebraic dependence, where one requires the existence of not all zero coefficients such that a linear combination of the elements under examination yields zero.
Any any case, if you have a (finite) module $M$ over an integral domain $R$, then the rank of $M$ is defined as the dimension of the $K$-vector space $M \otimes_R K$, where $K$ is the field of fractions of the integral domain $R$. This turns out to be a very useful notion.
