Let $A$ be a PID and let $M$ be an $A$-module.
Suppose that there is an isomorphism of $A$-modules
$$\theta: M \;\to\; A^n \oplus T$$
where $n$ is a non-negative integer and $T$ is a torsion module.
I am asked to show that $A^n\cong M/M_{tor}\,$ where $M_{tor}$ is the torsion submodule of $M.$
Here is my attempt:
Let $p:A^n\oplus T \to A^n$ be projection onto the first component.
I am going to prove that $p\circ \theta : M\to A^n$ is a surjective $A$-linear map with kernel $M_{tor}.$
Surjectivity and $A$-linearity are obvious so it remains to prove the claim about the kernel.
If $t \in M_{tor},$ then
there exists non-zero $a \in A$ such that $at=0,$
we can write $\theta(t)=\phi+\tau$ for some unique $\phi \in A^n$ and $\tau \in T.$
Therefore we have $$0=\theta(at)=a\theta(t)=a\phi+a\tau$$ and so $a\phi=0.$ We must therefore have $\phi=0$ (because free modules over an integral domain are torsion-free) and so $\theta(t) \in T.$
If $t \in \ker(p\circ\theta),$ then $\theta(t) \in T$ and so there exists non-zero $a \in A$ such that $a\theta(t)=0.$
Hence $\theta(at)=0$ and since, $\theta$ is an isomorphism, we have $at =0\;$ i.e. $t \in M_{tor}.$
My questions are:
Is my proof right?
Is the purpose of this to show that the rank of a finitely generated module over a PID is well-defined?
Thank you very much!