I asked this question on math stack exchange but did not receive any reaction. I would like to try again here since I am sure this is known.
In the book An invitation to algebraic geometry by Smith et. al. (2000) the following definition is given for the degree of a projective variety:
The degree of the projective variety $V \subset \mathbb{P}^n$ is the greatest possible finite number of intersection points of $V$ with a linear subvariety $L \subset \mathbb{P}^n$ of dimension equal to the codimension of $V$.
Then it is added:
In fact, the maximal number of intersection points is almost always achieved: The degree of $V$ is the number of points common to $V$ and a $(\mathrm{codim} V)$-dimensional generic linear subvariety. One should interpret the word "generic" here to mean the intuitive idea of a typical, representative, or "sufficiently general" linear subvariety. To make this idea precise, the reader should prove that there is a dense open subset $U$ of the Grassmannian of all $(\mathrm{codim} V)$-dimensional subspaces of $\mathbb{P}^n$ such that for any $\Lambda$ in this open set, $V \cap \Lambda$ consists of precisely $d = \mathrm{deg} V$ distinct points. In this case, "generic" would mean simply "member of $U$."
I am having troubles proving this claim. There is a similar question here from which I got some ideas but I couldn't finish an argument. Here is my attempt.
Let $k = \mathrm{codim} V$. Let $\mathrm{Gr}(k+1,n+1)$ be the Grassmannian of $(k+1)$-dimensional planes in $\mathbb{A}^{n+1}$ (= $k$-planes in $\mathbb{P}^n$). First, one can show that always $V \cap L \neq \emptyset$ for any $k$-plane $L$ in $\mathbb{P}^n$ using the projective dimension theorem. I find this is somehow also missing in the book.
Now, consider the incidence correspondence $X = \lbrace (v,L) \in V \times \mathrm{Gr}(k+1,n+1) \mid v \in L \rbrace \subset V \times \mathrm{Gr}(k+1,n+1)$. This is a projective variety. The projection $\pi \colon X \to \mathrm{Gr}(k+1,n+1)$ is surjective by the observation above. Moreover, $\pi^{-1}(L) = V \cap L$. So, the degree is about fiber cardinality of $\pi$. It is now a general property of surjective morphisms $f \colon X \to Y$ of varieties that there is a non-empty open subset $U$ of $Y$ such that $\mathrm{dim} f^{-1}(y) = \mathrm{dim}X - \mathrm{dim} Y$. This fact is not covered in the book.
One can compute that $\mathrm{dim} X = \mathrm{dim} \mathrm{Gr}(k+1,n+1)$ here, so we conclude that there is a non-empty open (thus dense) subset $U$ of $\mathrm{Gr}(k+1,n+1)$ such that $\mathrm{dim}(V \cap L) = 0$ for all $L \in U$. This means $\pi$ is generically finite. I believe seeing a statement in the stacks project that one can take $U$ to be the set of points with finite fibers indeed, and then $\pi|_{\pi^{-1}(U)}$ is a finite morphism.
But now my problem is to show that on an open subset of $U$ the cardinality of $V \cap L$ is indeed the maximal cardinality of all finite intersections. I do not see this at all. If $\pi$ were flat, then it is a general property that fiber cardinality is always $\leq$ than the generic fiber cardinality. But I do not see why $\pi$ should be flat. And in general it is not true that the generic fiber cardinality is the maximal fiber cardinality. And somehow all this also goes beyond the material of the book.
So, how does one prove the claim?
Is the claim in the book even correct?