Counting global sections, measuring obstructions, and the most powerful theorem in algebraic geometry
Sheaf cohomology measures what you can do locally but not globally. On the projective line you can watch it happen: two charts, one overlap, and a row of monomials that either glue, or don’t.
Slide n and run the differential. Sections over U₀ fall from above and sections over U₁ rise from below onto the overlap. Gold tiles are hit by both: global sections. Violet tiles are hit by neither: H¹. Click a tile to see it in each chart.
For n = 2 the rose and cyan rows overlap in 3 monomials, x₀ⁿ, …, x₁ⁿ: the degree-2 polynomials, which are the global sections. Together the rows cover every monomial, so nothing is left for H¹.
Tiles are monomials x₀n−j x₁j on the overlap, written tj with t = x₁/x₀. Rose tiles are the sections over U₀ (j ≥ 0), cyan the sections over U₁ (j ≤ n). Every Laurent polynomial is a finite sum of these, so the counts are the dimensions.
Cover P¹ by U₀ = {x₀ ≠ 0} and U₁ = {x₁ ≠ 0}. Each is an affine line and their overlap is Spec k[t, t−1], with t = x₁/x₀. A section of the line bundle O(n) over the overlap is a Laurent polynomial, a finite sum of the monomials x₀n−jx₁j, one tile for each j. Such a monomial extends over U₀, where x₀ may be inverted but x₁ may not, exactly when j ≥ 0. It extends over U₁ exactly when n − j ≥ 0. That is the whole of the input.
Čech cohomology packages the gluing question as a complex. The 0-cochains are pairs (σ₀, σ₁) of sections over U₀ and U₁; the 1-cochains are sections over the overlap; and the differential is d(σ₀, σ₁) = σ₁ − σ₀, which compares the two on the overlap. The animation is this map acting on a basis. Its kernel is the pairs that agree, which glue into a global section: that is H⁰, the gold tiles with 0 ≤ j ≤ n, the homogeneous polynomials of degree n. Its cokernel is everything on the overlap that is not a difference of chart sections: that is H¹, the violet tiles with n < j < 0.
So h⁰ = max(n + 1, 0) and h¹ = max(−n − 1, 0). For n ≥ −1 the two rows together cover every tile and H¹ vanishes. For n ≤ −2 they are pulled apart and leave a gap of −n − 1 monomials that no chart can reach. Those are genuine obstructions: data on the overlap that cannot be split into a piece from each side. Two charts suffice because every affine scheme has no higher cohomology, and the library checks the closed formulas against an explicit rank computation of the differential.
For a line bundle L on a smooth projective curve of genus g, the Riemann–Roch theorem says h⁰(L) − h¹(L) = deg L + 1 − g. P¹ has genus 0 and O(n) has degree n, so the prediction is h⁰ − h¹ = n + 1, and the third readout confirms it for every n on the slider. In the tiles the reason is simple counting: shifting n by one adds a tile to the gold run or removes one from the violet gap, never both.
Serre duality pairs H¹(L) with H⁰(ω ⊗ L∨), where ω is the canonical bundle. On P¹, ω = O(−2), so h¹(O(n)) = h⁰(O(−n − 2)). Switch on the dual and the engine names the partners: the H¹ class x₀ax₁b (both exponents negative) pairs with the global section x₀−a−1x₁−b−1 of O(−n − 2). Their product is x₀−1x₁−1, which up to the differential dt is dt/t, the form whose residue is 1. That residue pairing is Serre duality on P¹, one monomial at a time.
The same two statements hold on any smooth projective curve, where no row of tiles is available and the cohomology is much harder to see. P¹ is the one case where you can watch every class being born.
Spot a mistake or have an idea?