There are 27 lines on a smooth cubic surface
Yes. There are exactly lines on a smooth cubic surface. Let us formulate the precise statement. Here we only consider , as some of the analytic reasoning carries here, but I think a lot of statements could be generalized to an arbitrary algebraically closed field .
Definition. (Affine and Projective spaces) Let be a field (which is fixed throughout the definitions here). We denote by the -vector space . As a set, it consists of points where for all . We denote by the set of equivalence classes under , where we say whenever there exists such that for all . Instead of writing , we write to denote the equivalence class . This is said to be a point in the projective space .
Definition. (Classical projective variety) For a fixed and a fixed , one can input a polynomial and asks for points such that . For simplicity, we would require that be homogeneous, that is, is a -linear combination of monomials of the same degree, because if is homogeneous then we can easily see that and so the definition makes sense (i.e. whether the evaluation of at a point of is zero or not doesn't depend on the representative in ). The set of such points is denoted by or simply . We can generalize this a bit and ask for points that vanish under a set of polynomials. Formally, for a set of homogeneous polynomials, one writes . Any set that arises from this construction (i.e. there exists a set of homogeneous polynomials in for which ) is said to be a classical projective variety.
Definition. (Line) A set is said to be a straight line (or simply, a line), if there exists such that .
(Rough) Definition. (Smooth cubic surface) Let be a homogeneous polynomial of (pure) degree exactly three. The projective variety is said to be a cubic surface. It is said to be smooth if at every point , the tangent space has dimension equal to the codimension of in (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 be a smooth cubic surface, then the number of distinct lines such that is exactly .
The Fermat Cubic Surface
(This image is just a slice at and with small ..., not the whole picture!)

We begin with a special case: the Fermat cubic surface, defined as For this particular instance, we can count the number of lines directly. Suppose is a line inside the Fermat cubic surface. What can we say about ? By definition, there exists such that . Instead of viewing in , we can lift the coordinates of points in to . Such point has if and only if there exists (not both zero) such that for . In other words, if we add , then the set of such points is exactly the -linear combination of and ! Under this correspondence, we may view a projective line in as a plane in . In particular, we can represent a line by a matrix where the row span is precisely the plane in representing a line in . Since cannot simultaneously be zero, without loss of generality let us assume first that . And also, since the span doesn't change when a row is multiplied by a nonzero scalar, we can multiply the first row by and assume that . This means our matrix is in the form If , then we can also multiply the second row by to get Since the row span is preserved under Gaussian row operations, we can replace the second row by itself minus the first row, and write If is initially zero, then we also arrive here immediately.
Now, if then at least one of and must be nonzero. Furthermore, if then by the Fermat equation we'd require and so , impossible! Same for . This means if then both and must be nonzero. In this case, since , and , one can replace with and call as . This means our matrix is in the form By the Fermat equation, we have , so , i.e. must be a third root of . By Gaussian elimination, we can replace the first row with itself minus times the second row, and assume the matrix to be in the form Now, by the requirement that , we require that for all , the point must be in . This means for all (observe that allowing doesn't change any condition). Expanding , we have Since we require this to be true regardless of , we can view this as a polynomial equation in and , and match the coefficients. The coefficient of is . The coefficient of is . The coefficient of is , and the coefficient of is . We want all of these to be zero, so we have the system Since (where ) by the earlier discussion (or by the fourth equation above), we see that and so for the second and third equation to be true, we must have . Plug back into the first equation to get . Hence, we deduce that the matrix must be in the form where . All of this is done under the assumption that and .
What about the case (but still )? Recall that the step before assuming , we've deduced that our matrix is in the form As usual, multiplying a row by a scalar doesn't change the span, so if we can assume automatically. We have And since Gaussian row operations don't change the span, we can replace the first row by itself minus times the second row to get We can go back and check the requirement similarly as before: for all , we require , i.e. that . Expanding this, we get Viewing as a polynomial in and , and collecting the coefficients, we have By simple rearrangement, we get If then and so , and so , giving the matrix in the form with . If but , then and so , and so . This gives the matrix in the form where . If and , then we divide the second equation squared by the third equation to get . Plugging this to the first equation tells us that this is impossible.
This shows that if then the line can be represented by a matrix of the form But even if , we see that at least one among must have and one can repeat the same argument to deduce these forms. One sees from the deduction that if then , so without loss of generality we can simply swap with and assume , and arrive with the deduction above.
By requiring that every line to have the representative matrix with the first nonzero entry in each row being one, and sort the rows by imposing , we end up with exactly the forms above. Counting all the subcases of on the three big cases above, we see that there are solutions of and such that . This shows that there are exactly 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 , which is not really obvious).
The idea is that each homogenous polynomial of degree three (on variable ) is a linear combination of degree three monomials. The monomials include something like , , , 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 , next block corresponds to the power of , and so on. For example, denotes , and denotes . We can first consider the stars without bars: , and try to successively insert the bars three times. The first time we have options (leftmost, between the first and the second stars, between the second and the third stars, and rightmost), then options, then options, treating previous bars as objects. Then observe that permuting the bars gives the same result, so we divide everything by . This gives monomials. Hence, the space of degree three homogenous polynomials (union zero) is a -vector space of dimension . Since for all and homogenous of degree three, we can remove zero from the space, and quotient it by scalar multiplication, resulting in . In this way, we have identified the space of all cubic surfaces in with . Let be the subset of for which the corresponding polynomial has being smooth. Then corresponds to the space of all smooth cubic surfaces. We then define The space is said to be the moduli space of smooth cubic surfaces. The amazing feature of algebraic geometry is that we can interpret 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 is a projective variety. The product is still a projective variety. The condition can be written as a polynomial condition, hence the subset 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 , one can look at all possible line and check if or not. If , then , and we claim that there exists a (Euclidean) open neighborhood of and of such that is a neighborhood of that does not intersect with any other with . (This also requires some proofs, which is not elementary, and this is where we would import the implicit function theorem from analysis on to show that locally looks like a graph) Furthermore, if , then , but is Euclidean-closed, so is a point in the Euclidean-open set, hence has an open neighborhood of the form where .
By this construction, we see that for each fixed line , the pair satisfies: and for all lines . (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 , we obtain , and by applying axiom of choice, we can grab all these neighborhoods into . Since is a projective variety, hence complete, hence Euclidean-compact, and covers this, there is a finite subcover such that covers . Put . It is a finite intersection of open sets, hence still open. It is an open neighborhood of . By the property coming from the construction, we see that for a fixed , varying the lines , we have if and only if there exists a line such that and , and in such case, the candidate is unique. This gives a bijection between the set of lines for which and the set of lines for which , and shows that the function counting the number of lines (i.e. ) is constant in . This shows that is locally constant in the Euclidean topology.
One proves that is connected in the Euclidean topology to arrive at the conclusion that is therefore globally constant, and since , we conclude that for all .
Main References
- Gathmann's Algebraic Geometry notes: https://agag-gathmann.math.rptu.de/de/alggeom.php (I use the version of 2021/22 at https://agag-gathmann.math.rptu.de/class/alggeom-2021/alggeom-2021.pdf for reference)
- Lectures of Schmitt: https://youtube.com/playlist?list=PLq46Q92yretlI4c6WnjJGLyWlYYwNsCYe&si=6CAsVf4NgveXbRHQ