Projective direct image need not preserve surjections (source code)

= Projective direct image need not preserve surjections

For $f:\mathbb P^1_k\to\operatorname{Spec}k$, let $D$ consist of $0$ and infinity. Its ideal sheaf is $\mathcal O(-2)$, giving an exact coherent sequence $0\to\mathcal O(-2)\to\mathcal O\to\mathcal O_D\to0$. The map on global sections is the diagonal $k\to k\oplus k$, which is not surjective. Since direct image to the point is global sections, projectivity does not make direct image right exact.