# Cohomology of Affine Schemes

I am reading Hartshorne's thm. III.3.5 that an affine scheme $X=\mathrm{Spec}\,A$ over a noetherian ring $A$ has $H^i(X,\mathcal{F})=0$ for any quasicoherent sheaf $\mathcal{F}$ and $i>0$. I followed the proof (and the preceding results) fine until the last step.

This is the proof: let $M=\Gamma(X,\mathcal{F})$ and $0\to M\to I^\bullet$ an injective resolution of $M$ as an $A$-module. Then $0\to\widetilde{M}\to\widetilde{I^\bullet}$ is exact (because localization is exact, and exactness of sheaves can be checked on stalks). He proves in prop. 3.4 that $\widetilde{I}$ of an injective module is flasque (for noetherian $A$), so this resolution of $\widetilde{M}=\mathcal{F}$ can be used to compute cohomology.

The conclusion is: "Applying $\Gamma(X,\cdot)$, we recover the exact sequence of $A$-modules $0\to M\to I^\bullet$. Hence, $H^0(X,\mathcal{F})=M$, and $H^i(X,\mathcal{F})=0$ for $i>0$."

I don't understand this last step at all and think I am missing something fundamental.

To compute cohomology of $\tilde{M}$, you take an injective resolution, apply the global sections functor, and take cohomology of the resulting complex. What you definitely understand is the first step. So what I think you are most likely confused about is why $\Gamma(X,\tilde{M})=M$ and $\Gamma(X,\tilde{I})=I$. This is just by definition of sheaf associated to a module on an affine scheme (chapter II.5 of Hartshorne). So from $0\rightarrow \tilde{M}\rightarrow \tilde{I}^{\bullet}$, taking global sections gives us $0\rightarrow M\rightarrow I^{\bullet}$, which is exact because we chose it to be exact in the beginning. So computing cohomology of this complex is easy. We get that $H^0(X,\tilde{M})=M$ and $H^i(X,\tilde{M})=0$ for $i>0$. Please let me know if I misread your confusion, so I can adjust my answer.