# Flatness of module over field of fractions

This is from Liu 1.2.9.

Let $A$ be an integral domain, and $K$ its field of fractions. Let $M$ be a finitely generated sub-$A$-module of $K$. Why do $M$ is flat if and only if $M_{\mathfrak p}$ is free of rank $1$ over $A_\mathfrak p$ for every prime ideal $\mathfrak p$ of $A$?

For a finitely generated module over a local ring being flat is the same as being free. Can the fraction field of a domain have two elements linearly independent over the domain? Try this for $\mathbf{Z}$, for example.
• So there is a mistake in Liu? I understand the Theorem 2.16 on page 11 that a finitely generated flat module over a local ring is free over that ring and $\operatorname{Frac}(\mathbb Z_{p\mathbb Z})$ is free over $\mathbb Z_{p\mathbb Z}$ but not finitely generated. – Jaakko Seppälä Jan 22 '15 at 22:13
• @user2219869 I made a small correction about an hour ago thanks to user26857 but even given that I don't understand your question. I don't think $\mathbf Q$ is free over $\mathbf Z_{(p)}$. Why would that be? – Hoot Jan 22 '15 at 23:03