[proofplan]
We prove the statement by reducing Pontryagin forms to Chern forms on the complexified bundle. The defining convention gives $p_k(\nabla)=(-1)^k c_{2k}(\nabla^{\mathbb C})$, so closedness follows from the Chern-Weil [closedness of Chern forms](/theorems/7040), with the degree-zero and above-rank conventions handled separately when needed. For $k=0$, the form is the constant form $1$, so the exactness assertion is immediate. For $k\ge 1$, we connect two connections by the affine path $\nabla_t=(1-t)\nabla_0+t\nabla_1$, complexify this path, and apply the [Chern-Weil homotopy formula](/theorems/9760) to show that the difference of the corresponding Chern forms is exact.
[/proofplan]
custom_env
admin
[step:Pass from the real connection to the complexified Chern form]Let $\nabla$ be a smooth connection on $E$. Write $\Gamma(E)$ for the real [vector space](/page/Vector%20Space) of smooth sections of $E\to M$, and write $\Gamma(E_{\mathbb C})$ for the complex vector space of smooth sections of $E_{\mathbb C}\to M$. Write $\Omega^1(M;E)$ for the real vector space of smooth $E$-valued one-forms on $M$, and write $\Omega^1(M;E_{\mathbb C})$ for the complex vector space of smooth $E_{\mathbb C}$-valued one-forms on $M$. The complexification of $\nabla$ is the complex-linear connection
\begin{align*}
\nabla^{\mathbb C}:\Gamma(E_{\mathbb C})\to \Omega^1(M;E_{\mathbb C})
\end{align*}
defined on elementary sections by
\begin{align*}
\nabla^{\mathbb C}(s\otimes z):=(\nabla s)\otimes z
\end{align*}
for every $s\in \Gamma(E)$ and every $z\in \mathbb C$, extended $\mathbb C$-linearly and by the Leibniz rule. By the convention in the statement, the Pontryagin form of $\nabla$ is
\begin{align*}
p_k(\nabla)=(-1)^k c_{2k}(\nabla^{\mathbb C}).
\end{align*}
Since $E_{\mathbb C}\to M$ is a smooth complex vector bundle of rank $r$ and $\nabla^{\mathbb C}$ is a smooth complex-linear connection on it, the [Chern-Weil construction of Chern classes](/theorems/9769) applies to $\nabla^{\mathbb C}$ in degrees $0\le j\le r$. If $2k\le r$, then by [citetheorem:9769], the Chern-Weil form $c_{2k}(\nabla^{\mathbb C})$ is closed. If $2k>r$, then $c_{2k}(\nabla^{\mathbb C})=0$ by the convention in the statement, and it is closed. Therefore
\begin{align*}
d p_k(\nabla)=d\left((-1)^k c_{2k}(\nabla^{\mathbb C})\right)=(-1)^k d c_{2k}(\nabla^{\mathbb C})=0.
\end{align*}
Thus $p_k(\nabla)$ is closed.[/step]
custom_env
admin
[guided]We start by translating the Pontryagin form into a Chern form, because the available [Chern-Weil closedness theorem](/theorems/7039) is stated for complex vector bundles. The complexified bundle is
\begin{align*}
E_{\mathbb C}:=E\otimes_{\mathbb R}\mathbb C.
\end{align*}
Here $\Gamma(E_{\mathbb C})$ denotes the complex vector space of smooth sections of $E_{\mathbb C}\to M$, and $\Omega^1(M;E_{\mathbb C})$ denotes the complex vector space of smooth $E_{\mathbb C}$-valued one-forms on $M$. A real connection $\nabla$ on $E$ induces a complex-linear connection
\begin{align*}
\nabla^{\mathbb C}:\Gamma(E_{\mathbb C})\to \Omega^1(M;E_{\mathbb C})
\end{align*}
by the rule
\begin{align*}
\nabla^{\mathbb C}(s\otimes z):=(\nabla s)\otimes z
\end{align*}
for $s\in \Gamma(E)$ and $z\in \mathbb C$, followed by $\mathbb C$-linear extension. This is a connection because $\nabla$ satisfies the Leibniz rule over real-valued smooth functions, and the extension makes the same Leibniz rule hold over complex-valued smooth functions.
The definition of the Pontryagin form used here is
\begin{align*}
p_k(\nabla)=(-1)^k c_{2k}(\nabla^{\mathbb C}).
\end{align*}
So proving that $p_k(\nabla)$ is closed is exactly the same as proving that the Chern form $c_{2k}(\nabla^{\mathbb C})$ is closed, up to multiplication by the constant scalar $(-1)^k$.
Now we verify the hypotheses of the cited Chern-Weil construction. The bundle $E_{\mathbb C}\to M$ is a smooth complex vector bundle of rank $r$, and $\nabla^{\mathbb C}$ is a smooth complex-linear connection on it. If $2k\le r$, then [citetheorem:9769] applies and gives that the Chern-Weil form $c_{2k}(\nabla^{\mathbb C})$ is closed. If $2k>r$, then the statement convention gives $c_{2k}(\nabla^{\mathbb C})=0$, so it is closed without invoking the theorem outside its rank range. Hence
\begin{align*}
d p_k(\nabla)=d\left((-1)^k c_{2k}(\nabla^{\mathbb C})\right)=(-1)^k d c_{2k}(\nabla^{\mathbb C})=0.
\end{align*}
This proves the closedness of the Pontryagin form.[/guided]
custom_env
admin
[step:Handle the degree-zero Pontryagin form directly]
Assume $k=0$. By the convention in the statement,
\begin{align*}
p_0(\nabla)=c_0(\nabla^{\mathbb C})=1
\end{align*}
for every smooth connection $\nabla$ on $E$, where $1\in \Omega^0(M;\mathbb C)$ denotes the constant function with value $1$. Hence $d p_0(\nabla)=d1=0$. If $\nabla_0$ and $\nabla_1$ are two smooth connections on $E$, then
\begin{align*}
p_0(\nabla_0)-p_0(\nabla_1)=1-1=0.
\end{align*}
Thus the two degree-zero representatives are equal, so they define the same class in $H^0_{\mathrm{dR}}(M;\mathbb C)$. Therefore the theorem is proved when $k=0$.
[/step]
custom_env
admin
[step:Connect two real connections by an affine path]
Assume for the rest of the proof that $k\ge 1$. Let $\nabla_0$ and $\nabla_1$ be smooth connections on $E$. Let $\operatorname{End}_{\mathbb R}(E)\to M$ denote the smooth real vector bundle whose fiber over $x\in M$ is the real vector space $\operatorname{End}_{\mathbb R}(E_x)$ of real-linear endomorphisms of $E_x$. Define the difference tensor
\begin{align*}
A:=\nabla_1-\nabla_0\in \Omega^1(M;\operatorname{End}_{\mathbb R}(E)).
\end{align*}
For each $t\in [0,1]$, define
\begin{align*}
\nabla_t:\Gamma(E)&\to \Omega^1(M;E)
\end{align*}
by
\begin{align*}
\nabla_t:=\nabla_0+tA.
\end{align*}
Because $A$ is $C^\infty(M;\mathbb R)$-linear in the section variable, $\nabla_t$ satisfies the Leibniz rule and is a smooth connection on $E$. Its complexification is
\begin{align*}
\nabla_t^{\mathbb C}=(1-t)\nabla_0^{\mathbb C}+t\nabla_1^{\mathbb C}.
\end{align*}
Thus $(\nabla_t^{\mathbb C})_{t\in[0,1]}$ is a smooth affine path of complex-linear connections on $E_{\mathbb C}$ from $\nabla_0^{\mathbb C}$ to $\nabla_1^{\mathbb C}$.
[/step]
custom_env
admin
[step:Apply the Chern-Weil homotopy formula to the complexified path]
If $2k>r$, then the convention in the statement gives
\begin{align*}
c_{2k}(\nabla_0^{\mathbb C})=c_{2k}(\nabla_1^{\mathbb C})=0,
\end{align*}
so their difference is exact. Assume now that $2k\le r$. Since $k\ge 1$, the degree $4k-1$ is nonnegative. Apply the Chern-Weil homotopy formula [citetheorem:9760] to the smooth complex vector bundle $E_{\mathbb C}\to M$, the two complex-linear connections $\nabla_0^{\mathbb C}$ and $\nabla_1^{\mathbb C}$, and the Chern polynomial defining $c_{2k}$. Its hypotheses are satisfied by the affine path constructed above. Therefore there exists a smooth form
\begin{align*}
T_{2k}(\nabla_0^{\mathbb C},\nabla_1^{\mathbb C})\in \Omega^{4k-1}(M;\mathbb C)
\end{align*}
such that
\begin{align*}
dT_{2k}(\nabla_0^{\mathbb C},\nabla_1^{\mathbb C})=c_{2k}(\nabla_1^{\mathbb C})-c_{2k}(\nabla_0^{\mathbb C}).
\end{align*}
Equivalently,
\begin{align*}
c_{2k}(\nabla_0^{\mathbb C})-c_{2k}(\nabla_1^{\mathbb C})=-dT_{2k}(\nabla_0^{\mathbb C},\nabla_1^{\mathbb C}).
\end{align*}
[/step]
custom_env
admin
[step:Multiply the exact Chern-form difference by the Pontryagin sign]
Using the defining convention for Pontryagin forms, we compute
\begin{align*}
p_k(\nabla_0)-p_k(\nabla_1)=(-1)^k c_{2k}(\nabla_0^{\mathbb C})-(-1)^k c_{2k}(\nabla_1^{\mathbb C}).
\end{align*}
Hence
\begin{align*}
p_k(\nabla_0)-p_k(\nabla_1)=(-1)^k\left(c_{2k}(\nabla_0^{\mathbb C})-c_{2k}(\nabla_1^{\mathbb C})\right).
\end{align*}
Substituting the homotopy formula gives
\begin{align*}
p_k(\nabla_0)-p_k(\nabla_1)=(-1)^{k+1}dT_{2k}(\nabla_0^{\mathbb C},\nabla_1^{\mathbb C}).
\end{align*}
Since exterior differentiation is linear over constants,
\begin{align*}
p_k(\nabla_0)-p_k(\nabla_1)=d\left((-1)^{k+1}T_{2k}(\nabla_0^{\mathbb C},\nabla_1^{\mathbb C})\right).
\end{align*}
Therefore $p_k(\nabla_0)-p_k(\nabla_1)$ is exact.
[/step]
custom_env
admin
[step:Conclude that the Pontryagin class is independent of the connection]
Assume $k\ge 1$, since the case $k=0$ was handled directly. Let $\nabla_0$ and $\nabla_1$ be any two smooth connections on $E$. The previous step shows that their Pontryagin forms differ by an exact form:
\begin{align*}
p_k(\nabla_0)-p_k(\nabla_1)=d\left((-1)^{k+1}T_{2k}(\nabla_0^{\mathbb C},\nabla_1^{\mathbb C})\right).
\end{align*}
Therefore they define the same class in de Rham cohomology:
\begin{align*}
[p_k(\nabla_0)]=[p_k(\nabla_1)]\in H^{4k}_{\mathrm{dR}}(M;\mathbb C).
\end{align*}
Since the connection was arbitrary, the class
\begin{align*}
p_k(E):=[p_k(\nabla)]
\end{align*}
is well-defined independently of $\nabla$. This completes the proof.
[/step]