Let $\pi:S\to C$ be a holomorphic map where $S$ is a compact complex surface and $C$ is a complex curve. How can we show that the set of critical values of $\pi$ is a finite subset of $C$? (I know that Sard's theorem implies that the set of regular values of $\pi$ is a dense subset of $C$, but I can't see that this implies that there are only finitely many critical values.)
P.S. For a holomorphic map between compact complex manifolds, does the set of critical values (which is a closed set of the target) is a subvariety of the target? (If this is true the above result follows immediately.)
Consider the subset $X\subset S$ consisting of points $x\in S$ such that where $d\pi(x)=0$. Note that $x\in S$ is a critical point of $\pi$ precisely when $x\in X$ (since the range of $\pi$ is is complex 1-dimensional and $\pi$ is holomorphic).
Then $X$ is a (closed) analytic subvariety in $S$. By the compactness of $S$, $X$ is also compact. Hence, it has only finitely many irreducible components $X_1,...,X_m$. (These components need not have the same dimension.) For each irreducible component $X_k$ of $X$, $\pi|_{X_k}$ is constant (since $d\pi$ vanishes at $X_k$ and $X_k$ is irreducible). The subset $$ \{\pi(X_k): k=1,...,m\}$$ is exactly the set of critical values of $\pi$. It is finite since each $\pi(X_k)$ is a singleton.
Note that this proof did not use the assumption that $S$ is 2-dimensional: The result holds whenever $S$ is a compact complex manifold and the range of $\pi$ is complex 1-dimensional.