In Hartshorne's algebraic geometry, there is an exercise (exercise 2.5.8 (3)): ($ Frac $ means fraction field of an integral domain)

Assume $ X $ is a reduced (noeterian) diet (WLOG $ X = Spec , R $), and suppose $ M $ is a coherent (i.e. qcoh + finite generated) $ mathcal O _X $– (WLOG $ R $-) module, with the property that,

$$ varphi ( mathfrak p) = dim _ {Frac , ( mathcal O_ {X, p} / mathfrak p)} M _ { mathfrak p} otimes _ { mathcal O_ {X, p }} Frac , ( mathcal O_ {X, p} / mathfrak p) $$

is constant for all $ mathfrak p $ in $ Spec , R $. **We would like to show $ M $ is a local for free $ mathcal O_X $-module.**

This exercise is not too difficult when switching to the total fraction ring of affine $ R $ and check what's going on at the generic point of each component, then use Nakayama; but which uses the theoretical generic points of the diagram harshly.

But this question seems to have a rather interesting meaning even for classical algebraic varieties (or arithmetic varieties, for example integer rings or Neron models) and in the more classical perspective, we only discuss the maximum spectra ; but in this case we cannot use the above argument (the condition that $ varphi ( mathfrak m) $ is constant on the max spectrum is now lower than above!). I still believe that the result should always be true, so I would like to know proof of it.

Thanks in advance to all.