I'm reading the section in McDuff and Salamon's Introduction to Symplectic Topology on Chern numbers on surfaces. I've run into an elementary-looking detail in a proof that I don't see a clear reason why is true.
If $\Sigma$ is a compact oriented surface with nonempty boundary a disjoint union of oriented circles $C_i$, we can define the degree of a map $f: \partial \Sigma \to S^1$ by the sum of the degrees of $f|_{C_i}$. That is, $\text{deg }(f) = \sum_i \text{deg } (f|_{C_i})$. McDuff and Salamon's proof of a lemma (2.71) relies on that if a map $f: \partial \Sigma \to S^1$ extends to a map $\Sigma \to S^1$ then $\deg(f) = 0$.
It's a standard exercise about homotopies that this is true when $\Sigma $ is the disk, in which case extending over the disk is equivalent to being null-homotopic. With a bit of thought, this is also true when $\Sigma$ is a cylinder. However, I'm struggling to see why this is true for a general surface $\Sigma$ with nonempty boundary and can't manage to find a proof of this fact online.
Am I missing something straightforward? And how should one see that this is true?
Pick a triangulation of $\Sigma$ and consider $\partial\Sigma$ as a $1$-cycle. Then $\partial\Sigma$ is a boundary, namely the boundary of the $2$-chain given by adding up all the $2$-simplices of $\Sigma$ with compatible orientations. It follows that any map $f:\Sigma\to S^1$ maps $\partial\Sigma$ to a chain in $S^1$ that is a boundary. But this exactly means that $\deg(f)=0$, since the degree is exactly the homology class of $f_*([\partial\Sigma])$ in $H_1(S^1)\cong\mathbb{Z}$.
(More generally, without needing triangulations, it follows from the theory of Poincaré duality that if $M$ is a compact oriented $n$-manifold, the connecting homomorphism $H_n(M,\partial M)\to H_{n-1}(\partial M)$ maps the fundamental class of $(M,\partial M)$ to the fundamental class of $\partial M$. It follows that the fundamental class of $\partial M$ maps to $0$ in $H_{n-1}(M)$, i.e. it is a boundary when considered as a cycle in $M$.)