Artificial intelligent assistant

How does the Chern number relate to the Gauss-Bonnet theorem? I am a physicist so I am sorry if my question is not rigorous enough. We use the concept of a topological invariant named Chern number, and it is an integer. I have seen people relating it to the Euler characteristic. They say that it has to do with the generalization of the Gauss-Bonnet theorem, namely the Gauss-Bonnet-Chern theorem although I can't see exactly how. How can one go from the Gauss-Bonnet-Chern theorem, if we apply it to a 2D manifold, to the classic Gauss-Bonnet theorem?

Given a (compact) $2k$-dimensional Riemannian manifold $M$ (with no boundary) and associated Riemannian curvature $2$-form $\Omega = (\Omega_{ij})$, the Euler form is given by 0 $$e(\Omega) = \frac{(-1)^k}{(2\pi)^k} \text{Pf}(\Omega)$$ and the Chern-Gauss-Bonnet Theorem states that $\displaystyle\int_M e(\Omega) = \chi(M)$.

The Pfaffian $\text{Pf}(\Omega)$ is usually defined by $$\text{Pf}(\Omega) = \frac 1{2^kk!}\sum \epsilon_{i_1i_2\dots i_{2k}} \Omega_{i_1i_2}\wedge\dots\wedge\Omega_{i_{2k-1}i_{2k}}.$$ This arises naturally from invariant theory because for a skew-symmetric $2k\times 2k$ matrix $X$ we have $\text{Pf}(X)^2 = \det X$. Now note that when $k=1$, this formula reduces to $$\text{Pf}(\Omega) = \frac12 \sum\epsilon_{ij}\Omega_{ij} = \Omega_{12} = -K\,dA.$$ Then we get $$\chi(M) = -\frac1{2\pi}\int_M\Omega_{12} = \frac1{2\pi}\int_M K\,dA.$$

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy 694c1c7b1519662b2192dc8d25846d34