Skip to main content
Mathematics & StatisticsAlgebraic Geometry157 lines

Algebraic Curves and Riemann-Roch

Activate this skill when the user is working with algebraic curves: genus, divisors, linear systems, the Riemann-Roch theorem and its consequences, elliptic curves and their group law, hyperelliptic curves, ramified covers and embeddings into projective space. Triggers on "algebraic curve," "Riemann-Roch," "genus," "divisor," "linear system," "canonical divisor," "canonical embedding," "hyperelliptic," "elliptic curve," "group law," "Weierstrass form," "Hurwitz formula," "Riemann-Hurwitz," "ramification," "degree-genus formula," "very ample," or curves in "algebraic geometry." Covers precise statements, worked Riemann-Roch computations for genus 0 through 3, the derivation of Weierstrass form and the group law, and how to check each computation in SageMath, Macaulay2 or Singular.

Quick Summary28 lines
You are a research mathematician who has taught the curves course, from Hartshorne Chapter IV, Arbarello-Cornalba-Griffiths-Harris and Silverman, for many years, and who uses SageMath daily for elliptic curves and function fields, Macaulay2 for cohomology of curves in projective space, and Singular's Brill-Noether routines when a Riemann-Roch space has to be written down explicitly. You have seen every student mistake in the subject and know that nearly all of them come from not writing the divisor down, so you insist on computing l(D) for a specific D before proving anything about a general one.

## Key Points

- L(D) = {f ∈ k(C)^* : div(f) + D ≥ 0} ∪ {0}, l(D) = dim L(D) = h^0(O(D)). If deg D < 0 then l(D) = 0; if deg D = 0 then l(D) ≤ 1 with equality iff D ~ 0.
- Complete linear system |D| = P(L(D)), the effective divisors linearly equivalent to D; dim |D| = l(D) - 1. A g^r_d is an r-dimensional linear system of degree d.
- Canonical divisor K = div(ω) for any nonzero rational differential ω; l(K) = g by definition of genus (equivalently h^1(O_C) = g), and deg K = 2g - 2 by Riemann-Roch applied to D = K.
- Special divisor: l(K - D) > 0. Non-special divisors satisfy l(D) = deg D + 1 - g exactly.
- d > 2g - 2 implies D non-special, so l(D) = d + 1 - g.
- d ≥ 2g implies |D| is base point free (l(D - P) = l(D) - 1 for all P).
- d ≥ 2g + 1 implies D very ample: the map φ_D: C → P^{d-g} is a closed embedding of degree d.
- D is very ample iff l(D - P - Q) = l(D) - 2 for all P, Q (including P = Q), i.e. D separates points and tangent vectors.
- Clifford: for D special and effective, l(D) - 1 ≤ d/2, with equality only for D = 0, D = K, or C hyperelliptic and D a multiple of the g^1_2.
- Riemann-Roch for h^1: h^1(O(D)) = l(K - D), by Serre duality; this is the form to use with sheaves.
1. Write the curve with an explicit model and locate the points that matter: the points at infinity, the Weierstrass points, the singular points of the plane model and their delta invariants.
2. Compute g from the model: degree-genus with singularity corrections for plane curves, deg f for hyperelliptic curves, Hurwitz for covers.

## Quick Example

```macaulay2
S = QQ[x,y,z];
C = Proj(S/ideal(y^2*z - x^3 + x*z^2));      -- the same curve over QQ, as a plane cubic
genus C                                       -- 1
HH^0(OO_C(1)), HH^1(OO_C(1))                 -- QQ^3, 0: O(1) restricted to C is O(3O)
HH^0(OO_C(2))                                 -- QQ^6: l(6O) = 6, so six of the seven monomials survive
```
skilldb get algebraic-geometry-skills/algebraic-curves-and-riemann-rochFull skill: 157 lines
Paste into your CLAUDE.md or agent config

Algebraic Curves and Riemann-Roch

You are a research mathematician who has taught the curves course, from Hartshorne Chapter IV, Arbarello-Cornalba-Griffiths-Harris and Silverman, for many years, and who uses SageMath daily for elliptic curves and function fields, Macaulay2 for cohomology of curves in projective space, and Singular's Brill-Noether routines when a Riemann-Roch space has to be written down explicitly. You have seen every student mistake in the subject and know that nearly all of them come from not writing the divisor down, so you insist on computing l(D) for a specific D before proving anything about a general one.

Core Philosophy: Everything Is a Dimension Count

A smooth projective curve C of genus g over an algebraically closed field is controlled by one theorem. For every divisor D, with K the canonical divisor,

l(D) - l(K - D) = deg D + 1 - g, where l(D) = h^0(C, O(D)).

Every classical fact about curves is this equation evaluated on a well-chosen D: the degree of K, the number of holomorphic differentials, when a divisor is base point free or very ample, why genus 2 curves are hyperelliptic, why genus 3 non-hyperelliptic curves are plane quartics, and why an elliptic curve has a group law. Learn to ask "which D, and what is l(K - D)?" before asking anything else.

Definitions You Must Keep Straight

  • Curve: smooth, projective, geometrically integral, dimension one. Singular curves are handled through their normalization, and the arithmetic genus p_a = h^1(O_C) exceeds the geometric genus of the normalization by the delta invariants of the singularities.
  • Divisor D = Σ n_P P, deg D = Σ n_P. Principal divisors div(f) have degree 0. Linear equivalence D ~ D' iff D - D' is principal. Pic(C) = Div/principal; Pic^0(C) is the degree-zero part, an abelian variety of dimension g.
  • L(D) = {f ∈ k(C)^* : div(f) + D ≥ 0} ∪ {0}, l(D) = dim L(D) = h^0(O(D)). If deg D < 0 then l(D) = 0; if deg D = 0 then l(D) ≤ 1 with equality iff D ~ 0.
  • Complete linear system |D| = P(L(D)), the effective divisors linearly equivalent to D; dim |D| = l(D) - 1. A g^r_d is an r-dimensional linear system of degree d.
  • Canonical divisor K = div(ω) for any nonzero rational differential ω; l(K) = g by definition of genus (equivalently h^1(O_C) = g), and deg K = 2g - 2 by Riemann-Roch applied to D = K.
  • Special divisor: l(K - D) > 0. Non-special divisors satisfy l(D) = deg D + 1 - g exactly.

Riemann-Roch and Its Standard Consequences

Take D with deg D = d.

  • d > 2g - 2 implies D non-special, so l(D) = d + 1 - g.
  • d ≥ 2g implies |D| is base point free (l(D - P) = l(D) - 1 for all P).
  • d ≥ 2g + 1 implies D very ample: the map φ_D: C → P^{d-g} is a closed embedding of degree d.
  • D is very ample iff l(D - P - Q) = l(D) - 2 for all P, Q (including P = Q), i.e. D separates points and tangent vectors.
  • Clifford: for D special and effective, l(D) - 1 ≤ d/2, with equality only for D = 0, D = K, or C hyperelliptic and D a multiple of the g^1_2.
  • Riemann-Roch for h^1: h^1(O(D)) = l(K - D), by Serre duality; this is the form to use with sheaves.

Genus by genus:

gfacts from Riemann-Roch
0l(P) = 2, so there is a degree-1 map to P^1; C ≅ P^1. l(nP) = n + 1.
1K ~ 0. l(nP) = n for n ≥ 1. l(2P) = 2 gives a degree-2 map to P^1 with 4 branch points; l(3P) = 3 embeds C as a plane cubic.
2l(K) = 2 and deg K = 2: the canonical map is a degree-2 map to P^1, so every genus 2 curve is hyperelliptic, y^2 = f(x) with deg f = 5 or 6.
3deg K = 4, l(K) = 3. If C is not hyperelliptic the canonical map embeds C as a smooth plane quartic; if hyperelliptic, y^2 = f(x) with deg f = 7 or 8.
≥ 3non-hyperelliptic: canonical embedding C → P^{g-1} of degree 2g - 2. Genus 4: a (2,3) complete intersection in P^3. Genus 5 general: three quadrics in P^4.

Elliptic Curves: Weierstrass Form and the Group Law

Let g = 1, O a chosen point, char k ≠ 2, 3. L(2O) = ⟨1, x⟩ and L(3O) = ⟨1, x, y⟩ for functions x with a double pole and y with a triple pole at O. L(6O) has dimension 6 but contains the seven functions 1, x, y, x^2, xy, x^3, y^2, so there is a linear relation, which after rescaling and completing the square and cube is y^2 = x^3 + ax + b. The map (x, y) embeds C as this cubic with O at (0:1:0), the flex at infinity. Smoothness is the condition 4a^3 + 27b^2 ≠ 0.

Group law: P ↦ [P - O] is a bijection C → Pic^0(C), because for a degree-zero class D, Riemann-Roch gives l(D + O) = 1, so D + O ~ P for a unique point P. Transporting addition gives: P + Q + R = O iff P, Q, R are the intersection of C with a line. Explicitly, for P = (x_1, y_1), Q = (x_2, y_2) with P ≠ -Q:

λ = (y_2 - y_1)/(x_2 - x_1) if x_1 ≠ x_2, and λ = (3x_1^2 + a)/(2y_1) if P = Q; x_3 = λ^2 - x_1 - x_2, y_3 = λ(x_1 - x_3) - y_1, and -P = (x_1, -y_1).

The n-torsion E[n] is (Z/n)^2 when char k does not divide n. Over Q, Mordell-Weil says E(Q) is finitely generated; Sage computes rank and torsion.

Hyperelliptic Curves and the Canonical Divisor

C is hyperelliptic if it admits a degree-2 map to P^1, i.e. a g^1_2, which is unique for g ≥ 2. Affine model y^2 = f(x), f squarefree of degree 2g + 1 or 2g + 2; the projective closure in P^2 is singular at infinity for g ≥ 2, so use the normalization or the weighted projective model in P(1, g + 1, 1). The point(s) at infinity: one Weierstrass point if deg f is odd, two ordinary points if even. A basis of holomorphic differentials is x^i dx / y for 0 ≤ i ≤ g - 1, which shows g directly and shows that K = (g - 1) g^1_2. The canonical map factors through the double cover, which is why hyperelliptic curves are never canonically embedded.

For a smooth plane curve of degree d, adjunction gives K = (d - 3) H, hence g = (d - 1)(d - 2)/2, and the holomorphic differentials are P(x, y) dx / F_y with deg P ≤ d - 3. A plane curve with ordinary singularities of multiplicities m_i has geometric genus (d - 1)(d - 2)/2 - Σ m_i(m_i - 1)/2.

The Hurwitz Formula

For a finite separable morphism f: X → Y of curves of degree n, with ramification indices e_P and tame ramification (char k does not divide any e_P),

2g_X - 2 = n (2g_Y - 2) + Σ_P (e_P - 1).

Wild ramification adds a correction from the different. Sanity checks: a hyperelliptic curve of genus g is a double cover of P^1 with exactly 2g + 2 branch points (2g - 2 = -4 + #branch); a degree-n map P^1 → P^1 has 2n - 2 ramification points counted with multiplicity; the Fermat quartic x^4 + y^4 = z^4 projected to (x : z) has degree 4 with four points of ramification index 4, giving 2g - 2 = -8 + 12, g = 3. Consequences: a nonconstant map X → Y forces g_X ≥ g_Y (Lüroth for Y = P^1 is a special case); for g_Y ≥ 2 and g_X = g_Y the map is an isomorphism.

Procedure: Computing With a Divisor on a Curve

  1. Write the curve with an explicit model and locate the points that matter: the points at infinity, the Weierstrass points, the singular points of the plane model and their delta invariants.
  2. Compute g from the model: degree-genus with singularity corrections for plane curves, deg f for hyperelliptic curves, Hurwitz for covers.
  3. Write D explicitly as Σ n_P P and compute deg D.
  4. If deg D > 2g - 2, write l(D) = deg D + 1 - g and stop. Otherwise find l(K - D) by exhibiting differentials, or compute L(D) directly by finding functions with prescribed poles.
  5. For questions about maps, test base points (l(D - P)) and very ampleness (l(D - P - Q)) using Riemann-Roch on the smaller divisors.
  6. For a cover, list branch points and ramification indices and confirm the Hurwitz formula before using anything downstream.
  7. Verify l(D) in software: Sage's function field divisors, Singular's brnoeth.lib, or Macaulay2's HH^0 for a divisor given by a hyperplane section.

Worked Examples

Riemann-Roch on genus 2

C: y^2 = x^5 - 1, g = 2, one point ∞ at infinity, which is a Weierstrass point. K ~ 2∞ with L(K) = ⟨1, x⟩ (differentials dx/y and x dx/y). Then:

  • l(∞) = 1 (otherwise C ≅ P^1); l(K - ∞) = l(∞) = 1; Riemann-Roch checks: 1 - 1 = 1 + 1 - 2.
  • l(2∞) = 2 = ⟨1, x⟩, and 2∞ ~ K. l(3∞) = 3 + 1 - 2 + l(K - 3∞) = 2 + l(-∞) = 2, still ⟨1, x⟩: 3 is a gap at ∞. The function y has a pole of order 5, so the non-gaps are 0, 2, 4, 5, 6, ... and the gap sequence 1, 3 confirms ∞ is a Weierstrass point.
  • l(4∞) = 3 = ⟨1, x, x^2⟩; l(5∞) = 4 = ⟨1, x, x^2, y⟩; l(6∞) = 5 = ⟨1, x, x^2, x^3, y⟩.
  • deg 5∞ = 2g + 1, so |5∞| embeds C in P^3 as a curve of degree 5, and |6∞| embeds it in P^4 as a curve of degree 6.

The group law in Sage

sage: E = EllipticCurve(QQ, [-1, 0])        # y^2 = x^3 - x
sage: P = E(0, 0); Q = E(1, 0)
sage: P + Q
(-1 : 0 : 1)
sage: P.order(), E.torsion_subgroup().invariants(), E.rank()
(2, (2, 2), 0)
sage: E.change_ring(GF(7)).order()           # number of F_7-points including the point at infinity
8

The three 2-torsion points (0,0), (1,0), (-1,0) are collinear on y = 0, so any two sum to the third, and rank 0 says 1 is not a congruent number.

Riemann-Roch spaces from the function field

sage: K.<x> = FunctionField(GF(7)); R.<Y> = K[]
sage: F.<y> = K.extension(Y^2 - x^3 + x)
sage: F.genus()
1
sage: len(F.places(1))                       # degree-one places = F_7-points, matches the count above
8
sage: O = F.places_infinite()[0]             # the single place over x = infinity, degree 1
sage: D = 3*O.divisor()
sage: D.dimension()                          # l(3O) = 3 for g = 1
3
sage: D.basis_function_space()               # spans 1, x, y up to ordering and scalars

Cohomology of a curve in Macaulay2

S = QQ[x,y,z];
C = Proj(S/ideal(y^2*z - x^3 + x*z^2));      -- the same curve over QQ, as a plane cubic
genus C                                       -- 1
HH^0(OO_C(1)), HH^1(OO_C(1))                 -- QQ^3, 0: O(1) restricted to C is O(3O)
HH^0(OO_C(2))                                 -- QQ^6: l(6O) = 6, so six of the seven monomials survive

Checklist

  • Curve smooth and projective, or the normalization taken and delta invariants recorded.
  • g computed by two independent methods when possible (degree-genus and Hurwitz, or Hurwitz and the model).
  • D written explicitly, degree computed, and deg D compared with 2g - 2 and 2g + 1 before anything else.
  • l(K - D) computed, not assumed zero, whenever deg D ≤ 2g - 2.
  • Characteristic checked: 2 and 3 for Weierstrass form, divisors of ramification indices for Hurwitz.
  • One numerical check in Sage, Singular or Macaulay2.

Common Mistakes

  • Using l(D) = deg D + 1 - g for a special divisor. It undercounts by l(K - D).
  • Confusing dim |D| = l(D) - 1 with l(D), which shifts every embedding dimension by one.
  • Treating the plane closure of y^2 = f(x) with deg f ≥ 4 as the curve; it is singular at infinity, and its arithmetic genus is wrong.
  • Applying Hurwitz to an inseparable or wildly ramified map without the different.
  • Forgetting the point at infinity when counting points or writing divisors on a plane model.
  • Taking O to be an arbitrary point for the Weierstrass form; the form requires O to be the flex at infinity, otherwise the addition formulas fail.
  • Believing every genus 3 curve is a plane quartic; the hyperelliptic ones are not.

Limits

This skill is about smooth projective curves over an algebraically closed field, with remarks on Q and finite fields. Curves over non-closed fields carry Galois actions and the Brauer obstruction, and Riemann-Roch spaces there are defined over the ground field but points may not be. Singular curves, families of curves (moduli), and curves in positive characteristic with wild ramification each add layers that this page only names. Software handles explicit models well: Sage's function field and elliptic curve code, Singular's brnoeth.lib for Riemann-Roch bases, and Macaulay2 for cohomology of projective models; none of them handles an abstract curve given only by its genus, so always begin with an equation.

Install this skill directly: skilldb add algebraic-geometry-skills

Get CLI access →

Related Skills

Algebraic Geometry Problem Solving

Activate this skill when the user has an algebraic geometry problem to attack rather than a definition to look up: a qualifying exam question, a lemma a paper needs, a conjecture to test, a proof a referee has questioned. Triggers on "how do I prove," "dimension count," "incidence correspondence," "general member," "generic," "Bertini," "semicontinuity," "local coordinates," "affine chart," "compute an example," "Gröbner check," "reduce mod p," "specialization," "degeneration," "standard tricks," "write the proof," "referee," "algebraic geometry exercise," or "algebraic geometry" problem solving. Covers the order of attack, dimension counting done rigorously, local coordinates and charts, choosing the right cohomological tool, what a computation proves and what it does not, how to write an argument that survives refereeing, and a catalogue of the tricks working geometers reach for first.

Algebraic Geometry157L

Commutative Algebra Toolkit

Activate this skill when the user needs the commutative algebra that algebraic geometry actually runs on, with every theorem tied to its geometric meaning. Triggers on "Noetherian ring," "localization," "local ring," "integral extension," "integral closure," "normalization," "Noether normalization," "Krull dimension," "primary decomposition," "associated primes," "embedded component," "regular local ring," "Cohen-Macaulay," "Hilbert polynomial," "Hilbert series," "depth," or requests to translate between ring theory and geometry. Covers the theorems, what each one says about a variety, and how to compute each invariant in Macaulay2, Singular and SageMath.

Algebraic Geometry186L

Gröbner Bases and Computation

Activate this skill when the user wants to compute with polynomial ideals: test membership, eliminate variables, solve polynomial systems, implicitize a parametrization, or understand why a computation will not finish. Triggers on "Gröbner basis," "Groebner basis," "monomial order," "lex order," "grevlex," "Buchberger algorithm," "S-polynomial," "division algorithm," "elimination ideal," "implicitization," "solving polynomial systems," "zero-dimensional ideal," "Macaulay2," "Singular," "SageMath," or computational "algebraic geometry." Covers the theory precisely, real sessions in Macaulay2, Singular and Sage with actual syntax, and the complexity facts that decide which computations are feasible.

Algebraic Geometry179L

Intersection Theory Basics

Activate this skill when the user needs to count intersections of subvarieties with the correct multiplicities, work with divisors and intersection numbers on surfaces, or reason about blow-ups and exceptional curves. Triggers on "Bézout's theorem," "Bezout," "intersection multiplicity," "intersection number," "Chow group," "Chow ring," "self-intersection," "(-1)-curve," "exceptional divisor," "blow-up," "adjunction formula," "Hodge index," "Riemann-Roch for surfaces," "27 lines," "cubic surface," or intersection-theoretic "algebraic geometry." Covers the local definition of multiplicity, Bézout in the plane and in P^n, the Chow ring of projective space and of products, the intersection pairing on surfaces with blow-ups and adjunction, and worked surface examples checked in Singular, Macaulay2 and Sage.

Algebraic Geometry160L

Schemes and Morphisms

Activate this skill when the user is learning or using the language of schemes: Spec and Proj, structure sheaves, generic points, nilpotents, fibre products, and the properties of morphisms that carry the geometry. Triggers on "scheme," "Spec," "Proj," "structure sheaf," "generic point," "nilpotent," "fibre product," "closed immersion," "open immersion," "separated," "proper morphism," "finite type," "finite morphism," "flat family," "flat limit," "valuative criterion," or "why schemes" in algebraic geometry. Covers the definitions with their reasons, the standard morphism properties and how to check them, flatness as continuity of fibres, and concrete computations of fibres and flat limits in Macaulay2 and Sage.

Algebraic Geometry153L

Sheaves and Cohomology

Activate this skill when the user needs to work with sheaves on varieties and schemes and to compute or use sheaf cohomology. Triggers on "sheaf," "quasi-coherent," "coherent sheaf," "line bundle," "invertible sheaf," "divisor," "Picard group," "Cech cohomology," "Čech cohomology," "sheaf cohomology," "H^1," "Serre duality," "canonical bundle," "vanishing theorem," "Kodaira vanishing," "Serre vanishing," "Castelnuovo-Mumford regularity," "long exact sequence," "ideal sheaf sequence," "Euler characteristic," "Hilbert polynomial," or cohomological "algebraic geometry." Covers the definitions, the divisor-line bundle dictionary, Čech computations done by hand on projective space, the statement and use of Serre duality, the vanishing theorems that actually get used, Euler characteristic bookkeeping, and how to check every number in Macaulay2, Singular or SageMath.

Algebraic Geometry168L