[proofplan]
The proof identifies the Pfaffian curvature form $\mathcal E_g\,d\operatorname{vol}_g$ with the Chern-Weil representative of the Euler class of $TM$. Since $M$ is closed and oriented, integrating its scalar density against $d\operatorname{vol}_g$ is the same as evaluating the Euler class on the fundamental class $[M]$. The zero-counting interpretation of the Euler class then identifies this evaluation with the signed index count of a transverse vector field, and the Poincare-Hopf theorem identifies that signed count with the Euler characteristic. The case $m=0$ is included separately before the positive-dimensional transversality argument.
[/proofplan]
custom_env
admin
[step:Separate the zero-dimensional case]
If $m=0$, then $M$ is a closed oriented smooth manifold of dimension $0$, hence a finite discrete set. The tangent bundle has rank $0$, the curvature Pfaffian is the degree-$0$ Euler form $1$, and the defining identity gives $\mathcal E_g=1$ on $M$. Therefore
\begin{align*}
\int_M \mathcal E_g\,d\operatorname{vol}_g=\#M=\chi(M),
\end{align*}
where $\#M$ denotes the cardinality of the finite set $M$. For the rest of the proof assume $m\ge 1$.
[/step]
custom_env
admin
[step:Interpret the Pfaffian curvature form as the Euler form of $TM$]Let $H^{2m}_{\mathrm{dR}}(M)$ denote the degree-$2m$ de Rham cohomology group of $M$, and let $e(TM)\in H^{2m}_{\mathrm{dR}}(M)$ denote the real Euler class of the oriented tangent bundle $TM\to M$.
Let $P_{SO}(TM,g)\to M$ denote the principal $SO(2m)$-bundle of positive oriented $g$-orthonormal frames of $TM$. The Levi-Civita connection $\nabla^{LC}$ is metric-compatible and preserves the orientation, so it induces a principal $SO(2m)$-connection on $P_{SO}(TM,g)$. Its curvature is represented in every local positive oriented orthonormal frame by a skew-symmetric matrix of $2$-forms, namely by the local matrix of $F_{\nabla^{LC}}$.
By [[Euler Class as the Pfaffian Chern-Weil Class](/theorems/9774)][citetheorem:9774], applied to the oriented Euclidean vector bundle $(TM,g)$ with the connection induced by $\nabla^{LC}$, the Pfaffian Chern-Weil form
\begin{align*}
\operatorname{Pf}\left(\frac{F_{\nabla^{LC}}}{2\pi}\right)\in \Omega^{2m}(M)
\end{align*}
is globally defined and represents the Euler class $e(TM)\in H^{2m}_{\mathrm{dR}}(M)$. By the definition of $\mathcal E_g:M\to\mathbb R$ in the statement, this form is $\mathcal E_g\,d\operatorname{vol}_g$. Thus
\begin{align*}
\left[\mathcal E_g\,d\operatorname{vol}_g\right]=e(TM).
\end{align*}[/step]
custom_env
admin
[guided]Let $H^{2m}_{\mathrm{dR}}(M)$ be the degree-$2m$ de Rham cohomology group of $M$, and let $e(TM)\in H^{2m}_{\mathrm{dR}}(M)$ be the real Euler class of the oriented tangent bundle $TM\to M$. The expression in the theorem is not an arbitrary matrix formula. We first explain why it is a globally defined differential form on $M$. Let $P_{SO}(TM,g)\to M$ be the bundle whose point over $p\in M$ is a positive oriented $g_p$-[orthonormal basis](/page/Orthonormal%20Basis) of $T_pM$. Because $\nabla^{LC}$ is compatible with $g$, parallel transport preserves orthonormal frames; because it is a connection on the oriented tangent bundle, it also preserves the chosen orientation. Hence $\nabla^{LC}$ gives a principal $SO(2m)$-connection on $P_{SO}(TM,g)$.
In a local positive oriented orthonormal frame, the curvature $F_{\nabla^{LC}}$ is represented by a skew-symmetric matrix of $2$-forms. The Pfaffian polynomial is invariant under orientation-preserving orthogonal changes of frame, so evaluating
\begin{align*}
\operatorname{Pf}\left(\frac{F_{\nabla^{LC}}}{2\pi}\right)
\end{align*}
in one such frame gives the same $2m$-form as evaluating it in another. This is the frame-independence encoded by Chern-Weil theory.
Now apply [Euler Class as the Pfaffian Chern-Weil Class][citetheorem:9774]. Its hypotheses are satisfied with $E=TM$: the manifold $M$ is paracompact because it is a closed smooth manifold, the tangent bundle is oriented by hypothesis, the Riemannian metric is $g$, and the connection is the metric connection $\nabla^{LC}$. With the normalization stated in the theorem, and using the statement's defining identity $\operatorname{Pf}(F_{\nabla^{LC}}/2\pi)=\mathcal E_g\,d\operatorname{vol}_g$, that result gives
\begin{align*}
\left[\mathcal E_g\,d\operatorname{vol}_g\right]=e(TM)
\end{align*}
in de Rham cohomology. This is the Chern-Weil input: it converts the analytic curvature form into the topological Euler class.[/guided]
custom_env
admin
[step:Rewrite the curvature integral as the Euler class pairing]Since $M$ is closed and oriented of dimension $2m$, it has a fundamental class $[M]$. For every smooth function $f:M\to\mathbb R$ such that the top-degree form $f\,d\operatorname{vol}_g\in\Omega^{2m}(M)$ is closed and represents a de Rham class $[f\,d\operatorname{vol}_g]\in H^{2m}_{\mathrm{dR}}(M)$, de Rham evaluation on the fundamental class is integration against the Riemannian volume measure:
\begin{align*}
\langle [f\,d\operatorname{vol}_g],[M]\rangle=\int_M f\,d\operatorname{vol}_g.
\end{align*}
Applying this to $f:=\mathcal E_g$ and using the cohomology identity from the previous step gives
\begin{align*}
\int_M \mathcal E_g\,d\operatorname{vol}_g=\langle e(TM),[M]\rangle.
\end{align*}[/step]
custom_env
admin
[guided]The previous step gave an equality of de Rham cohomology classes, not yet an equality of numbers. To turn it into a number, use the fundamental class of the closed oriented $2m$-manifold $M$. For any closed top-degree form $f\,d\operatorname{vol}_g\in\Omega^{2m}(M)$, de Rham evaluation on $[M]$ is defined by integration over $M$:
\begin{align*}
\langle [f\,d\operatorname{vol}_g],[M]\rangle=\int_M f\,d\operatorname{vol}_g.
\end{align*}
Here $f=\mathcal E_g$, and the first step proved $[\mathcal E_g\,d\operatorname{vol}_g]=e(TM)$. Substituting this class into the evaluation formula gives
\begin{align*}
\int_M \mathcal E_g\,d\operatorname{vol}_g=\langle e(TM),[M]\rangle.
\end{align*}
This is the bridge from curvature integration to topology.[/guided]
custom_env
admin
[step:Identify the Euler class pairing with the signed zero count of a transverse vector field]Choose a smooth section
\begin{align*}
X:M\to TM
\end{align*}
of the tangent bundle that is transverse to the zero section. Such a section exists by the transversality theorem for sections applied to the zero section submanifold of $TM$. Since $M$ is compact, the zero set
\begin{align*}
Z(X):=\{p\in M:X(p)=0_p\}
\end{align*}
is finite. For each $p\in Z(X)$, let $\operatorname{ind}_p(X)\in\{-1,1\}$ denote the local index determined by the orientation comparison between $T_pM$ and $T_{0_p}(T_pM)\cong T_pM$ through the derivative of $X$ transverse to the zero section.
By [[Zero-Counting Formula for the Euler Class](/theorems/9775)][citetheorem:9775], applied to the oriented rank-$2m$ vector bundle $TM\to M$ and the transverse section $X$, we have
\begin{align*}
\langle e(TM),[M]\rangle=\sum_{p\in Z(X)}\operatorname{ind}_p(X).
\end{align*}[/step]
custom_env
admin
[guided]We now replace the Euler class pairing by a concrete signed count. Choose a smooth section
\begin{align*}
X:M\to TM
\end{align*}
of the tangent bundle that is transverse to the zero section. The transversality theorem for sections supplies such an $X$ when applied to the zero section submanifold of $TM$. Since the zero section has codimension $2m$ inside $TM$ and $M$ has dimension $2m$, transversality makes the zero set
\begin{align*}
Z(X):=\{p\in M:X(p)=0_p\}
\end{align*}
a $0$-dimensional submanifold of $M$. Since $M$ is compact, this $0$-dimensional submanifold is finite.
For each $p\in Z(X)$, define $\operatorname{ind}_p(X)\in\{-1,1\}$ to be the local index determined by comparing the orientation of $T_pM$ with the fiber orientation of $T_pM$ through the derivative of $X$ normal to the zero section. The hypotheses of [Zero-Counting Formula for the Euler Class][citetheorem:9775] are satisfied: $M$ is closed and oriented, $TM\to M$ is an oriented real vector bundle of rank $\dim M=2m$, and $X$ is transverse to the zero section. Therefore
\begin{align*}
\langle e(TM),[M]\rangle=\sum_{p\in Z(X)}\operatorname{ind}_p(X).
\end{align*}[/guided]
custom_env
admin
[step:Use Poincare-Hopf to identify the signed index count with $\chi(M)$]The section $X:M\to TM$ chosen above is a smooth vector field on the closed smooth manifold $M$. Its zeros are isolated and nondegenerate because $X$ is transverse to the zero section. The local index convention used in the zero-counting formula is the same orientation-comparison convention used in the Poincare-Hopf theorem: at a nondegenerate zero $p$, both assign the sign of the derivative of $X$ as a map from $T_pM$ to the fiber $T_pM$, using the orientation of $M$ and the induced orientation of $T_pM$. By the Poincare-Hopf theorem applied to $X$,
\begin{align*}
\sum_{p\in Z(X)}\operatorname{ind}_p(X)=\chi(M).
\end{align*}
Combining this with the zero-counting formula from the previous step gives
\begin{align*}
\langle e(TM),[M]\rangle=\chi(M).
\end{align*}[/step]
custom_env
admin
[guided]The previous step converted the Euler class pairing into the signed sum of local indices of the vector field $X$. The remaining input is topological, not curvature-theoretic. Since $X:M\to TM$ is a smooth section of the tangent bundle, it is a smooth vector field. Since $X$ is transverse to the zero section, every zero is isolated and nondegenerate in the sense required for the local index appearing in Poincare-Hopf. The local index convention agrees with the one used in the zero-counting formula: at a zero $p$, the derivative of $X$ transverse to the zero section is viewed as a [linear map](/page/Linear%20Map) $T_pM\to T_pM$, and its sign is computed using the orientation of $M$ and the induced orientation of the tangent fiber. Since $M$ is closed, this finite index sum is defined globally.
The Poincare-Hopf theorem applied to this vector field gives
\begin{align*}
\sum_{p\in Z(X)}\operatorname{ind}_p(X)=\chi(M).
\end{align*}
The zero-counting formula for the Euler class gave
\begin{align*}
\langle e(TM),[M]\rangle=\sum_{p\in Z(X)}\operatorname{ind}_p(X).
\end{align*}
Substituting the Poincare-Hopf identity into this equality yields
\begin{align*}
\langle e(TM),[M]\rangle=\chi(M).
\end{align*}[/guided]
custom_env
admin
[step:Combine the Chern-Weil and index identifications]
The second step gave
\begin{align*}
\int_M \mathcal E_g\,d\operatorname{vol}_g=\langle e(TM),[M]\rangle.
\end{align*}
The fourth step gave
\begin{align*}
\langle e(TM),[M]\rangle=\chi(M).
\end{align*}
Therefore
\begin{align*}
\int_M \mathcal E_g\,d\operatorname{vol}_g=\chi(M).
\end{align*}
Since $\operatorname{Pf}(F_{\nabla^{LC}}/2\pi)=\mathcal E_g\,d\operatorname{vol}_g$ by definition, this is the asserted Gauss-Bonnet-Chern formula.
[/step]