TITLE: global sections of locally free sheaf on projective space
QUESTION [5 upvotes]: Let $\mathcal{E}$ be a locally free sheaf on $\mathbb{P}^n_A=\mathbb{P}^n\times_{Spec k} Spec A$, where $A$ is a finitely generated algebra over a field $k$. By a well known theorem (see e.g. Hartshorne's Algebraic Geometry, Thm 5.19) $H^0(\mathbb{P}^n_A, \mathcal{E})$ is a finitely generated $A$- module.

Is it true that $H^0(\mathbb{P}^n_A, \mathcal{E})$ is a projective module? 

Let $B$ be a finitely generated $k$-algebra, $f: Spec B \to Spec A$ a morphism and $f^*\mathcal{E}$ the pullback of $\mathcal{E}$ to $Spec B$.

Is it true that $H^0(\mathbb{P}^n_A, \mathcal{E})\otimes _A B= H^0(\mathbb{P}^n_B, f^*\mathcal{E})$ ?

1 and 2 above are true when $\mathcal {E}$ is a direct sum of line bundles of the form $\mathcal O(n)$. I was wondering if they are true for general $\mathcal{E}$.

REPLY [8 votes]: The answer to both questions is negative, see counterexamples below.
1) Let $A = k[x,y,z]$, $n = 1$. Note that 
$$
H^1(\mathbb{P}^n_A,O(-2)) \cong A.
$$
Consider the extension
$$
0 \to O(-2) \to E \to O \oplus O \oplus O \to 0
$$
whose extension class is $(x,y,z)$. Then the cohomolopgy exact sequence
$$
0 \to  H^0(\mathbb{P}^n_A,E) \to A \oplus A \oplus A \stackrel{(x,y,z)}\to A
$$
shows that $H^0(\mathbb{P}^n_A,E)$ is reflexive but not locally free (hence not projective). In fact, this is the simplest example of a reflexive non-locally free sheaf.
2) Take $A = k[x,y,z,w]$ and define $E$ as the extension
$$
0 \to O(-2) \to E \to O \oplus O \oplus O \oplus O \to 0
$$
whose extension class is $(x,y,z,w)$. Let $B = k$ with the morphism $A \to B$ defined by $x,y,z,w \mapsto 0$. Then $f^*E \cong O(-2) \oplus O \oplus O \oplus O \oplus O$, hence 
$$
H^0(\mathbb{P}^n_B,f^*E) = B \oplus B \oplus B \oplus B.
$$
On the other hand, tensoring
$$
0 \to  H^0(\mathbb{P}^n_A,E) \to A \oplus A \oplus A \oplus A \stackrel{(x,y,z,w)}\to A \to B \to 0
$$
by $B$ (over $A$), we deduce
$$
H^0(\mathbb{P}^n_A,E) \otimes_A B \cong Tor_2^A(B,B) \cong B^{\oplus 6}.
$$