I have a general question on using dimension formulas for linear maps.
I only know the some dimension formulas for linear maps $f:V\to W$ between $k$-vector spaces $V$ and $W$, i.e. $\dim{(V)}=\dim{(\ker(f))}+\dim {(\text{Im}(f))}$
What about if $f$ is a $\mathbb{Z}$-linear map between finitely generated abelian groups $V$ and $W$, do I have a similar dimension formular as above, i.e. $\text{rank}(V)=\text{rank}(\ker(f))+\text{rank}(\text{Im}(f))$? If yes, in which situations is it allowed to apply dimension formulas?
The background of my question is the following:
I want to calculate (for example) the simplicial homology with coefficients in $\mathbb{Z}$ for the torus $X=S^1\times S^1$ (considered as a topological space) and therefore I have to calculate the kernels and images if the simplicial boundary maps $\partial_*$. It is possible to write down transformation matrices of these boundary maps with respect to the canonical bases. Afte applying Gaussian elimination to determine the kernels and ranges I tried to apply a dimension formula as above. For the torus I obtained a correct solution, but I guess if you do this for the $\mathbb{RP}^n$ instead of the torus, again homology with coefficients in $\mathbb{Z}$, you obtain a wrong solution (if I remember correctly! I'm not 100 % sure) I guess.
Regards