Equations are shapes
Draw the line through the point of the unit circle with slope . Substituting gives a quadratic equation in with the known root , so the other root is forced to be rational in :
Every rational slope gives a rational point and every rational point other than comes from a rational slope: for instance gives and, clearing denominators, the Pythagorean triple . Diophantus used a version of this trick in the third century. It rests on a geometric fact — a line meets a conic in two points — which is false as stated (a line can miss a circle, or touch it) and becomes exactly true only after three repairs: allow complex points, add points at infinity, and count tangency twice. The result is Bézout's theorem: two plane curves of degrees and without common component meet in exactly points.
Algebraic geometry studies the sets of solutions of systems of polynomial equations — varieties — and the polynomial maps between them. Its central idea is a dictionary: a variety is controlled by its ring of polynomial functions , points correspond to maximal ideals, subvarieties to prime ideals, and maps to ring homomorphisms in the opposite direction. Grothendieck turned the dictionary into a definition: every commutative ring is a space, , and gluing such spaces gives schemes. The same language then describes curves over , curves over finite fields and the integers themselves.
This lesson assumes commutative algebra (prime ideals, localisation, Noetherian rings and the Nullstellensatz) and point-set topology. Throughout, is an algebraically closed field (such as ) unless said otherwise, and is affine -space.
The dictionary
| geometry | algebra |
|---|---|
| affine algebraic set | radical ideal |
| irreducible (an affine variety) | prime ideal |
| point | maximal ideal |
| polynomial functions on | coordinate ring |
| polynomial map | -algebra homomorphism |
| dimension of | Krull dimension of |
| , | , |
Three warnings shape everything that follows.
- The topology is coarse. Closed sets are zero sets of polynomials, so in the line they are just the finite sets and the whole line. Two non-empty open sets always meet.
- Points are not enough. The cusp and the line are in bijection by a polynomial map, but they are not isomorphic: the rings of functions differ. The ideals and have the same zero set, but remembers a "double point". Rings, not point sets, carry the structure.
- Affine space is incomplete. Parallel lines do not meet, and a line may miss a circle. Projective space adds the missing points at infinity; complex numbers add the missing complex points.
Definitions
Definition— algebraic sets and their ideals
For the affine algebraic set of is . For its ideal is , always a radical ideal. , and by Hilbert's basis theorem every algebraic set is cut out by finitely many polynomials.
Definition— Zariski topology; irreducibility; variety
The Zariski topology on has the algebraic sets as its closed sets; a subset of gets the subspace topology. A non-empty topological space is irreducible if it is not the union of two proper closed subsets; equivalently, any two non-empty open subsets meet. An affine variety is an irreducible affine algebraic set. (Some authors, e.g. in scheme theory, allow reducible "varieties"; we follow Hartshorne.)
Definition— coordinate ring, regular functions, morphisms
The coordinate ring of an algebraic set is , the ring of polynomial functions on ; it is a finitely generated, reduced (no non-zero nilpotents) -algebra, and a domain exactly when is a variety. A morphism of algebraic sets , is a map with and . It induces the comorphism , . An isomorphism is a morphism with a morphism inverse.
Definition— function field and dimension
For a variety the function field is the fraction field of ; its elements are rational functions, defined on a dense open subset. Varieties with isomorphic function fields are birational. The dimension of is the supremum of lengths of chains of irreducible closed subsets; it equals the Krull dimension of and the transcendence degree of over . Curves have dimension , surfaces .
Definition— projective space and projective algebraic sets
Projective -space is the set of lines through the origin in : points are written , not all , with for . A polynomial does not have values on , but if is homogeneous the condition is well defined. Projective algebraic sets are common zero sets of homogeneous polynomials (equivalently of a homogeneous ideal), and they are the closed sets of the Zariski topology on . The standard charts , , cover . The projective closure of an affine algebraic set is its closure in , obtained by homogenising the equations.
Definition— plane curves and intersection multiplicity
A projective plane curve of degree is a non-zero homogeneous of degree , up to scalar multiples (it may have repeated factors, which count as multiple components). For curves and a point in the chart , with their dehomogenisations, the intersection multiplicity is
where is the local ring of the plane at (rational functions defined at ); points in other charts are treated in the same way. is finite exactly when and have no common component through , is when is not on both curves, is exactly when is a smooth point of both curves with different tangent lines, and for a line equals the order of vanishing at of restricted to (Fulton, Algebraic Curves, §3.3).
Definition— presheaves and sheaves
A presheaf of rings on a space assigns a ring to each open and restriction maps , , for , compatibly with composition. It is a sheaf if sections are determined locally and compatible local sections glue: for every open cover , the sequence
is exact (an equaliser). On a variety, the structure sheaf assigns to the ring of regular functions on : functions that are locally quotients of polynomials with .
Definition— Spec R, the structure sheaf, schemes
For a commutative ring , is the set of prime ideals with the Zariski topology (closed sets ), with basic open sets . Its structure sheaf is the unique sheaf of rings with and restriction maps the localisation maps; its stalk at is the local ring . The pair is an affine scheme. A scheme is a space with a sheaf of rings (a locally ringed space) that is locally isomorphic to affine schemes; morphisms of schemes are morphisms of locally ringed spaces.
Examples and non-examples
Example— The affine line and the cofinite topology
A non-zero polynomial in one variable has finitely many roots, so the algebraic subsets of are itself and the finite sets: the Zariski topology on is the cofinite topology. It is (points are closed) but not Hausdorff, because is infinite and any two cofinite sets meet. In the closed sets are finite unions of points and curves, and the Zariski topology on is not the product topology: the diagonal is closed in but not in the product of two cofinite topologies.
Example— A parabola is a line; a hyperbola is not
The parabola is isomorphic to : the morphisms and are mutually inverse, and correspondingly .
The hyperbola is not: , in which is a non-constant unit, whereas the units of are the non-zero constants. An isomorphism would give a ring isomorphism , preserving units. (Projection does identify with the open subset — so an open subset of an affine variety can itself be affine.) Note that and are homeomorphic in their Zariski topologies — both carry the cofinite topology on a set of cardinality , so any bijection is a homeomorphism: topology alone cannot tell them apart.
Example— The cusp: a bijection that is not an isomorphism
Let . The morphism , , is bijective: its inverse is for and . But this inverse is not a polynomial map, and no inverse morphism exists: the comorphism sends , with image , which does not contain (formalised below). So is not an isomorphism, and neither is . Geometrically, has a singular point at the origin (both partial derivatives of vanish there), while is smooth. Algebraically, is not integrally closed, and is its normalisation.
Example— Reducible sets and non-radical ideals
is the union of the two axes ; its ideal is radical but not prime. The ideals , and all have this zero set, and the Nullstellensatz gives . Likewise in : the varieties cannot see the difference between and , but schemes can — is a point with a tangent direction attached.
Example— Points at infinity
Homogenising with a new variable embeds as the chart of ; the complement is the line at infinity .
- The parallel lines and become and , which meet at : parallel lines meet at infinity, at the point determined by their common direction.
- The hyperbola becomes and meets the line at infinity at and — the directions of its asymptotes.
- The parabola becomes and meets only at , where gives a double root: the parabola is tangent to the line at infinity.
- Every circle passes through the two circular points . So two circles, which meet in at most affine points, have their remaining intersections there.
Over , ellipse, parabola and hyperbola are projectively equivalent, distinguished only by how they meet the line at infinity: in no real point, in one double point, or in two real points.
Example— Spec of the integers
The points of are — one closed point for each prime — together with the generic point , whose closure is the whole space. The function has the "value" in at the point , and vanishes exactly at the primes dividing . looks like a curve: it has dimension , its non-empty open sets are cofinite and contain the generic point, and the rings of integers of number fields give "curves" lying over it.
The main theorems
Theorem— Proposition 1 (the Zariski topology)
For subsets and ideals of (any field ): , , , and . Hence the algebraic sets are the closed sets of a topology. Moreover and reverse inclusions, with equality exactly when is algebraic, and is the Zariski closure.
Proof
The first three identities are immediate from the definition. Since , we have , and similarly for . Conversely, let and suppose : choose with . For every , , so and hence ; thus . So . If then , so ; and is the smallest algebraic set containing , since any algebraic has .
∎
Theorem— Proposition 2 (irreducible sets are prime ideals; components)
An algebraic set is irreducible if and only if is a prime ideal. Every algebraic set is a finite union of irreducible algebraic sets, uniquely if no contains another (the irreducible components).
Proof
Suppose is irreducible and . Then is a union of two closed subsets, so one of them, say , is all of ; that is, . And because . Conversely, if is prime and with closed and proper, then (Proposition 1: ), so we may pick ; but vanishes on , contradicting primality.
For the decomposition: if some algebraic set had no such decomposition, by Hilbert's basis theorem (ascending chains of ideals stabilise, so descending chains of algebraic sets stabilise) there would be a minimal such . It is not irreducible, so with proper closed , each of which decomposes by minimality — contradiction. For uniqueness, let be irredundant decompositions. Since is irreducible, for some ; symmetrically for some , and then forces , so . The same argument applies to every and every , so the two decompositions have the same members.
∎
Theorem— Theorem 3 (the Nullstellensatz dictionary)
Let be algebraically closed. For every ideal , . Hence and are mutually inverse, inclusion-reversing bijections
Proof
The equation is Hilbert's Nullstellensatz, proved in the lesson on commutative algebra (in full for uncountable such as , via Rabinowitsch's trick). It shows is the identity on radical ideals, and Proposition 1 shows is the identity on algebraic sets. Prime ideals correspond to irreducible sets by Proposition 2, and maximal ideals — minimal non-empty algebraic sets — to points.
∎
Algebraic closure is essential: over , , although is a prime ideal.
Theorem— Proposition 4 (the Zariski topology is not Hausdorff)
In an irreducible space, every non-empty open set is dense, and any two non-empty open sets meet. Consequently an affine variety with more than one point — for instance for — is not Hausdorff.
Proof
If are non-empty open and , then is a union of two proper closed subsets, so is reducible. In a Hausdorff space with two distinct points there are disjoint open neighbourhoods of and , which is impossible here. Finally is irreducible because (a polynomial vanishing on all of , for infinite , is zero, by induction on ) is prime.
∎
For the proof is concrete: basic open sets and with always meet, because has finitely many roots and is infinite — this is the statement formalised below. The same is true of , where it is even worse: the generic point lies in every non-empty open set, so is not even .
Theorem— Theorem 5 (affine varieties are the opposite of algebras)
Let and be affine algebraic sets over an algebraically closed field .
- is a bijection from morphisms to -algebra homomorphisms , compatible with composition: .
- Every finitely generated reduced -algebra is isomorphic to for some .
Hence is an equivalence between the category of affine algebraic sets and the opposite of the category of finitely generated reduced -algebras; under it, affine varieties correspond to finitely generated -algebras that are domains.
Proof
(1) Write for the coordinate functions on , which generate . Given a homomorphism , set . For and , , because is a -algebra map and so commutes with polynomial expressions; hence by Proposition 1. So is a morphism, and , so since both are algebra maps agreeing on generators. Conversely a morphism is determined by its coordinates . Compatibility with composition is .
(2) A finitely generated -algebra is for some ideal ; it is reduced exactly when is radical. Then has by the Nullstellensatz, so . A functor that is fully faithful (by (1)) and essentially surjective (by (2)) is an equivalence; domains correspond to prime , i.e. to varieties by Proposition 2.
∎
So isomorphism of varieties is isomorphism of coordinate rings — which is how the parabola, hyperbola and cusp examples were decided. A point is the same as a homomorphism (evaluation at ), which is a first glimpse of the functor of points: .
Theorem— Proposition 6 (projective space over a finite field)
is covered by the charts , and (the chart and the hyperplane at infinity ). Over the finite field ,
Proof
The chart maps are inverse to ( in position ), and every point has some non-zero coordinate. Points with are , a copy of ; points with are , a copy of . Over the non-zero vectors of , of them, fall into lines of non-zero vectors each; alternatively induct with .
∎
Theorem— Theorem 7 (Bézout for a line)
Let be algebraically closed, a line and a curve of degree not containing . Then meets in exactly points counted with multiplicity: .
Proof
Choose two distinct points spanning and parametrise by , a bijection . Then is a homogeneous polynomial of degree in (each monomial of has degree ). It is not identically zero, since . Over an algebraically closed field a non-zero binary form of degree factors as a product of linear forms: — dehomogenise at to get a polynomial of degree in (where ), which splits into linear factors, and the missing roots are at . The zeros of are the parameters of the points of , and the multiplicity of the root is the order of vanishing of along at that point, which is . Summing the multiplicities gives .
∎
For example, a line meets a smooth cubic in points; if two are rational, so is the third — which is the source of the group law on an elliptic curve (see arithmetic geometry).
Theorem— Theorem 8 (Bézout for a smooth conic)
Let be a smooth conic and a curve of degree not containing . Then . In particular two conics without common component meet in points counted with multiplicity.
Proof
Over an algebraically closed field of characteristic , a smooth conic is a non-degenerate quadratic form in three variables, and after a linear change of coordinates it becomes (diagonalise the form to , then substitute). The map , , is a bijection onto : a point of with is , and the only point with is . Now is a binary form of degree , non-zero because , so it has roots counted with multiplicity, as in Theorem 7. The multiplicity of a root equals because restricts, near each point, to an isomorphism of a neighbourhood in with a neighbourhood in the smooth curve , and the local ring of at is a discrete valuation ring in which is the order of vanishing of (Fulton, §3.3).
∎
The same argument works for any curve with a parametrisation by forms of degree that is an isomorphism onto a smooth curve: it meets in points. The general case needs a different tool.
Theorem— Theorem 9 (Bézout's theorem; proof sketched)
Let be algebraically closed and curves of degrees and with no common component. Then
In particular and meet in at least one and at most points.
Proof sketch. Change coordinates so that lies on neither curve and on no line joining two of the (finitely many) intersection points. Write and as polynomials in with coefficients in ; their leading coefficients are non-zero constants. The resultant , the determinant of the Sylvester matrix, is a homogeneous polynomial of degree exactly in — this is a degree count in the determinant — and it vanishes at exactly when and have a common root , that is, when the line through and contains an intersection point. Since (no common component) it has roots in counted with multiplicity, one for each intersection point by the choice of coordinates; the remaining work is to show that the multiplicity of each root equals , using the axiomatic characterisation of . Complete proofs: Fulton, Algebraic Curves, Chapter 5; Kirwan, Complex Algebraic Curves, Chapter 3; Shafarevich, Basic Algebraic Geometry 1, §IV.2 (via intersection theory). The first experiment below carries out this resultant computation.
Each hypothesis is needed: over a line can miss a circle; in parallel lines do not meet; without multiplicities a tangent line meets a conic once; and curves with a common component share infinitely many points.
Theorem— Theorem 10 (the structure sheaf of Spec R)
Let be a commutative ring and with . Then the sequence
is exact: an element of that vanishes in every is , and elements that agree in every come from a unique . Consequently satisfies the sheaf condition on covers by basic open sets, extends to a sheaf on , and .
Proof
The generate the unit ideal, and so do their powers. If , it lies in a maximal ideal , which is then in no . For any , the also satisfy the hypothesis (), so for some .
Injectivity. If in each , then for all and some common . Writing gives .
Gluing. Write with a common . Agreement in means for some , which we may take independent of . Put and ; then in and for all . Write and set . Then
so in . Uniqueness is injectivity. Applying this to in place of handles covers of by smaller basic open sets; a sheaf on a basis extends uniquely to a sheaf (Hartshorne, II.1 and II.2.2).
∎
Theorem 10 is why Grothendieck's definition works: an affine scheme remembers its ring (), Theorem 5 becomes the equivalence of affine schemes with the opposite of all commutative rings, and gluing affine schemes along open subsets gives schemes such as , defined over every ring at once. A variety over is (the set of closed points of) a reduced, irreducible scheme of finite type over . Theorem 10 is stated here for the ring itself; the same proof for modules gives the quasi-coherent sheaves that underlie modern cohomology.
Explore: chords, conics and cubics
The chord trick. Move the slope of the line through . The line meets the circle in exactly one more point — Bézout's count . As the line becomes vertical and : the tangent line meets the circle twice at the same point. Rational gives rational points, which is the whole parametrisation of Pythagorean triples.
A line through a point of a conic meets it once more
Rational slope m ⇔ rational point P: the circle is isomorphic to the projective line.
- x² + y² = 1
- line through (−1, 0) with slope m
- (0.707, 0.707)
- (−1.125, −0.063)
Cubics and their singularities. The real points of are drawn as the two graphs . The curve is singular exactly when : try , , where and the curve has a node at (two branches crossing), and , the cusp . For other values the cubic is smooth — an elliptic curve — with one or two real components; over it is a torus, of genus .
The family y² = x³ + ax + b
Smooth unless 4a³ + 27b² = 0: try (a, b) = (−3, 2) for a node and (0, 0) for a cusp.
- y = +√(x³ + ax + b)
- y = −√(x³ + ax + b)
- y = +√(x³ + ax + b): y = 0
- y = −√(x³ + ax + b): y = 0
Algebraic geometry in Lean and Mathlib
Mathlib has both classical algebraic sets (MvPolynomial.zeroLocus, MvPolynomial.vanishingIdeal) and the full theory of schemes (AlgebraicGeometry.Scheme). We begin with Proposition 1, proved here exactly as in the text:
/-- **Finite unions of algebraic sets are algebraic**: `V(IJ) = V(I) ∪ V(J)`. Human proof: if
`x` lies in `V(I)` (or `V(J)`), every element of `IJ ⊆ I` (or `⊆ J`) vanishes at `x`.
Conversely, if `x` lies in neither, choose `f ∈ I` and `g ∈ J` with `f(x) ≠ 0 ≠ g(x)`; then
`fg ∈ IJ` and `(fg)(x) = f(x) g(x) ≠ 0` because `K` is a field. Together with
`V(∑ Iᵢ) = ⋂ V(Iᵢ)`, this makes the algebraic sets the closed sets of a topology. -/
theorem zeroLocus_mul {σ k K : Type*} [Field k] [Field K] [Algebra k K]
(I J : Ideal (MvPolynomial σ k)) :
MvPolynomial.zeroLocus K (I * J) = MvPolynomial.zeroLocus K I ∪ MvPolynomial.zeroLocus K J := by
ext x
simp only [Set.mem_union, MvPolynomial.mem_zeroLocus_iff]
constructor
· intro hx
by_contra h
simp only [not_or, not_forall] at h
obtain ⟨⟨f, hfI, hf⟩, ⟨g, hgJ, hg⟩⟩ := h
have hmem : f * g ∈ I * J := Ideal.mul_mem_mul hfI hgJ
have hfg : MvPolynomial.aeval x (f * g) = 0 := hx (f * g) hmem
rw [map_mul] at hfg
exact mul_ne_zero hf hg hfg
· rintro (hx | hx) p hp
· have hpI : p ∈ I := Ideal.mul_le_left (I := I) (J := J) hp
exact hx p hpI
· have hpJ : p ∈ J := Ideal.mul_le_right (I := I) (J := J) hp
exact hx p hpJProposition 4 for the affine line, and for (which is not even , by Mathlib's characterisation of spectra of domains):
/-- **The Zariski topology on the affine line is not Hausdorff.** Over an infinite field `k`,
the non-empty open sets of `𝔸¹` are complements of finite sets, and any two of them meet: for
non-zero polynomials `f, g` there is a point `a` with `f(a) ≠ 0` and `g(a) ≠ 0`. Proof: `fg ≠ 0`
has only finitely many roots, and `k` is infinite, so some `a` is not a root of `fg`. So two
distinct points never have disjoint neighbourhoods. -/
theorem basic_opens_meet {k : Type*} [Field k] [Infinite k] {f g : k[X]} (hf : f ≠ 0)
(hg : g ≠ 0) : ∃ a : k, f.eval a ≠ 0 ∧ g.eval a ≠ 0 := by
classical
obtain ⟨a, ha⟩ := Infinite.exists_notMem_finset (f * g).roots.toFinset
refine ⟨a, ?_⟩
have hfg : (f * g).eval a ≠ 0 := by
intro h0
apply ha
rw [Multiset.mem_toFinset, mem_roots (mul_ne_zero hf hg)]
exact h0
rw [eval_mul] at hfg
exact ⟨left_ne_zero_of_mul hfg, right_ne_zero_of_mul hfg⟩/-- **`Spec ℤ` is not Hausdorff** — it is not even T₁. Mathlib's
`PrimeSpectrum.t1Space_iff_isField` says that the spectrum of a domain is T₁ exactly when the
domain is a field (the generic point `(0)` is closed only in a field), and `ℤ` is not a field
(`Int.not_isField`). Every Hausdorff space is T₁, so `Spec ℤ` is not Hausdorff. -/
theorem spec_int_not_t2 : ¬ T2Space (PrimeSpectrum ℤ) := by
intro h
have h1 : T1Space (PrimeSpectrum ℤ) := inferInstance
rw [PrimeSpectrum.t1Space_iff_isField] at h1
exact Int.not_isField h1The dictionary — Proposition 2 for spectra, and the Nullstellensatz for prime ideals — from Mathlib:
/-- **Irreducible closed sets correspond to prime ideals.** In `Spec R`, a set `s` is irreducible
exactly when its vanishing ideal is prime. Mathlib:
`PrimeSpectrum.isIrreducible_iff_vanishingIdeal_isPrime`. For `R = k[x₁, …, xₙ]` with `k`
algebraically closed, this is the statement "affine varieties ↔ prime ideals". -/
theorem prime_ideal_of_irreducible {R : Type*} [CommRing R] (s : Set (PrimeSpectrum R)) :
IsIrreducible s ↔ (PrimeSpectrum.vanishingIdeal s).IsPrime :=
PrimeSpectrum.isIrreducible_iff_vanishingIdeal_isPrime/-- **Prime ideals are recovered from their varieties.** Over an algebraically closed field `K`,
a prime ideal `P` of `k[x₁, …, xₙ]` is the ideal of all polynomials vanishing on `V(P)`:
`I(V(P)) = P`. This is the Nullstellensatz for prime (hence radical) ideals. Mathlib:
`MvPolynomial.IsPrime.vanishingIdeal_zeroLocus`. -/
theorem vanishing_of_prime {K : Type*} [Field K] [IsAlgClosed K] {n : ℕ}
(P : Ideal (MvPolynomial (Fin n) K)) [P.IsPrime] :
MvPolynomial.vanishingIdeal K (MvPolynomial.zeroLocus K P) = P :=
MvPolynomial.IsPrime.vanishingIdeal_zeroLocus PThe cusp example, both halves: the parametrisation is injective, but . The second proof exhibits the subalgebra of polynomials with no linear term:
/-- **The cusp is in bijection with the line.** The morphism `𝔸¹ → C`, `t ↦ (t², t³)`, onto the
cusp `C : y² = x³` is injective: if `s² = t²` and `s³ = t³` then `s = t`. Proof: if `s = 0` then
`t² = 0`, so `t = 0`. Otherwise `t ≠ 0` too, and `s = s³/s² = t³/t² = t`. (It is also surjective
onto `C` over any field, with inverse `(x, y) ↦ y/x` away from the origin.) -/
theorem cusp_param_injective {k : Type*} [Field k] {s t : k} (h2 : s ^ 2 = t ^ 2)
(h3 : s ^ 3 = t ^ 3) : s = t := by
by_cases hs : s = 0
· subst hs
have ht : t ^ 2 = 0 := by rw [← h2]; ring
exact (pow_eq_zero_iff two_ne_zero |>.mp ht).symm
· have hs2 : s ^ 2 ≠ 0 := pow_ne_zero 2 hs
have ht2 : t ^ 2 ≠ 0 := h2 ▸ hs2
calc s = s ^ 3 / s ^ 2 := by field_simp
_ = t ^ 3 / t ^ 2 := by rw [h2, h3]
_ = t := by field_simp/-- **…but the cusp is not isomorphic to the line.** The coordinate ring of the cusp is the
subalgebra `k[t², t³] ⊆ k[t]`, and `t` does not lie in it. Proof: the polynomials whose
coefficient of `t` vanishes form a subalgebra (the `t`-coefficient of a product `pq` is
`p₀q₁ + p₁q₀`), which contains `t²` and `t³` but not `t`. So the bijective morphism
`t ↦ (t², t³)` is not an isomorphism: its comorphism `k[t², t³] → k[t]` is not surjective. -/
theorem cusp_not_normal (k : Type*) [Field k] :
(X : k[X]) ∉ Algebra.adjoin k ({X ^ 2, X ^ 3} : Set k[X]) := by
-- the subalgebra of polynomials with no linear term
let S : Subalgebra k k[X] :=
{ carrier := {p | p.coeff 1 = 0}
mul_mem' := by
intro p q hp hq
simp only [Set.mem_ofPred_eq] at hp hq ⊢
rw [coeff_mul, Finset.Nat.antidiagonal_succ]
simp [hp, hq]
add_mem' := by
intro p q hp hq
simp only [Set.mem_ofPred_eq, coeff_add] at hp hq ⊢
rw [hp, hq, add_zero]
algebraMap_mem' := by
intro c
simp }
have hle : Algebra.adjoin k ({X ^ 2, X ^ 3} : Set k[X]) ≤ S := by
rw [Algebra.adjoin_le_iff]
intro p hp
rcases hp with rfl | rfl
· show (X ^ 2 : k[X]).coeff 1 = 0
simp [coeff_X_pow]
· show (X ^ 3 : k[X]).coeff 1 = 0
simp [coeff_X_pow]
intro hX
have h1 : (X : k[X]).coeff 1 = 0 := hle hX
simp at h1Proposition 6 for , from Mathlib's count of points of projective spaces, and the one-variable fact behind Theorem 7:
/-- **Counting points of the projective plane over a finite field.** `ℙ²(𝔽_q)` — lines through
the origin in `𝔽_q³` — has `q² + q + 1` points: the `q² ` points of the affine plane plus the
`q + 1` points of the line at infinity. Derived from Mathlib's `Projectivization.card_of_finrank`
(`|ℙ(V)| = 1 + q + ⋯ + q^(n-1)` when `dim V = n`). -/
theorem projective_plane_card (k : Type*) [Field k] [Fintype k] :
Nat.card (ℙ k (Fin 3 → k)) = Fintype.card k ^ 2 + Fintype.card k + 1 := by
rw [Projectivization.card_of_finrank k (Fin 3 → k) (n := 3) (by simp)]
simp [Finset.sum_range_succ, Nat.card_eq_fintype_card]
ring/-- **The one-variable case of Bézout.** Over an algebraically closed field a polynomial of
degree `d` has exactly `d` roots counted with multiplicity. Restricting a plane curve of degree
`d` to a line gives such a polynomial (or a binary form of degree `d`, in homogeneous
coordinates), which is why a line meets a curve of degree `d` in exactly `d` points of `ℙ²`.
Mathlib: `IsAlgClosed.card_roots_eq_natDegree`. -/
theorem roots_on_a_line {k : Type*} [Field k] [IsAlgClosed k] (p : k[X]) :
p.roots.card = p.natDegree :=
IsAlgClosed.card_roots_eq_natDegreeFinally, schemes. Mathlib proves Theorem 10 — the global sections of are , and sections over are — and the scheme form of Theorem 5:
/-- **The global sections of `Spec R` are `R`.** The structure sheaf of the affine scheme
`Spec R` has `R` itself as its ring of global sections — the key theorem of affine schemes
(Hartshorne, Proposition II.2.2). Mathlib: `AlgebraicGeometry.Scheme.ΓSpecIso`. -/
noncomputable def global_sections_spec (R : CommRingCat) : Γ(Spec R, ⊤) ≅ R :=
Scheme.ΓSpecIso R/-- **Sections over a basic open set are a localisation.** On an affine scheme `X`, the ring of
sections over `D(f) = {f ≠ 0}` is the localisation `Γ(X)_f = Γ(X)[1/f]`: "functions on the open
set where `f` does not vanish may have powers of `f` in the denominator". Mathlib:
`AlgebraicGeometry.isLocalization_away_of_isAffine`. -/
theorem sections_basic_open (X : Scheme) [IsAffine X] (f : Γ(X, ⊤)) :
IsLocalization.Away f Γ(X, X.basicOpen f) :=
inferInstance/-- **Affine schemes are the opposite of commutative rings.** `Spec` and global sections `Γ` are
inverse equivalences `AffineScheme ≌ CommRingᵒᵖ`: morphisms of affine schemes `Spec S → Spec R`
are exactly ring homomorphisms `R → S`. This is the scheme version of "affine varieties are the
opposite of reduced finitely generated `k`-algebras". Mathlib:
`AlgebraicGeometry.AffineScheme.equivCommRingCat`. -/
noncomputable def affine_schemes_equiv_rings : AffineScheme ≌ CommRingCatᵒᵖ :=
AffineScheme.equivCommRingCatWhat is and is not formalised. Proved here: Proposition 1's union formula, Proposition 4 for over an infinite field and for , both halves of the cusp example, and . From Mathlib: irreducible closed sets ↔ primes, the Nullstellensatz, root counting over algebraically closed fields, , sections over basic opens, and affine schemes ≃ rings. Not formalised: Bézout's theorem (Mathlib has neither intersection multiplicities of plane curves nor the theorem; Theorems 7–9 are not formalised beyond the root count), Theorem 5 for classical varieties (Mathlib works with schemes instead), and the gluing argument of Theorem 10 in our own words (Mathlib's proof is AlgebraicGeometry.StructureSheaf).
Intersections and points, computed
The first experiment computes for ten pairs of curves after a generic change of coordinates, factors it over , and reads off the intersection points and their multiplicities. Points at infinity (the circular points), complex points and tangencies appear exactly as needed to make the total — this is the proof sketch of Theorem 9 run on examples.
"""Bezout's theorem by resultants: counting intersections of plane curves.
Two projective plane curves F = 0 and G = 0 of degrees d and e, with no common
component, meet in exactly d*e points of the complex projective plane,
counted with multiplicity. To see the count, we change coordinates so that
the point [0:0:1] lies on neither curve and eliminate z: the resultant
Res_z(F, G) is a binary form of degree d*e in x and y, and its roots are the
directions from [0:0:1] to the intersection points. Each irreducible factor of
degree m over Q stands for m conjugate points; its exponent is their
intersection multiplicity (tangency, points at infinity and complex points
all appear). We use two different coordinate changes and check that the
pattern of factors agrees - a consistency check of genericity. Exact symbolic
computation with SymPy; evidence for these examples, not a proof of Bezout.
"""
import sympy
X, Y, Z = sympy.symbols("x y z")
#: Two invertible linear changes of coordinates (old variables in terms of new).
CHANGES = (
{X: X + 2 * Z, Y: X + Y + 5 * Z, Z: X - Y + 3 * Z},
{X: 2 * X + Y + Z, Y: Y - 5 * Z, Z: X + 3 * Y + Z},
)
CIRCLE = X**2 + Y**2 - Z**2
#: (description, F, G): homogeneous polynomials in x, y, z.
EXAMPLES = [
("circle, line y = 0 (2 real points)", CIRCLE, Y),
("circle, tangent line y = 1", CIRCLE, Y - Z),
("circle, line x = 2 (2 complex points)", CIRCLE, X - 2 * Z),
("concentric circles (circular points)", CIRCLE, X**2 + Y**2 - 4 * Z**2),
("circles x^2+y^2=1, x^2+y^2=2x", CIRCLE, X**2 - 2 * X * Z + Y**2),
("parabola y = x^2, line at infinity", Y * Z - X**2, Z),
("cusp y^2 = x^3, its tangent y = 0", Y**2 * Z - X**3, Y),
("cusp y^2 = x^3, line x = 0", Y**2 * Z - X**3, X),
("node y^2 = x^2(x+1), line y = 2x", Y**2 * Z - X**2 * (X + Z), Y - 2 * X),
("elliptic y^2 = x^3-x, circle r = 2", Y**2 * Z - X**3 + X * Z**2,
X**2 + Y**2 - 4 * Z**2),
]
def degree(f):
"""Total degree of a homogeneous polynomial in x, y, z."""
return sympy.Poly(f, X, Y, Z).total_degree()
def change_coordinates(f, change):
"""Substitute the linear change of coordinates into f and expand."""
return sympy.expand(f.subs(change, simultaneous=True))
def is_generic(f, g):
"""True if [0:0:1] lies on neither curve (so Res_z has full degree)."""
point = {X: 0, Y: 0, Z: 1}
return f.subs(point) != 0 and g.subs(point) != 0
def intersection_pattern(f, g, change):
"""Sorted (number of points, multiplicity) pairs read off Res_z(f, g)."""
fc, gc = change_coordinates(f, change), change_coordinates(g, change)
if not is_generic(fc, gc):
raise ValueError("[0:0:1] lies on a curve: choose another change")
res = sympy.resultant(fc, gc, Z)
if res == 0:
raise ValueError("the curves have a common component")
_, factors = sympy.factor_list(res)
return sorted((sympy.Poly(h, X, Y).total_degree(), m) for h, m in factors)
def total(pattern):
"""Number of intersection points counted with multiplicity."""
return sum(points * mult for points, mult in pattern)
def describe(pattern):
"""Human-readable form, e.g. '2 pts x1' or '1 pt x2 + 1 pt x1'."""
parts = []
for points, mult in sorted(pattern, key=lambda pm: (-pm[1], pm[0])):
word = "pt" if points == 1 else "pts"
parts.append(f"{points} {word} x{mult}")
return " + ".join(parts)
def main():
print("Intersections in the complex projective plane (multiplicity xm)")
print(f"{'curves':<38} {'d*e':>3} points found")
agree = True
for name, f, g in EXAMPLES:
first, second = (intersection_pattern(f, g, c) for c in CHANGES)
agree = agree and first == second
de = degree(f) * degree(g)
print(f"{name:<38} {de:>3} {describe(first)} = {total(first)}")
print(f"Both coordinate changes give the same pattern: {agree}")
print("Points at infinity, complex points and tangency (multiplicity > 1)")
print("are exactly what is needed for the count to be d*e every time.")
print()
print("Epistemic status: exact symbolic computation (resultants and")
print("factorisation over Q in SymPy) for ten examples; the multiplicities")
print("are meaningful because the coordinate change is generic, which we")
print("check only by agreement of two changes. Evidence, not a proof of")
print("Bezout's theorem.")
if __name__ == "__main__":
main()The second experiment reduces curves modulo primes and counts their points over by brute force: has points (Proposition 6), the conic and the cusp each have (both are in bijection with ), and the elliptic curve has points with (Hasse's theorem), for , and for — a first glimpse of the arithmetic of curves.
"""Counting points of curves over the finite fields F_p.
A variety defined over the integers can be reduced modulo a prime p and its
points over F_p counted. We count, by brute force over all points of the
projective plane P^2(F_p):
* P^2(F_p) itself, which has p^2 + p + 1 points (proved in the lesson and in
Lean);
* the conic x^2 + y^2 = z^2, which is isomorphic to the projective line and
so has p + 1 points for odd p;
* the cuspidal cubic y^2 z = x^3, which is in bijection with P^1 (p + 1
points) although it is not isomorphic to it;
* the elliptic curve E: y^2 z = x^3 - x z^2, whose number of points
p + 1 - a_p satisfies Hasse's theorem |a_p| <= 2 sqrt(p), has a_p = 0
whenever p = 3 (mod 4) (E has complex multiplication by Z[i]), and for
p = 1 (mod 4) has a_p/2 equal to the odd number a in p = a^2 + b^2.
Exhaustive and exact for the primes listed; the general statements are
theorems (Hasse 1933; Deuring 1941), not consequences of this computation.
"""
import math
def primes_between(lo, hi):
"""Primes p with lo <= p < hi."""
return [p for p in range(max(lo, 2), hi)
if all(p % q for q in range(2, math.isqrt(p) + 1))]
def projective_points(p):
"""One representative of each point of P^2(F_p).
The representatives are (x, y, 1), (x, 1, 0) and (1, 0, 0).
"""
pts = [(x, y, 1) for x in range(p) for y in range(p)]
pts += [(x, 1, 0) for x in range(p)]
pts.append((1, 0, 0))
return pts
def count_points(form, p):
"""Number of points of P^2(F_p) where the homogeneous form vanishes."""
return sum(1 for x, y, z in projective_points(p)
if form(x, y, z) % p == 0)
def conic(x, y, z):
"""The circle x^2 + y^2 = z^2."""
return x * x + y * y - z * z
def cusp(x, y, z):
"""The cuspidal cubic y^2 z = x^3."""
return y * y * z - x ** 3
def elliptic(x, y, z):
"""The elliptic curve y^2 z = x^3 - x z^2."""
return y * y * z - x ** 3 + x * z * z
def trace_of_frobenius(p):
"""a_p = p + 1 - #E(F_p) for the elliptic curve y^2 = x^3 - x."""
return p + 1 - count_points(elliptic, p)
def is_sum_of_two_squares_with(a, p):
"""True if p - a^2 is a perfect square (so p = a^2 + b^2)."""
rest = p - a * a
return rest >= 0 and math.isqrt(rest) ** 2 == rest
def main():
primes = primes_between(3, 60)
plane_ok = all(len(projective_points(p)) == p * p + p + 1
for p in primes)
conic_ok = all(count_points(conic, p) == p + 1 for p in primes)
cusp_ok = all(count_points(cusp, p) == p + 1 for p in primes)
print(f"Primes 3 <= p < 60 ({len(primes)} primes):")
print(f" #P^2(F_p) = p^2 + p + 1: {plane_ok}")
print(f" #conic x^2 + y^2 = z^2 equals p + 1: {conic_ok}")
print(f" #cusp y^2 = x^3 equals p + 1: {cusp_ok}")
print("Elliptic curve E: y^2 = x^3 - x, a_p = p + 1 - #E(F_p):")
rows = [(p, trace_of_frobenius(p)) for p in primes]
for start in range(0, len(rows), 8):
chunk = rows[start:start + 8]
print(" " + " ".join(f"p={p}:{a:+d}" for p, a in chunk))
hasse = all(a * a <= 4 * p for p, a in rows)
supersingular = all(a == 0 for p, a in rows if p % 4 == 3)
gauss = all(a % 4 == 2 and is_sum_of_two_squares_with(a // 2, p)
for p, a in rows if p % 4 == 1)
print(f" Hasse bound |a_p| <= 2 sqrt(p): {hasse}")
print(f" a_p = 0 whenever p = 3 (mod 4): {supersingular}")
print(f" p = 1 (mod 4): p = (a_p/2)^2 + b^2: {gauss}")
print()
print("Epistemic status: exhaustive, exact counts for the primes listed.")
print("They illustrate theorems proved elsewhere (the conic is P^1;")
print("Hasse's bound; Deuring's theorem on supersingular primes) but")
print("prove nothing about other primes.")
if __name__ == "__main__":
main()Exercises
1. Algebraic geometry
Warm-upHumanWhich of these subsets of the complex line are closed in the Zariski topology? (Choose all that apply.)
2. Algebraic geometry
Warm-upHumanA smooth cubic curve and a conic in the complex projective plane have no common component. In how many points do they meet, counted with multiplicity?
3. Algebraic geometry
CoreHumanOver , let . Which ideal is ?
4. Algebraic geometry
CoreHumanWhich argument correctly proves that the hyperbola is not isomorphic to the affine line (over )?
5. Algebraic geometry
CoreHumanHow many points does the projective plane have?
6. Algebraic geometry
CoreHumanThe concentric circles and have no common point in . Bézout's theorem promises intersection points in . Where are they?
7. Algebraic geometry
StretchHumanThe morphism , , is a bijection. Which statement explains why it is not an isomorphism?
8. Algebraic geometry
CoreFormalWhich Lean statement formalises Proposition 1's identity "the zero set of a product of ideals is the union of the zero sets"? (zeroLocus K I is the set of points of where every polynomial in I vanishes.)
9. Algebraic geometry
StretchComputationalWrite projective_count(f, p) returning the number of points of at which the homogeneous polynomial f(x, y, z) (a Python function with integer values) vanishes modulo . Use one representative per point: , and .
Common misconceptions
Misconception
"The Zariski topology is like the usual topology, only coarser — surely it is Hausdorff." On any irreducible variety with more than one point it is not: any two non-empty open sets meet (Proposition 4). On the open sets are the cofinite sets. The Zariski topology is still useful — it records which sets are cut out by equations, and irreducibility, dimension and quasi-compactness are all topological notions in it — but limits, continuity arguments and "small neighbourhoods" from analysis do not transfer. Over one also has the classical topology, and comparing the two is the subject of Serre's GAGA.
Misconception
"A variety is just its set of points." Two varieties can be in bijection, even homeomorphic, without being isomorphic: the cusp and the line (bijective morphism, non-isomorphic coordinate rings), or the hyperbola and the line (homeomorphic cofinite spaces, but has non-constant units). The coordinate ring — more generally the structure sheaf — carries the structure. Schemes go further: and have one point each but are different, and the difference (a tangent vector) is exactly what makes tangency count twice in Bézout's theorem.
Misconception
"Two curves of degrees and meet in points — so a line and a circle always meet twice in the plane." Bézout's theorem needs all three repairs: an algebraically closed field (complex points), projective space (points at infinity) and multiplicities (tangency). Two concentric circles have no common point in ; their four intersections are the circular points at infinity, each counted twice.
Misconception
"Equations that cannot be factored define irreducible sets." For a single hypersurface over an algebraically closed field this is right up to repeated factors: is irreducible exactly when is a power of an irreducible polynomial. For several equations it fails: is two points, cut out by an irreducible conic and a line. Irreducibility is a property of the ideal — primality (Proposition 2) — not of the chosen generators.
Viewpoints
Geometry— Projective geometry and the shape of curves
Projective space makes intersection theory clean: Bézout's theorem, Pascal's theorem (the three intersection points of opposite sides of a hexagon inscribed in a conic are collinear — a consequence of the Cayley–Bacharach theorem on cubics through eight points), and the classification of conics (all smooth conics over are projectively equivalent to ). The degree of a projective variety of dimension is the number of points in which it meets a general linear subspace of dimension , generalising Theorem 7. For a smooth plane curve of degree , the genus (the degree–genus formula) counts holes in its complex points: lines and conics have genus , smooth cubics genus , smooth quartics genus . Klein's Erlangen programme applies too: projective geometry is the study of invariants of acting on (see projective geometry).
Topology— Complex points: Riemann surfaces and the comparison of topologies
Over , a smooth projective curve is also a compact Riemann surface in the classical topology, of genus : the algebraic genus (holomorphic differentials) equals the topological genus (holes), and . The plane cubic is a torus. Conversely, Riemann's existence theorem says that every compact Riemann surface is a projective algebraic curve, and Serre's GAGA theorem (1956) extends this to coherent sheaves on projective varieties: analytic and algebraic geometry of projective varieties over agree. The Zariski topology is far coarser, but its étale refinement (Grothendieck, Artin) recovers topological invariants algebraically: for a variety over , étale cohomology with coefficients equals singular cohomology (Artin's comparison theorem), and étale cohomology makes sense over any field (see Riemann surfaces and algebraic topology).
Number theory— Rational points and curves over finite fields
The same equations can be solved in , in or in . Over the geometry controls the arithmetic: a conic with one rational point has infinitely many (the chord trick, which is Theorem 8 in disguise); the rational points of an elliptic curve form a finitely generated abelian group (Mordell 1922, Weil 1928), via the chord-and-tangent construction from Theorem 7; and a curve of genus has only finitely many rational points (Faltings, 1983). Over , counting points gives the zeta function of the variety; Weil proved the analogue of the Riemann hypothesis for curves (1940s), whose concrete form for an elliptic curve is Hasse's bound seen in the second experiment, and Deligne proved the Weil conjectures in general (1974) using étale cohomology. and are themselves one-dimensional schemes, which is the starting point of algebraic number theory and arithmetic geometry.
Analysis— Complex analytic geometry
A complex variety is locally the zero set of holomorphic (indeed polynomial) functions, so complex analysis applies: the local ring embeds in the ring of convergent power series at , a smooth point has a neighbourhood biholomorphic to a ball in (implicit function theorem), and the intersection multiplicity equals the number of intersection points near after a small generic perturbation of — a "conservation of number" that is the analytic face of Theorem 9. Chow's theorem (1949) says that a closed analytic subset of is algebraic: on compact projective space, analysis produces nothing new. Hodge theory, which decomposes the cohomology of a smooth projective variety using harmonic forms, is an analytic tool with algebraic consequences (see complex and Kähler geometry).
Category theory— Schemes as functors: the functor of points
Theorem 5 says the category of affine varieties is dual to an algebraic category, and Grothendieck's reformulation takes this as the definition: a scheme is determined by its functor of points on commutative rings (Yoneda's lemma). For , ; for over , — the same equation read in every ring at once. Many important spaces are first defined as functors (Grassmannians, Hilbert schemes, moduli of curves) and then shown to be representable. The opens and the sheaf condition of Theorem 10 make the beginning of sheaf theory: local data glue to global data, which is the theme of sheaves and, in derived form, of derived categories, which arose from Grothendieck and Verdier's duality theory in algebraic geometry.
History and global context
- Conics and cubics. Apollonius of Perga (c. 200 BCE) studied conic sections synthetically. Diophantus of Alexandria (c. 3rd century CE) found rational solutions of quadratic and cubic equations by chord-type substitutions. Omar Khayyam (Nishapur, c. 1070) solved cubic equations by intersecting conics, classifying the cases geometrically.
- Coordinates and curves. Fermat and Descartes (1630s) introduced coordinates, turning curves into equations. Newton classified cubic curves (1704). Maclaurin and Euler stated that curves of degrees and meet in points, and Étienne Bézout published a proof for plane curves in his Théorie générale des équations algébriques (1779); rigorous treatments of multiplicities came much later. Jean-Victor Poncelet (1822) made points at infinity and imaginary points systematic in projective geometry.
- Riemann and after. Bernhard Riemann (1857) studied algebraic curves through Riemann surfaces and introduced the genus; Max Noether, Alexander Brill and the Italian school — Castelnuovo, Enriques and Severi — developed the geometry of curves and the classification of algebraic surfaces, with brilliant intuition but sometimes incomplete proofs.
- Algebraic foundations. David Hilbert's basis theorem (1890) and Nullstellensatz (1893), and Emmy Noether's ideal theory (1920s), made commutative algebra the foundation. Oscar Zariski and André Weil rebuilt algebraic geometry rigorously in the 1940s; the Zariski topology dates from this work, and Weil's Foundations of Algebraic Geometry (1946) made abstract varieties over arbitrary fields precise. Weil also stated his conjectures on varieties over finite fields (1949).
- Sheaves and schemes. Jean-Pierre Serre introduced sheaf cohomology into algebraic geometry (Faisceaux algébriques cohérents, 1955) and proved GAGA (1956). Alexander Grothendieck, with Jean Dieudonné, built the theory of schemes in the Éléments de géométrie algébrique (1960–67) and, with many collaborators, the Séminaire de Géométrie Algébrique; Pierre Deligne used étale cohomology to prove the Weil conjectures (1974).
- A worldwide subject. Kunihiko Kodaira classified compact complex surfaces; Heisuke Hironaka proved resolution of singularities in characteristic zero (1964); M. S. Narasimhan and C. S. Seshadri connected stable vector bundles on curves with unitary representations (1965); David Mumford developed geometric invariant theory and the theory of moduli; Shigefumi Mori founded the minimal model programme for threefolds (1988). More recently Caucher Birkar proved boundedness of Fano varieties (Fields Medal 2018) and June Huh used Hodge theory to settle conjectures in combinatorics (Fields Medal 2022). Andrew Wiles's proof of Fermat's Last Theorem (1995, with Richard Taylor) rests on the arithmetic geometry of elliptic curves and modular curves.
Further reading
- William Fulton, Algebraic Curves: An Introduction to Algebraic Geometry (1969; free revised edition 2008) — the clearest route to intersection multiplicity and a complete proof of Bézout's theorem (Chapters 3 and 5).
- Frances Kirwan, Complex Algebraic Curves (1992) — curves over , Bézout via resultants, and the topology of Riemann surfaces.
- Miles Reid, Undergraduate Algebraic Geometry (1988) — short, lively, with conics, cubics and the Nullstellensatz.
- David Cox, John Little and Donal O'Shea, Ideals, Varieties, and Algorithms (4th ed., 2015) — the dictionary made computational with Gröbner bases and resultants.
- Igor R. Shafarevich, Basic Algebraic Geometry 1 and 2 (1972; 3rd ed. 2013) — varieties, intersection theory, then schemes and complex manifolds.
- Robin Hartshorne, Algebraic Geometry (1977) — Chapter I on varieties, Chapter II on schemes and sheaves (Proposition II.2.2 is Theorem 10), Chapter III on cohomology.
- Joe Harris, Algebraic Geometry: A First Course (1992) — a tour of classical varieties through many examples.