Is a finite flat module which is free modulo radical free?

Let $$R$$ be a commutative ring and $$M$$ is an $$R$$-module. The following statement is well-known.

If $$M$$ is finitely presented flat module, $$M/J(R)M$$ is free over $$R/J(R)$$ then $$M$$ is free.

Here $$J(R)$$ is the (Jacobson) radical of $$R$$. Is the statement true for finite $$M$$? I expect that it is not, but was not able to construct a counter-examples. Clearly, in a counter-example the ring $$R$$ is not Noetherian. Also, local $$R$$ won't work, since over a local ring any finite flat module is free.

• By a ‘finite flat module’, I guess you mean a ‘finitely generated flat module’? Feb 19 '21 at 10:53
• Yes, finite module is a shorter way to say finitely generated module.
– Alex
Feb 19 '21 at 11:19

Set $$I := J(R)$$. Suppose $$M/IM$$ has rank $$n$$ as a free $$A/I$$-module; let $$x_{1},\dotsc,x_{n} \in M$$ be elements whose images in $$M/IM$$ form a basis for it as a free $$A/I$$-module, let $$N \subseteq M$$ be the $$A$$-submodule generated by the $$x_{i}$$. Then $$M = N$$ by the usual Nakayama argument ($$M/IM = (N+IM)/IM$$ implies $$M = N+IM$$ implies $$M/N = (N+IM)/N = I(M/N)$$ so $$M/N = 0$$) so we have a surjection $$\varphi : A^{\oplus n} \to M$$. For all maximal ideals $$\mathfrak{m}$$ of $$A$$, the localization $$M_{\mathfrak{m}}$$ is a free $$A_{\mathfrak{m}}$$-module (by e.g. the local case) of rank $$n$$ (since $$(M/I)_{\mathfrak{m}}$$ is a free $$(A/I)_{\mathfrak{m}}$$-module of rank $$n$$), so the localization $$\varphi_{\mathfrak{m}}$$ is an isomorphism (the "determinant trick", see Corollary (10.4) here), hence $$\varphi$$ is an isomorphism.
I guess more-or-less equivalently you could also use a limit argument to say that $$M$$ is locally finitely presented, then use e.g. Tag 00EO to conclude that $$M$$ is (globally) finitely presented.
• How exactly determinant trick works in this proof? How do you know that ranks of $M_m$ are all the same?
• So, in principle $M_m = R_m^{n(m)}$, where $n: \operatorname{Specm} \to \mathbb{N}$ is a function, but $(M/IM)_m=M_m/IM_m = R_m/IR_m \otimes_{R_m} M_m =(R_m/IR_m)^{n(m)} = (R/I)_m^n$. So $n(m)=n$, since $IR_m \neq R_m$ for any $m$. That is how I understood your proof.