Why is the restriction map $\mathcal{O}_X(U) \to \mathcal{O}_X(V)$ a flat morphism? I am reading page 255 of Qing Liu and he claims that if $U,V$ are affine open subsets of a scheme $X$, then $\mathcal{O}_X(U) \to \mathcal{O}_X(V)$ is a flat morphism. Why is this necessarily the case? There are no finiteness assumptions or anything right now on $X$.
If $V = \operatorname{Spec} A_f$ and $U = \operatorname{Spec} A$ then the restriction map is just the canonical map $A \to A_f$ which is flat by exactness of localization. What about the general case of $V$ not necessarily being a basic open set?
 A: While reading page 255, your question is answered on page 136. Namely, we have the usual definition 3.1 of flatness. Then Proposition 3.3 tells us that open immersions are flat (which is trivial) and that a morphism of affine schemes $X \to Y$ is flat iff $\mathcal{O}(Y) \to \mathcal{O}(X)$ is a flat homomorphism (which is already proven on page 11 in Corollary 2.15). Hence, if $X \to Y$ is an open immersion of affine schemes, then $\mathcal{O}(Y) \to \mathcal{O}(X)$ is flat.
Remark: If $X \to Y$ is an open immersion between arbitrary schemes, then $\mathcal{O}(Y) \to \mathcal{O}(X)$ doesn't have to be flat.
A: I think this is just commutative algebra (as are many things in scheme theory!). Basically, a homomorphism of commutative rings $\phi:A\to B$ is flat if and only if the induced homomorphisms $A_{\mathfrak{\phi^{-1}(p)}}\to B_{\mathfrak{p}}$ are flat for all prime ideals $\mathfrak{p}$ of $B$. (If you don't know the proof of this, then it's a good exercise to do!)
In our case, these induced homomorphisms are actually isomorphisms so must be flat.
I hope that helps!
