What is a good reference to read about "the degree of an algebraic subset of $\mathbb{P}^n$ is the number with a generic linear subspace"? I read already a lot that the degree of a closed algebraic subset of $\mathbb{P}^n$ with dimension $k$ can be seen as the number of intersection points with a generic linear subspace of codimension $k$, however I have never seen a detailed development of such a statement. I'm also particularly interested in a much weaker statement: how to see that there even exists a linear subspace of codimension $k$ that intersects the closed algebriac set in a finite number of points? What would be a good reference for this, so that I can read more in detail about this fact?
 A: Let me give a proof for the weaker statement that you ask about. As with many similar statements about incidences of subvarieties in projective space, one can use a so-called incidence correspondence to linearise the problem in some sense.
In my answer I use $\mathbf G(n-k,n)$ to denote the Grassmannian of $n-k$-dimensional linear subspaces in $\mathbf P^n$.
So let $Z \subset \mathbf P^n$ be a closed algebraic subset of dimension $k$. It is enough to consider the case where $Z$ is irreducible. Consider the incidence correspondence
$$ I = \left\{ (L, z) \mid L \in \mathbf G(n-k,n), z \in Z \cap L \right\} $$
Now two subvarieties of $\mathbf P^n$ of complementary dimension must intersect (as proved e.g. in Chapter 1 of Hartshorne). So for any $L \in \mathbf G(n-k,n)$, the intersection $Z \cap L$ is nonempty. Put differently, the first projection map $\pi_1: I \rightarrow \mathbf G(n-k,n)$ is surjective.
We want to prove that a general fibre of the first projection $\pi_1: I \rightarrow \mathbf G(n-k,n)$ is finite. Since this map is surjective, it is enough to prove that $I$ is irreducible and that $I$ has the same dimension as $\mathbf G(n-k,n)$.
To see these, consider now the second projection $\pi_2: I \rightarrow Z$. For a point $z \in Z$, the fibre $\pi_2^{-1}(z)$ is just the set of $n-k$-dimensional linear subspaces  in $\mathbf P^n$ which pass through $z$. This is isomorphic to the Grassmannian $\mathbf G(n-k-1,n-1)$. In particular every fibre is irreducible of dimension $k(n-k)$. This proves two things:
(a) since $\pi_2$ is a surjective morphism onto the irreducible variety $Z$ with all fibres irreducible, the set $I$ is also irreducible. (This follows from results of Chapter of Shafarevich, if I recall correctly).
(b) the dimension of $I$ equals
$$\operatorname{dim} Z + \operatorname{dim}(\pi_2^{-1}(z))\\
= k + k(n-k)\\
= k(n-k+1) $$
On the other hand, the variety $\mathbf G(n-k,n)$ has dimension $(n-k+1)(n-(n-k))=k(n-k+1)$. So the dimensions of the source and target of $\pi_1$ are equal, as required.

In fact one can use a similar approach to give a full proof that the definition you are asking about does in fact make sense. The basic point is to show that for any finite morphism $f:Y \rightarrow X$ of projective varieties, there is a nonempty open set $U \subset X$ for which the cardinality of the fibres of $X$ is constant. Applying this with $Y=I$ and $X=\mathbf G(n-k,n)$, we get the statement you need. Again if I recall correctly, the relevant results are in Chapter 1 of Shafarevich, but I don't have a copy to hand.
