# Does fibrewise vanishing of cohomology imply its vanishing (non-proper case)?

Let $$f: X\rightarrow S$$ be a quasi-compact, quasi-separated, flat morphism of schemes, with $$S$$ locally Noetherian. Also, fix an integer $$i\geq 1$$.

Question 1: Does $$H^i(X_s,\mathcal{O}_{X_s})=0$$, for all $$s\in S$$, imply that $$R^if_\ast\mathcal{O}_X=0$$?

The answer is yes, if $$f$$ is also assumed to be proper (flat base change+theorem of formal functions+easy direct proof for $$S$$ Artinian local). In general, I would expect that there are some simple counterexamples but, to my surprise, I didn't find anything in the literature - probably I simply looked in the wrong places! I should also add that I would be particularly interested in counterexamples in characteristic zero, i.e. where $$f$$ is a morphism of schemes over a field of characteristic zero.

Here is a variant of question 1:

Question 2: Assume in addition that $$f$$ has a section $$e: S\rightarrow X$$. What is the answer to question 1 then?

The "raison d'être" for asking question 2 in addition is that a colleague explained to me how, granting existence of a section, the assumptions above ensure that $$H^0(X_s,\mathcal{O}_{X_s})=\kappa(s)$$, for all $$s\in S$$, implies that $$f_\ast\mathcal{O}_X=\mathcal{O}_S$$. So, at least in this very special case, the fibres of $$f$$ "remember" what the global sections of $$f$$ are.

Example. Let $$X = \mathbf A^2 \setminus 0$$ and $$S = \mathbf A^1$$, where $$f \colon X \to S$$ is the first coordinate projection. The fibres are affine, so have no higher coherent cohomology.
But if $$V \subseteq S$$ is affine open containing $$0$$, then $$f^{-1}(V)$$ has an affine open cover by $$U_1 = V \times \mathbf G_m$$ and $$U_2 = (V \setminus 0) \times \mathbf A^1$$. Then the function $$\tfrac{1}{xy}$$ on $$U_{12}$$ is not a sum of functions on $$U_1$$ and $$U_2$$, so it gives a nonzero class in $$(R^1f_* \mathcal O_X)_0$$. $$\square$$