The local criterion for flatness goes this way:
Let $\phi : (A,m)\rightarrow (B,m')$ be a local morphism of local Noetherian rings, and $M$ a finitely generated $B$-module. If $x\in m$ is a non-zero divisor on $A$ then $M$ is flat over $A$ iff $M/xM$ is flat over $A/xA$ and $x$ is a non-zero divisor on $M$.
One usual geometric interpretation (see for instance Eisenbud, Commutative Algebra with a View Towards Algebraic Geometry, chapter 6.4) is the following:
If we have a morphism of affine varieties $X\rightarrow Y$ over $\mathbb{A}^1$ such that the maps to $\mathbb{A}^1$ are flat and dominant, for any point $p$ in $\mathbb{A}^1$ choose a point $p'$ in $Y$ above $p$ and a point $p''$ in $X$ above $p'$. If the map of fibers $X_{p}\rightarrow Y_{p}$ is flat in a neighborhood of $p''$ in $X_{p}$, then the map $X\rightarrow Y$ is also flat in a neighborhood of $p''$ in $X$.
It is easy to see that using the local criterion for flatness we get the flatness of the map $X\to Y$ at the point $p''$, but I fail to see how we get this property on a neighborhood of $p''$ in $X$ without using a much stronger result, namely the openness of the flat locus (or, since we are dealing with irreducible variety, generic flatness (or freeness) type of results, see the discussion in the comments following @Eric Canton answer). Am I missing something here ??
This is really getting a lot messier than I thought it would, at first...
– Eric Canton Jun 13 '17 at 19:05