The set of 5-tuples of lines in $\mathbf{P}^3$ is parametrized by the 20-dimensional product of Grassmannians $G(2,4)^{\times 5}$. The set of cubic surfaces is parametrized by a 19-dimensional projective space.


I can present a line in $\mathbf{P}^3$ as a $2 \times 4$ matrix (the projectivization of the row span) and five lines in $\mathbf{P}^3$ as a $10 \times 4$ matrix. Which rational function of this matrix vanishes on the set of tuples of lines that are contained in a cubic surface?



When does a cubic surface pass through five lines?
It's a $20 \times 20$ determinant. Take each $2 \times 4$ matrix
$$L = \begin{pmatrix}
s & t & u & v \\
w & x & y & z \\
\end{pmatrix}$$
and turn it into the $4 \times 20$ matrix
$$M := \begin{pmatrix}
s^3 & s^2 t & s^2 u & \cdots & v^3\\
3 s^2 w & 2 swt+s^2x & 2swu+s^2 y & \cdots & 3 v^2 z \\
3 s w^2 & 2 swx+w^2 t & 2swy + w^2 u & \cdots & 3 v z^2 \\
w^3 & w^2 x & w^2 y & \cdots & z^3 \\
\end{pmatrix}$$
If the pattern isn't so clear, the columns are indexed by the $20$ cubic monomials in $4$ variables. For each monomial, plugin $( a \ b ) \begin{pmatrix}
s & t & u & v \\
w & x & y & z \\
\end{pmatrix}$ for the $4$ entries and collect coefficients of $a$ and $b$. For example, the monomial $s^2 t$ becomes $(as+bw)^2 (at+bx)$; expanding and collecting coefficients gives the column $(s^2 t,\ 2swt+s^2 x, \ 2swx + w^2 t, \ w^2 x)^T$. A cubic vanishes on the row span of $L$ if and only if that cubic is in the kernel of $M$. ${}{}{}{}$


Stack up the $5$ $M$ matrices and take the determinant to get your answer.


