# Is (Local) Gauss-Bonnet theorem defined only for surfaces in $\mathbb{R^2}$ and $\mathbb{R^3}$

Is the local version of Gauss-Bonnet theorem applies only to surfaces in $\mathbb{R^2}$ and $\mathbb{R^3}$ ? I read the proof given in Do-Carmo and I sort of got the idea that the surface $S$ is basically either in $\mathbb{R^2}$ or in $\mathbb{R^3}$ due to the choice of parametrization.

No, the theorem applies generally to any compact surface with boundary equipped with a Riemannian metric. Indeed, there is also the Chern-Gauss-Bonnet Theorem for compact Riemannian $2n$-manifolds with boundary.