§ Cokernel is not sheafy

I wanted to understand why the Cokernel is not a sheafy condition. I found an explanation in Ravi Vakil's homework solutions which I am expanding on here.

§ Core idea

We will show that there will be an exact sequence which is surjective at each stalk, but not globally surjective. So, locally, we wil have trivial cokernel, but globally, we will have non-trivial cokernel.

§ Exponential sheaf sequence

02πiZα:inclOβ:exp()O0 \begin{aligned} 0 \rightarrow 2\pi i \mathbb Z \xrightarrow{\alpha: \texttt{incl}} \mathfrak O \xrightarrow{\beta:exp(\cdot)} \mathfrak O^* \rightarrow 0 \end{aligned}
  • O\mathfrak O is the sheaf of the additive group of holomorphic functions. O\mathfrak O^* is the sheaf of the group of non-zero holomorphic functions.
  • α\alpha, which embeds 2πn2πiZ2\pi n \in 2\pi i \mathbb Z as a constant function fn()2πinf_n(\cdot) \equiv 2 \pi i n is injective.
  • β(α(n))=e2πin=1\beta(\alpha(n)) = e^{2 \pi i n} = 1. So we have that the composition of the two maps βα\beta \circ \alpha is the zero map (multiplicative zero), mapping everything in 2πiZ2\pi i \mathbb Z to the identity of O\mathfrak O^*. Thus, d^2 = 0, ensuring that this is an exact sequence.
  • Let us consider the local situation. At each point p, we want to show that β\beta is surjective. Pick any gOpg \in \mathfrak O^*_p. We have an open neighbourhood UgU_gwhere g0g \neq 0, since continuous functions are locally invertible. Take the logarithm of gg to pull back gOpg \in O^*_p to loggOp\log g \in O_p. Thus, β:OOp\beta: O \rightarrow O^p is surjective at each local point pp, since every element has a preimage.
  • On the other hand, the function h(z)zh(z) \equiv z cannot be in OO^* If it were, then there exists a homolorphic function called lOl \in O [for log\log] such that exp(l(z))=h(z)=z\exp(l(z)) = h(z) = z everywhere on the complex plane.
  • Assume such a function exists. Then it must be the case that d/dzexp(l(z))=d/dz(z)=1d/dz exp(l(z)) = d/dz(z) = 1. Thus, exp(l(z))l(z)=zl(z)=1exp(l(z)) l'(z) = z l'(z) = 1[use the fact that exp(l(z))=zexp(l(z)) = z]. This means that l(z)=1/zl'(z) = 1/z.
  • Now, by integrating in a closed loop of eiθe^{i \theta}. we have l(z)=l(1)l(1)=0\oint l'(z) = l(1) - l(1) = 0.
  • We also have that l(z)=1/z=2πi\oint l'(z) = \oint 1/z = 2\pi i.
  • This implies that 0=2πi0 = 2\pi i which is absurd.
  • Hence, we cannot have a function whose exponential gives h(z)=zh(z) = z everywhere.
  • Thus, the cokernel is nontrivial globally.