Proof (homotopy lemma, number of preimages)

Theorem (classification of compact 1-dimensional manifold) open_in_new

If $X$ is a compact 1-dimensional manifold with boundary, then $X$ is a disjoint union of finitely many copies of $S^1$ and $[0,1]$.

In particular $\# \partial X$ is even.

(Recall $\# f\inv(y)$ and $\# g\inv(y)$ are finite.)

Let $H: X \times [0,1]\to Y$ be a smooth homotopy from $f$ to $g$. First assume $y$ is a regular value of $H$. Then by the preimage theorem, $H\inv(y)$ is a 1-dimensional submanifold of $X$ with boundary $$ \begin{align*} \partial H\inv(y) = H\inv(y) \cap \partial(X \times [0,1]) = H\inv(y) \cap (X \times \set{0,1}), \end{align*} $$ so $$ \begin{align*} \# f\inv(y) - \# g\inv(y) \equiv \#f\inv(y) + \# g\inv(y) = \# \partial H\inv(y) \pmod 2. \end{align*} $$ Moreover $H\inv(y)$ is compact (as a closed set in the compact set $X$), so by classification, $\#\partial H\inv(y)$ is even, as required.

Now consider the general case when $y$ may not be a regular value of $H$. By the stack of records theorem, there exists an open neighbourhood $V\subseteq Y$ of $y$ such that $f\inv(V) = \bigsqcup_{i=1}^{n} U_i$ and $g\inv(V) = \bigsqcup_{i=1}^{\tilde n} \tilde U_i$ where $f|_{U_i}: U_i \xrightarrow{\sim} V$ and $g|_{U_i}: \tilde U_i \xrightarrow{\sim} V$ are diffeomorphisms. Therefore for all $w\in V$, $\#f\inv(w) = n$ and $\# g\inv(w) = \tilde n$.

Now by Sard's theorem, $\sb{y\in Y}{y\text{ is regular for all of }f,g,H}$ is dense in $Y$, so there exists $w\in V$ which is regular for all of $f,g,H$. Apply the above argument to show $n = \tilde n$, and hence $\# f\inv(y) = \# g\inv(y)$.