In the most naive form my question would be as follows: If $f:X\to \mathrm{Spec}\;A$ is a flat morphism of schemes is it true that $H^0(X,\mathcal{O}\_X)$ is a flat $A$-module?


In general the answer is no: It is a theorem of Chase that a ring $A$ is coherent (meaning that every finitely generated ideal of $A$ is finitely presented) if and only if the product $\prod\_I A$ is flat over $A$ for every set $I$. Hence if $A$ is not coherent one can find a set $I$ such that the global sections of $X=\coprod\_I \mathrm{Spec}\;A$ are not flat over $A$ while of course $X$ is flat over $\mathrm{Spec}\;A$. An example of a non-coherent ring would be $\mathbb{Q}[X,Y\_1,Y\_2,\ldots]/(XY\_1,XY\_2,\ldots)$.


Does anyone know other examples for which the answer is no and which fulfill at least some finiteness conditions? For example is there a quasi-compact example?


Ultimately I'd love to know if it is true if $A$ is noetherian and $f$ is proper.



Global sections of flat scheme also flat?
For another counterexample, let $A$ be $k[u,v,w]/uw-v^2$ and let $X$ be the complement of the origin in the plane $\text{Spec} \ k[x,y]$. Let $f$ be the restriction of the morphism of affine schemes corresponding to the map of rings $k[u,v,w]/uw-v^2 \to k[x,y]$ by $u\mapsto x^2$, $v\mapsto xy$, $w \mapsto y^2$. The morphism $f$ is flat. And by Hartog's theorem / S2 extension, $H^0(X,\mathcal{O}\_X)$ equals $k[x,y]$. But the ring homomorphism above is not flat: just consider the length when you quotient by the maximal ideal $\langle u,v,w\rangle $ in the domain ring.


If you assume that $A$ is Noetherian and $f$ is proper, then flatness should follow by Stein factorization.


