Question on rank function. In a previous question I asked about the fiber $M(P)=M_P / PM_P$ where $M$ is an $A$-module and $P$ a prime ideal of $A$. Later I introduced the rank function $$rk_M : \text{Spec} A \to \mathbb{N} \cup \{ \infty \}$$ given by $$P \mapsto \dim_{A(P)} M(P).$$ I am supposed to prove that if $M$ is finitely generated then $rk_M(P)$ is finite and $rk_M(P) > 0$ iff $P \in \text{Supp}(M)$. I managed to prove everything expect the last implication $P \in \text{Supp}(M) \implies rk_M(P) > 0$, I am stuck on this one although I feel it should not be hard, any hints?

Its easy: if $P \in Supp(M)$, then $M(P)$ is a non-zero $A(P)$-vector space. For it were the zero space then we would have $M_P = P M_P$ and Nakayama's Lemma would imply $M_P=0$. But this contradicts the assumption that $P \in Supp(M)$. Thus $M(P)$ must have a positive dimension.
