There are 27 lines on a smooth cubic surface

Yes. There are exactly 2727 lines on a smooth cubic surface. Let us formulate the precise statement. Here we only consider K=CK = \mathbb{C}, as some of the analytic reasoning carries here, but I think a lot of statements could be generalized to an arbitrary algebraically closed field KK.

Definition. (Affine and Projective spaces) Let KK be a field (which is fixed throughout the definitions here). We denote by An\mathbb{A}^n the KK-vector space KnK^n. As a set, it consists of points (x1,x2,,xn)(x_1, x_2, \dots, x_n) where xiKx_i \in K for all i{1,,n}i \in \{1, \dots, n\}. We denote by Pn\mathbb{P}^n the set (An+1{0})/(\mathbb{A}^{n+1} \setminus \{0\})/\sim of equivalence classes under \sim, where we say (x1,x2,,xn+1)(y1,y2,,yn+1)(x_1, x_2, \dots, x_{n+1}) \sim (y_1, y_2, \dots, y_{n+1}) whenever there exists λK×\lambda \in K^\times such that yi=λxiy_i = \lambda x_i for all i{1,,n}i \in \{1, \dots, n\}. Instead of writing [(x1,x2,,xn+1)][(x_1, x_2, \dots, x_{n+1})]_\sim, we write (x0:x1::xn)(x_0 : x_1 : \dots : x_n) to denote the equivalence class [(x0,x1,,xn)][(x_0, x_1, \dots, x_n)]_\sim. This is said to be a point in the projective space Pn\mathbb{P}^n.

Definition. (Classical projective variety) For a fixed KK and a fixed nNn \in \mathbb{N}, one can input a polynomial fK[x0,x1,,xn]f \in K[x_0, x_1, \dots, x_n] and asks for points (x0:x1::xn)Pn(x_0 : x_1 : \dots : x_n) \in \mathbb{P}^n such that f(x0,x1,,xn)=0f(x_0, x_1, \dots, x_n) = 0. For simplicity, we would require that ff be homogeneous, that is, ff is a KK-linear combination of monomials of the same degree, because if ff is homogeneous then we can easily see that f(x0,x1,,xn)=0    f(λx0,λx1,,λxn)=0,λK,f(x_0, x_1, \dots, x_n) = 0 \iff f(\lambda x_0, \lambda x_1, \dots, \lambda x_n) = 0, \quad \forall \lambda \in K, and so the definition makes sense (i.e. whether the evaluation of ff at a point of Pn\mathbb{P}^n is zero or not doesn't depend on the representative in An+1\mathbb{A}^{n+1}). The set of such points is denoted by VPn(f)V_{\mathbb{P}^n}(f) or simply V(f)V(f). We can generalize this a bit and ask for points that vanish under a set of polynomials. Formally, for a set SK[x0,,xn]S \subseteq K[x_0, \dots, x_n] of homogeneous polynomials, one writes V(S):=fSV(f)V(S) := \bigcap_{f \in S} V(f). Any set VPnV \subseteq \mathbb{P}^n that arises from this construction (i.e. there exists a set SS of homogeneous polynomials in K[x0,,xn]K[x_0, \dots, x_n] for which V=V(S)V = V(S)) is said to be a classical projective variety.

Definition. (Line) A set LPnL \subseteq \mathbb{P}^n is said to be a straight line (or simply, a line), if there exists (w0::wn)(z0::zn)Pn(w_0 : \dots : w_n) \ne (z_0 : \dots : z_n) \in \mathbb{P}^n such that L={(sw0+tz0::swn+tzn)Pn ⁣:(s:t)P1}L = \{(sw_0 + tz_0 : \dots : sw_n + tz_n) \in \mathbb{P}^n \colon (s : t) \in \mathbb{P}^1\}.

(Rough) Definition. (Smooth cubic surface) Let fK[x0,x1,x2,x3]f \in K[x_0, x_1, x_2, x_3] be a homogeneous polynomial of (pure) degree exactly three. The projective variety V(f)V(f) is said to be a cubic surface. It is said to be smooth if at every point zV(f)z \in V(f), the tangent space TzV(f)T_zV(f) has dimension equal to the codimension of zz in V(f)V(f) (or actually the more basic definition is that the tangent space equals the tangent cone, but in any case, we have to introduce some tangent machineries here, so in this article let's just handwave this and only think intuitively about smoothness).

Theorem. Let XP3X \subseteq \mathbb{P}^3 be a smooth cubic surface, then the number of distinct lines LP3L \subseteq \mathbb{P}^3 such that LXL \subseteq X is exactly 2727.

The Fermat Cubic Surface

(This image is just a slice at x0=1x_0 = 1 and x1,x2,x3Rx_1, x_2, x_3 \in \mathbb{R} with small x1,x2,x3|x_1|, |x_2|, |x_3|..., not the whole picture!)

We begin with a special case: the Fermat cubic surface, defined as X=V(x03+x13+x23+x33)P3.X = V(x_0^3 + x_1^3 + x_2^3 + x_3^3) \subseteq \mathbb{P}^3. For this particular instance, we can count the number of lines directly. Suppose LXL \subseteq X is a line inside the Fermat cubic surface. What can we say about LL? By definition, there exists (w0:w1:w2:w3)(z0:z1:z2:z3)L(w_0 : w_1 : w_2 : w_3) \ne (z_0 : z_1 : z_2 : z_3) \in L such that L={sw+tz ⁣:(s:t)P1}L = \{sw+tz \colon (s : t) \in \mathbb{P}^1\}. Instead of viewing in P3\mathbb{P}^3, we can lift the coordinates (x0:x1:x2:x3)(x_0 : x_1 : x_2 : x_3) of points in LL to (x0,x1,x2,x3)A4(x_0, x_1, x_2, x_3) \in \mathbb{A}^4. Such point (x0,x1,x2,x3)(x_0, x_1, x_2, x_3) has (x0:x1:x2:x3)L(x_0 : x_1 : x_2 : x_3) \in L if and only if there exists s,tCs, t \in \mathbb{C} (not both zero) such that xi=swi+tzix_i = sw_i + tz_i for i=0,1,2,3i = 0, 1, 2, 3. In other words, if we add (0,0,0,0)(0, 0, 0, 0), then the set of such points is exactly the C\mathbb{C}-linear combination of (w0,w1,w2,w3)(w_0, w_1, w_2, w_3) and (z0,z1,z2,z3)(z_0, z_1, z_2, z_3)! Under this correspondence, we may view a projective line in P3\mathbb{P}^3 as a plane in A4\mathbb{A}^4. In particular, we can represent a line by a matrix (w0w1w2w3z0z1z2z3,)\begin{pmatrix} w_0 & w_1 & w_2 & w_3\\ z_0 & z_1 & z_2 & z_3, \end{pmatrix} where the row span is precisely the plane in A4\mathbb{A}^4 representing a line in P3\mathbb{P}^3. Since w0,w1,w2,w3w_0, w_1, w_2, w_3 cannot simultaneously be zero, without loss of generality let us assume first that w00w_0 \ne 0. And also, since the span doesn't change when a row is multiplied by a nonzero scalar, we can multiply the first row by 1w0\frac{1}{w_0} and assume that w0=1w_0 = 1. This means our matrix is in the form (1w1w2w3z0z1z2z3).\begin{pmatrix} 1 & w_1 & w_2 & w_3\\ z_0 & z_1 & z_2 & z_3\\ \end{pmatrix}. If z00z_0 \ne 0, then we can also multiply the second row by 1z0\frac{1}{z_0} to get (1w1w2w31z1z2z3).\begin{pmatrix} 1 & w_1 & w_2 & w_3\\ 1 & z_1 & z_2 & z_3\\ \end{pmatrix}. Since the row span is preserved under Gaussian row operations, we can replace the second row by itself minus the first row, and write (1w1w2w30z1z2z3).\begin{pmatrix} 1 & w_1 & w_2 & w_3\\ 0 & z_1 & z_2 & z_3\\ \end{pmatrix}. If z0z_0 is initially zero, then we also arrive here immediately.

Now, if z1=0z_1 = 0 then at least one of z2z_2 and z3z_3 must be nonzero. Furthermore, if z1=z2=0z_1 = z_2 = 0 then by the Fermat equation we'd require z33=0z_3^3 = 0 and so z3=0z_3 = 0, impossible! Same for z1=z3=0    z2=0z_1 = z_3 = 0 \implies z_2 = 0. This means if z1=0z_1 = 0 then both z2z_2 and z3z_3 must be nonzero. In this case, since z20z_2 \ne 0, and (0:0:z2:z3)=(0:0:1:z3z2)(0 : 0 : z_2 : z_3) = (0 : 0 : 1 : \frac{z_3}{z_2}), one can replace (0,0,z2,z3)(0, 0, z_2, z_3) with (0,0,1,z3z2)(0, 0, 1, \frac{z_3}{z_2}) and call z3z2\frac{z_3}{z_2} as z3z_3. This means our matrix is in the form (1w1w2w3001z3).\begin{pmatrix} 1 & w_1 & w_2 & w_3\\ 0 & 0 & 1 & z_3\\ \end{pmatrix}. By the Fermat equation, we have 13+z33=01^3 + z_3^3 = 0, so z33=1z_3^3 = -1, i.e. z3z_3 must be a third root of 1-1. By Gaussian elimination, we can replace the first row with itself minus w2w_2 times the second row, and assume the matrix to be in the form (1w10w3001z3).\begin{pmatrix} 1 & w_1 & 0 & w_3\\ 0 & 0 & 1 & z_3 \end{pmatrix}. Now, by the requirement that LXL \subseteq X, we require that for all (s:t)P1(s : t) \in \mathbb{P}^1, the point (s:sw1:t:sw3+tz3)(s : sw_1 : t : sw_3 + tz_3) must be in XX. This means s3+s3w13+t3+(sw3+tz3)3=0s^3 + s^3w_1^3 + t^3 + (sw_3 + tz_3)^3 = 0 for all s,tCs, t \in \mathbb{C} (observe that allowing s=t=0s = t = 0 doesn't change any condition). Expanding (sw3+tz3)3(sw_3 + tz_3)^3, we have s3+s3w13+t3+s3w33+3s2w32tz3+3sw3t2z32+t3z33=0.s^3 + s^3w_1^3 + t^3 + s^3w_3^3 + 3s^2w_3^2tz_3 + 3sw_3t^2z_3^2 + t^3z_3^3 = 0. Since we require this to be true regardless of s,tCs, t \in \mathbb{C}, we can view this as a polynomial equation in ss and tt, and match the coefficients. The coefficient of s3s^3 is 1+w13+w331+w_1^3+w_3^3. The coefficient of s2ts^2t is 3w32z33w_3^2z_3. The coefficient of st2st^2 is 3w3z323w_3z_3^2, and the coefficient of t3t^3 is 1+z331+z_3^3. We want all of these to be zero, so we have the system {1+w13+w33=03w32z3=03w3z32=01+z33=0.\begin{cases} 1+w_1^3+w_3^3 &= 0\\ 3w_3^2z_3 &= 0\\ 3w_3z_3^2 &= 0\\ 1+z_3^3 &= 0. \end{cases} Since z3{ω,ω2,1}z_3 \in \{-\omega, -\omega^2, -1\} (where ω=exp(2iπ/3)\omega = \exp(2 i \pi/3)) by the earlier discussion (or by the fourth equation above), we see that z30z_3 \ne 0 and so for the second and third equation to be true, we must have w3=0w_3 = 0. Plug back into the first equation to get 1+w13=01+w_1^3 = 0. Hence, we deduce that the matrix must be in the form (1w100001z3)\begin{pmatrix} 1 & w_1 & 0 & 0\\ 0 & 0 & 1 & z_3\\ \end{pmatrix} where w1,z3{ω,ω2,1}w_1, z_3 \in \{-\omega, -\omega^2, -1\}. All of this is done under the assumption that z1=0z_1 = 0 and w0=1w_0 = 1.

What about the case z10z_1 \ne 0 (but still w0=1w_0 = 1)? Recall that the step before assuming z1=0z_1 = 0, we've deduced that our matrix is in the form (1w1w2w30z1z2z3).\begin{pmatrix} 1 & w_1 & w_2 & w_3\\ 0 & z_1 & z_2 & z_3 \end{pmatrix}. As usual, multiplying a row by a scalar doesn't change the span, so if z10z_1 \ne 0 we can assume z1=1z_1 = 1 automatically. We have (1w1w2w301z2z3).\begin{pmatrix} 1 & w_1 & w_2 & w_3\\ 0 & 1 & z_2 & z_3\\ \end{pmatrix}. And since Gaussian row operations don't change the span, we can replace the first row by itself minus w1w_1 times the second row to get (10w2w301z2z3).\begin{pmatrix} 1 & 0 & w_2 & w_3\\ 0 & 1 & z_2 & z_3\\ \end{pmatrix}. We can go back and check the requirement LXL \subseteq X similarly as before: for all (s:t)P1(s : t) \in \mathbb{P}^1, we require (s:t:sw2+tz2:sw3+tz3)X(s : t : sw_2 + tz_2 : sw_3 + tz_3) \in X, i.e. that s3+t3+(sw2+tz2)3+(sw3+tz3)2=0s^3 + t^3 + (sw_2 + tz_2)^3 + (sw_3 + tz_3)^2 = 0. Expanding this, we get s3+t3+s3w23+3s2w22tz2+3sw2t2z22+t3z23+s3w33+3s2w33tz3+3sw3t2z32+t3z33=0.s^3 + t^3 + s^3w_2^3 + 3s^2w_2^2tz_2 + 3sw_2t^2z_2^2 + t^3z_2^3 + s^3w_3^3 + 3s^2w_3^3tz_3 + 3sw_3t^2z_3^2 + t^3z_3^3 = 0. Viewing as a polynomial in ss and tt, and collecting the coefficients, we have {1+w23+w33=03w22z2+3w32z3=03w2z22+3w3z32=01+z23+z33=0.\begin{cases} 1+w_2^3+w_3^3 &= 0\\ 3w_2^2z_2 + 3w_3^2z_3 &= 0\\ 3w_2z_2^2 + 3w_3z_3^2 &= 0\\ 1+z_2^3+z_3^3 &= 0. \end{cases} By simple rearrangement, we get {w23+w33=1w22z2=w32z3w2z22=w3z32z23+z33=1.\begin{cases} w_2^3+w_3^3 &= -1\\ w_2^2z_2 &= -w_3^2z_3\\ w_2z_2^2 &= -w_3z_3^2\\ z_2^3+z_3^3 &= -1. \end{cases} If w2=0w_2 = 0 then w33=1w_3^3 = -1 and so z3=0z_3 = 0, and so z23=1z_2^3 = -1, giving the matrix in the form (100w301z20)\begin{pmatrix} 1 & 0 & 0 & w_3\\ 0 & 1 & z_2 & 0 \end{pmatrix} with z2,w3{ω,ω2,1}z_2, w_3 \in \{-\omega, -\omega^2, -1\}. If w20w_2 \ne 0 but z2=0z_2 = 0, then z33=1z_3^3 = -1 and so w3=0w_3 = 0, and so w23=1w_2^3 = -1. This gives the matrix in the form (10w20010z3)\begin{pmatrix} 1 & 0 & w_2 & 0\\ 0 & 1 & 0 & z_3\\ \end{pmatrix} where w2,z3{ω,ω2,1}w_2, z_3 \in \{-\omega, -\omega^2, -1\}. If w20w_2 \ne 0 and z20z_2 \ne 0, then we divide the second equation squared by the third equation to get w23=w33w_2^3 = -w_3^3. Plugging this to the first equation tells us that this is impossible.

This shows that if w00w_0 \ne 0 then the line LL can be represented by a matrix of the form (1α00001β),(100α01β0),(10α0010β),α,β{ω,ω2,1}.\begin{pmatrix} 1 & \alpha & 0 & 0\\ 0 & 0 & 1 & \beta \end{pmatrix}, \quad \begin{pmatrix} 1 & 0 & 0 & \alpha\\ 0 & 1 & \beta & 0 \end{pmatrix}, \quad \begin{pmatrix} 1 & 0 & \alpha & 0\\ 0 & 1 & 0 & \beta\\ \end{pmatrix}, \quad \alpha, \beta \in \{-\omega, -\omega^2, -1\}. But even if w0=0w_0 = 0, we see that at least one ii among {1,2,3}\{1, 2, 3\} must have wi0w_i \ne 0 and one can repeat the same argument to deduce these forms. One sees from the deduction that if w0=0w_0 = 0 then z0=1z_0 = 1, so without loss of generality we can simply swap ww with zz and assume w00w_0 \ne 0, and arrive with the deduction above.

By requiring that every line L={(sw0+tz0::sw3+tz3) ⁣:(s,t)P1}L = \{(sw_0+tz_0 : \dots : sw_3+tz_3) \colon (s, t) \in \mathbb{P}^1\} to have the representative matrix (w0w1w2w3z0z1z2z3)\begin{pmatrix} w_0 & w_1 & w_2 & w_3\\ z_0 & z_1 & z_2 & z_3 \end{pmatrix} with the first nonzero entry in each row being one, and sort the rows by imposing w0z0|w_0| \geq |z_0|, we end up with exactly the forms above. Counting all the subcases of α,β{ω,ω2,1}\alpha, \beta \in \{-\omega, -\omega^2, -1\} on the three big cases above, we see that there are 3×9=273 \times 9 = 27 solutions of ww and zz such that LXL \subseteq X. This shows that there are exactly 2727 lines on the Fermat cubic surface.

The general case and the configuration space

This is where (classical) algebraic geometry comes in. Indeed, we can try the same old elementary combinatorial counting (as above) on every possible smooth cubic surface, but this is more or less a too-time-consuming-brute-force method, and such brute-force algorithm must be applied to each of the surfaces one by one! Not a realistic way to prove that this is true for all smooth surfaces (unless one can show that the algorithm terminates in finite time no matter which smooth surfaces is in the input, and also show that the algorithm always output 2727, which is not really obvious).

The idea is that each homogenous polynomial of degree three (on variable x0,x1,x2,x3x_0, x_1, x_2, x_3) is a linear combination of degree three monomials. The monomials include something like x03x_0^3, x1x32x_1x_3^2, x0x2x3x_0x_2x_3, etc. We can count the number of all possible degree three monomials using elementary combinatorial argument like stars and bars: there are three stars, and we would like to insert three bars, so that the leftmost block corresponds to the power of x0x_0, next block corresponds to the power of x1x_1, and so on. For example, \star || \star | \star denotes x0x2x3x_0x_2x_3, and | \star | \star\star | denotes x1x22x_1x_2^2. We can first consider the stars without bars: \star\star\star, and try to successively insert the bars three times. The first time we have 44 options (leftmost, between the first and the second stars, between the second and the third stars, and rightmost), then 55 options, then 66 options, treating previous bars as objects. Then observe that permuting the bars gives the same result, so we divide everything by 3!3!. This gives 4×5×63!=20\frac{4 \times 5 \times 6}{3!} = 20 monomials. Hence, the space of degree three homogenous polynomials (union zero) is a C\mathbb{C}-vector space of dimension 2020. Since V(f)=V(λf)V(f) = V(\lambda f) for all λC×\lambda \in \mathbb{C}^\times and homogenous ff of degree three, we can remove zero from the space, and quotient it by scalar multiplication, resulting in P19\mathbb{P}^{19}. In this way, we have identified the space of all cubic surfaces in P3\mathbb{P}^3 with P19\mathbb{P}^{19}. Let UP19U \subseteq \mathbb{P}^{19} be the subset of P19\mathbb{P}^{19} for which the corresponding polynomial ff has V(f)V(f) being smooth. Then UU corresponds to the space of all smooth cubic surfaces. We then define M:={(X,L) ⁣:XU and LX is a line}P19×(Lines in P3).M := \{(X, L) \colon X \in U \text{ and } L \subseteq X \text{ is a line}\} \subseteq \mathbb{P}^{19} \times (\text{Lines in }\mathbb{P}^3). The space MM is said to be the moduli space of smooth cubic surfaces. The amazing feature of algebraic geometry is that we can interpret MM as a geometric space: it is actually a projective variety! This is not trivial, but the prerequisites to precisely prove this statement is somehow way too high to be written here, so I'll just admit the result. The idea is that the set of lines in a projective space is a special case of a structure called Grassmannians, which are the linear subspaces of a vector space. One can show that the Grassmannians are projective varieties. Then, one can show that the condition for a cubic surface to be smooth is a polynomial condition, so UP19U \subseteq \mathbb{P}^{19} is a projective variety. The product is still a projective variety. The condition LXL \subseteq X can be written as a polynomial condition, hence the subset MM is a projective subvariety.

Now what do we get from knowing this? The theory of classical algebraic geometry tells us that the projective varieties are automatically complete (think of compactness, but in the Zariski sense), and is then automatically compact in the Euclidean topology.

The Conclusion

Now, for each fixed XUX \in U, one can look at all possible line LL and check if LXL \subseteq X or not. If LXL \subseteq X, then (X,L)M(X, L) \in M, and we claim that there exists a (Euclidean) open neighborhood VLV_L of XX and WLW_L of LL such that (VL×WL)M(V_L \times W_L) \cap M is a neighborhood of (X,L)(X, L) that does not intersect with any other (Y,L)(Y, L') with LLL' \ne L. (This also requires some proofs, which is not elementary, and this is where we would import the implicit function theorem from analysis on C\mathbb{C} to show that MM locally looks like a graph) Furthermore, if L⊈XL \not\subseteq X, then (X,L)M(X, L) \notin M, but MM is Euclidean-closed, so (X,L)(X, L) is a point in the Euclidean-open set, hence has an open neighborhood of the form VL×WLV_L \times W_L where (VL×WL)M=(V_L \times W_L) \cap M = \varnothing.

By this construction, we see that for each fixed line LL, the pair (VL,WL)(V_L, W_L) satisfies: YVL,[LWL,(Y,L)M]    (X,L)M,\forall Y \in V_L, [\exists L' \in W_L, (Y, L') \in M] \iff (X, L) \in M, and (U×(WLWL))M=,(U \times (W_L \cap W_{L'})) \cap M = \varnothing, for all lines LLL \ne L'. (Note: I recommend the reader to see the picture given in Lemma 11.4 of Gathmann's Algebraic Geometry notes... It gives a very clear idea what we're doing here. The link is given at the end of this article.)

In all cases for LL, we obtain (VL,WL)(V_L, W_L), and by applying axiom of choice, we can grab all these neighborhoods into ((VL,WL))L(Lines in P3)((V_L, W_L))_{L \in (\text{Lines in } \mathbb{P}^3)}. Since (Lines in P3)(\text{Lines in } \mathbb{P}^3) is a projective variety, hence complete, hence Euclidean-compact, and (WL)L(W_L)_{L} covers this, there is a finite subcover F\mathcal{F} such that (WL)LF(W_L)_{L \in \mathcal{F}} covers (Lines in P3)(\text{Lines in } \mathbb{P}^3). Put V:=LFVLV := \bigcap_{L \in \mathcal{F}} V_L. It is a finite intersection of open sets, hence still open. It is an open neighborhood of XX. By the property coming from the construction, we see that for a fixed YVY \in V, varying the lines LL', we have (Y,L)M(Y, L') \in M if and only if there exists a line LL such that (X,L)M(X, L) \in M and LWLL' \in W_{L}, and in such case, the candidate LL is unique. This gives a bijection between the set of lines LL' for which (Y,L)M(Y, L') \in M and the set of lines LL for which (X,L)M(X, L) \in M, and shows that the function c ⁣:UNc \colon U \to \mathbb{N} counting the number of lines (i.e. c(X):={L ⁣:(X,L)M}c(X) := |\{L \colon (X, L) \in M\}|) is constant in VV. This shows that cc is locally constant in the Euclidean topology.

One proves that UU is connected in the Euclidean topology to arrive at the conclusion that cc is therefore globally constant, and since c(Fermat cubic)=27c(\text{Fermat cubic}) = 27, we conclude that c(X)=27c(X) = 27 for all XUX \in U. \square

Main References