Cubic Surfaces From Blowups
The materials below are based on a collaborative illustration with Gabriel Dorfsman-Hopkins and Steve Trettel, exhibited as part of Creation: Between Art and Mathematics at the Maison Poincaré in Paris. Steve also put together a really nice applet here.
Blowups and the Cayley–Salmon Theorem
In algebraic geometry, blowing up is an operation used, among other things, to resolve singularities and to separate curves that cross. Geometrically, blowing up a point on a surface replaces that point with a copy of \(\Pb^1\), whose points correspond to the possible directions of lines passing through it.
For example, we can define the blowup of the plane at a point \(P \in \Pb^2\) formally as the incidence variety \[ \Blowup{P}{\Pb^2} \coloneqq \left\{ (Q, \ell) \in \Pb^2 \times (\Pb^2)^\vee : Q \in \ell, P \in \ell \right\}, \] whose points are pairs: a point \(Q\) of the plane, together with a line \(\ell\) through both \(P\) and \(Q\). This comes equipped with the blowup morphism \[ \begin{aligned} \pi : \Blowup{P}{\Pb^2} &\longrightarrow \Pb^2 \\ (Q,\ell) &\longmapsto Q. \end{aligned} \] Away from \(P\), this morphism is an isomorphism, because a point \(Q \neq P\) lies on exactly one line through \(P\). Its inverse is the rational map \[ \begin{aligned} \Pb^2 &\RationalTo \Blowup{P}{\Pb^2} \\ Q &\mapsto (Q,\overline{PQ}), \end{aligned} \] defined for every \(Q \neq P\). On the other hand, when \(Q = P\) every line through \(P\) is allowed, so the fiber over \(P\) is \[ \pi^{-1}(P) = \left\{(P,\ell):P\in\ell\right\} \cong \Pb^1, \] which is the exceptional divisor.
What does this have to do with cubic surfaces? The Cayley–Salmon theorem tells us that every smooth cubic surface (over \(\Cb\)) contains exactly 27 lines. Another classical result tells us where such surfaces come from: blowing up \(\Pb^2\) at six points in general position—meaning no three of the points are collinear, and the six do not all lie on a single conic—produces a smooth cubic surface, and every smooth cubic surface arises this way. This description gives a geometric way to see where the 27 lines come from!
Interactive Applet
Drag the blowup points in the projective plane (left) to see how they govern the geometry and the 27 lines of the resulting cubic surface (right). The curves in \(\Pb^2\) which become lines on the cubic surface are drawn faintly.
Mapping to the Surface
How does a plane with six marked points turn into a surface in \(\Pb^3\)? By way of cubic curves! The space of all homogeneous cubic forms in three variables (\(t_0, t_1, t_2\)) is spanned by 10 monomials. If we demand that a cubic vanishes at one of our blowup points, we impose a single linear constraint on its coefficients; for six points in general position, this leaves a vector space of dimension \(10 - 6 = 4\) consisting of the cubic forms which vanish at all of them. Choosing an ordered basis1 \((f_0, f_1, f_2, f_3)\) for this space defines a rational map \(\phi : \Pb^2 \RationalTo \Pb^3\) by \[ \phi(t_0, t_1, t_2) = [f_0(t_0, t_1, t_2) : f_1(t_0, t_1, t_2) : f_2(t_0, t_1, t_2) : f_3(t_0, t_1, t_2)]. \] This map is defined everywhere except at the six blowup points, where all four cubics vanish. Blowing up those points is exactly what repairs it, and the image is our cubic surface.
The map \(\phi\) is what we use to push forward curves in the plane to the 3D scene, revealing the full set of 27 lines on the cubic surface.
Where do the 27 Lines Come From?
We can make sense of why certain curves in \(\Pb^2\) become lines on the cubic surface using Bézout’s Theorem.
A curve in \(\Pb^3\) is a line exactly when a general plane meets it in a single point, so we count intersections with planes. The equation for a plane in \(\Pb^3\) is linear: \(Ax + By + Cz + Dw = 0\). If we pull this plane back to \(\Pb^2\) through our map \(\phi\), we substitute our polynomials to get \(A f_0 + B f_1 + C f_2 + D f_3 = 0\). Because every \(f_i\) vanishes at our six blowup points, so does this linear combination. Therefore, the pre-image of any plane section is a cubic curve in \(\Pb^2\) that passes through all six points.
By Bézout’s theorem, a curve of degree \(d\) in \(\Pb^2\) will intersect this cubic in \(3d\) points. However, if the curve passes through \(k\) of our blowup points, then \(k\) of those intersections are “used up” at the blowup sites, where \(\phi\) is not defined. The remaining \(3d-k\) intersections happen away from the blowups, meaning the image of the curve in \(\Pb^3\) will intersect our slicing plane exactly \(3d-k\) times. For a curve to map to a line in \(\Pb^3\), we need \(3d-k = 1\). Together with the blowup points themselves, this gives us our 27 lines via three distinct families:
- 15 Pair Lines (Green): There are 15 distinct ways to draw a line through 2 of our 6 blowup points (\(\binom{6}{2} = 15\)). A line has degree \(d=1\) and passes through \(k=2\) points, giving \(3(1)-2=1\).
- 6 Conic Lines (Blue): There are 6 ways to draw a conic through 5 of the 6 points (\(\binom{6}{5} = 6\)), since five points in general position lie on exactly one conic. A conic has degree \(d=2\) and passes through \(k=5\) points, giving \(3(2)-5=1\).
- 6 Exceptional Lines (Red): The blowup process replaces each of the 6 points with a \(\Pb^1\) representing the tangent directions, and each of these exceptional divisors is itself a line on the surface, yielding the final 6.
Monodromy and the \(E_6\) Action
When performing a point swap via Shift + Drag, two blowup points travel through the complexified projective plane \(\Pb^2(\Cb)\) and pass around one another without colliding. When they arrive, the set of six points is the same as when we started, so we have traced out a closed loop of smooth cubic surfaces which begins and ends at the same one.
The 27 lines follow along continuously, but they need not return to where they began: the loop induces a permutation of the lines, called its monodromy. Swapping the points \(i\) and \(j\) exchanges their two exceptional lines, their two conic lines (the conics which miss \(i\) and \(j\), respectively), and, for each of the other four points \(k\), the pair lines through \(\{i,k\}\) and \(\{j,k\}\). By watching the shaded lines move during an animation, we can see these exchanges happen! A loop, by contrast, returns every line to itself: each line is named by the points it comes from, and no points have traded places.
Swaps like these generate a copy of the symmetric group \(S_6\), which is only part of a larger story. The full group of symmetries of the configuration of 27 lines is the Weyl group \(W(E_6)\), of order \(51840\), and all of it appears as monodromy once we move through the space of all smooth cubic surfaces (see also Symmetric Cubic Surfaces and Their Lines). The symmetries beyond \(S_6\) mix our three families of lines. They reflect the fact that a cubic surface does not remember which six points were blown up to make it: it can be blown back down to a plane in \(51840/720 = 72\) different ways.
Putting it All Together
Given six blowup points in general position, the applet constructs the implicit 3D scene and renders it in real time through the following pipeline:
Line Construction
- Pair & Conic Lines: For each of the 15 pair lines and 6 conic lines, we evaluate two points on the curve in \(\Pb^2\), push them through \(\phi\), and extend the line through their images in \(\Pb^3\).
- Exceptional Lines: Because \(\phi\) evaluates to \([0:0:0:0]\) at the blowup points, we cannot simply plug them in. Instead, we compute the Jacobian matrix of partial derivatives \(J(\phi) = \left[ \frac{\partial f_i}{\partial t_j} \right]\) there. Approaching a blowup point from different directions gives different limits, and pushing the tangent directions through the Jacobian traces out its exceptional line in \(\Pb^3\).
Recovering the Implicit Equation
Our map gives us a parameterization of the surface, but attempting to render from it directly is messy—\(\phi\) is undefined at the blowup points, and badly behaved near them! To render the surface efficiently, we instead determine the cubic polynomial \(F(x, y, z, w)\) whose zero set it is. A general cubic form in four variables has 20 terms: \[ C_0 x^3 + C_1 x^2 y + C_2 x^2 z + \dots + C_{19} w^3 = 0 \] To find the 20 unknown coefficients \(C_i\), we use 19 random points in \(\Pb^2\) and map them to points \([X_i : Y_i : Z_i : W_i] \in \Pb^3\) using \(\phi\). Because these points are guaranteed to lie on our surface, \(F\) must vanish at each of them, which is a linear condition on the \(C_i\). This sets up a \(19 \times 20\) system of linear equations:
\[ \begin{bmatrix} X_1^3 & X_1^2 Y_1 & X_1^2 Z_1 & \dots & W_1^3 \\ X_2^3 & X_2^2 Y_2 & X_2^2 Z_2 & \dots & W_2^3 \\ \vdots & \vdots & \vdots & \ddots & \vdots \\ X_{19}^3 & X_{19}^2 Y_{19} & X_{19}^2 Z_{19} & \dots & W_{19}^3 \end{bmatrix} \begin{bmatrix} C_0 \\ C_1 \\ \vdots \\ C_{19} \end{bmatrix} = \begin{bmatrix} 0 \\ 0 \\ \vdots \\ 0 \end{bmatrix} \]
The null space of this matrix is one-dimensional, since the equation of a surface is only determined up to scaling, and any non-zero vector in it gives the coefficients of our implicit surface.
Raymarching
Finally, a WebGL fragment shader takes this 20-coefficient equation and renders it (in an affine chart) using a technique called raymarching. For every pixel on the screen, the shader casts a ray from the camera into a 3D bounding box. As the ray marches through the scene, it evaluates \(F(x,y,z,1)\) at each step: when the value changes sign, the shader knows the ray just punctured the implicit surface. It performs a rapid binary search to home in on the exact zero-crossing, calculates the gradient \(\nabla F\) at that point to determine how the surface is angled, and applies lighting using techniques from computer graphics. With a modern GPU, the result is a smooth cubic surface that we can explore in real time!
Footnotes
We might notice abrupt jumps in the surface when tinkering with the applet, even away from the degeneracy loci! A different basis gives the same surface up to a linear change of coordinates on \(\Pb^3\), and our algorithm for finding the \(f_i\) (reduced row echelon form) occasionally changes its choice of pivots. When it does, the picture jumps to a different view of the same surface.↩︎