I am given to understand that the main property of flat morphisms is that they give some precise notion of "continuously varying family of fibres". I realise there is a fair bit of literature on this, but I really wanted to nail down what exactly is the most general form of this statement. Most of the introductory texts do this in the case of varieties, and I am finding it hard to distil out exactly what hypotheses are necessary.
I am happy to allow some mildly reasonable assumptions: Suppose $f: X \rightarrow Y$ is a finite type morphism of noetherian schemes. Then we obtain the following: For $p \in X$,
$$
\dim (\mathcal{O}_{X,p}) = \dim( \mathcal{O}_{Y, f(p)} )+ \dim( \mathcal{O}_{X,p} \otimes \kappa(f(p))).
$$
I was surprised when I learned the proof of this to find that it is entirely a claim about local rings: One inequality is obtained by going-down property of flatness, and the other is obtained by lifting generators of an $\mathcal{m}$-primary ideal in the local ring. This most definitely requires noetherianness, but only locally of finite type, but let's stick with finite type.
But this doesn't really seem to tell us the dimension of the fibre. Indeed it may be the case that neither $p$ nor $f(p)$ is a closed point, and so the codimension of the point $p$ in the fibre $f^{-1}(p)$ may not be the dimension of $f^{-1}(p)$ at all.
So to give some kind of precise questions:
1) What exactly is "the dimension of the fiber at $p \in X$"?
2) What extra hypotheses need to be put on $f: X \rightarrow Y$ in order to ensure that the fibre is of pure dimension? Since indeed it may have many irreducible components.
3) What extra hypotheses are needed on $f: X \rightarrow Y$ in order to ensure all fibres have the same dimension, assuming "dimension of the fibre" has been defined.
Best Answer
Here is what I found.
For the irreducible case we have:
Proof/Source: See these notes of Brian Conrad
For the non-irreducible case we have:
Proof/Source: Görtz and Wedhorn, Algebraic geometry I. Theorem 14.114 and the remark after.
So as a corollary from the above, you don't have to worry about irreducibility if you are working with varieties.
Now, a counterexample that escape both theorems:
Proof/Source: Görtz and Wedhorn, Algebraic geometry I. Exercise 14.24.