[proofplan]
We first use the descent property of Chern-Weil forms: the curvature of a principal connection is horizontal and equivariant, so an invariant polynomial evaluated on it is basic and therefore descends uniquely to the base. The descended form is closed by the closedness theorem for descended Chern-Weil forms. Connection independence follows by applying the Chern-Weil transgression formula to an affine path between two connections. Finally, linearity and multiplicativity follow from the multilinear evaluation convention for invariant polynomials on curvature forms, with polynomial degree doubled because curvature has form degree $2$.
[/proofplan]
[step:Descend invariant curvature polynomials to forms on the base]
Fix an integer $k\ge 0$, fix $\Phi\in I^k(G)$, and let $A\in\Omega^1(P;\mathfrak g)$ be a principal connection with curvature form $F_A\in\Omega^2(P;\mathfrak g)$. For $k\ge 1$, the Chern-Weil evaluation $\Phi(F_A)\in\Omega^{2k}(P)$ means the scalar differential form obtained by applying the symmetric $k$-linear form $\Phi:\mathfrak g^k\to\mathbb R$ to $k$ copies of the $\mathfrak g$-valued $2$-form $F_A$, using the standard alternating product convention for vector-valued forms. For $k=0$, an element of $I^0(G)=\mathbb R$ is interpreted as the corresponding constant $0$-form.
Since $\Phi$ is $\operatorname{Ad}$-invariant and $F_A$ is the curvature of a principal connection, [citetheorem:9762] applies to the principal $G$-bundle $\pi:P\to M$, the connection $A$, its curvature $F_A$, and the invariant polynomial $\Phi$. Therefore $\Phi(F_A)$ is basic on $P$, so there is a unique differential form $\Phi(F_A)_M\in\Omega^{2k}(M)$ satisfying
\begin{align*}
\pi^*\Phi(F_A)_M=\Phi(F_A).
\end{align*}
This is precisely the descended form appearing in the statement.
[/step]
[step:Use closedness of descended Chern-Weil forms]
The hypotheses of [citetheorem:9763] are satisfied by the same principal bundle $\pi:P\to M$, the same connection $A$, the same curvature form $F_A$, and the invariant polynomial $\Phi\in I^k(G)$. The preceding step supplies the descended form $\Phi(F_A)_M\in\Omega^{2k}(M)$. Hence
\begin{align*}
d\Phi(F_A)_M=0.
\end{align*}
Thus $\Phi(F_A)_M$ determines a de Rham cohomology class
\begin{align*}
[\Phi(F_A)_M]\in H^{2k}_{\mathrm{dR}}(M).
\end{align*}
[guided]
At this point the only remaining issue for defining a de Rham class is closedness. The descended form $\Phi(F_A)_M$ already exists by the previous step, but a differential form represents a de Rham cohomology class only when its [exterior derivative](/theorems/1525) vanishes.
We apply [citetheorem:9763]. Its hypotheses require a smooth principal $G$-bundle $\pi:P\to M$, a principal connection $A\in\Omega^1(P;\mathfrak g)$, its curvature form $F_A\in\Omega^2(P;\mathfrak g)$, and an invariant polynomial $\Phi\in I^k(G)$ whose Chern-Weil expression descends to the base. These are exactly the objects fixed here: $P\to M$ is the given principal bundle, $A$ is the chosen connection, $F_A$ is its curvature, $\Phi$ lies in $I^k(G)$ by assumption, and the descent was established in the preceding step. Therefore the theorem gives
\begin{align*}
d\Phi(F_A)_M=0.
\end{align*}
This closedness is the point where the Bianchi identity and $\operatorname{Ad}$-invariance are consumed: they are packaged inside the closedness theorem for descended Chern-Weil forms. Since $\Phi(F_A)_M$ is closed, it defines the de Rham cohomology class
\begin{align*}
[\Phi(F_A)_M]\in H^{2k}_{\mathrm{dR}}(M).
\end{align*}
[/guided]
[/step]
[step:Compare the forms obtained from two choices of connection]
Let $A_0,A_1\in\Omega^1(P;\mathfrak g)$ be two principal connections on $P$, and let $F_{A_0},F_{A_1}\in\Omega^2(P;\mathfrak g)$ denote their curvature forms. By [citetheorem:9764], applied to $A_0$, $A_1$, and $\Phi\in I^k(G)$, the descended Chern-Weil forms satisfy
\begin{align*}
\Phi(F_{A_1})_M-\Phi(F_{A_0})_M=d\Theta
\end{align*}
for some differential form $\Theta\in\Omega^{2k-1}(M)$ when $k\ge 1$. For $k=0$, both descended forms are the same constant $0$-form $\Phi$, so the same cohomology conclusion holds.
Therefore
\begin{align*}
[\Phi(F_{A_1})_M]=[\Phi(F_{A_0})_M]\in H^{2k}_{\mathrm{dR}}(M).
\end{align*}
The class $[\Phi(F_A)_M]$ is independent of the chosen principal connection $A$.
[/step]
[step:Define the Chern-Weil map independently of auxiliary choices]
Because $P$ admits at least one principal connection, choose one such connection $A$ and define, for each homogeneous $\Phi\in I^k(G)$,
\begin{align*}
\operatorname{cw}_P(\Phi):=[\Phi(F_A)_M]\in H^{2k}_{\mathrm{dR}}(M).
\end{align*}
The previous step shows that replacing $A$ by any other principal connection gives the same cohomology class. Hence $\operatorname{cw}_P$ is well-defined on every homogeneous summand $I^k(G)$. Extending by finite sums defines a map
\begin{align*}
\operatorname{cw}_P:I(G)\to H^{\mathrm{even}}_{\mathrm{dR}}(M).
\end{align*}
Since an element of $I^k(G)$ is evaluated on $k$ copies of the curvature $2$-form, its image lies in $H^{2k}_{\mathrm{dR}}(M)$.
[/step]
[step:Verify additivity and scalar compatibility]
Let $k\ge 0$, let $\Phi,\Psi\in I^k(G)$, and let $a,b\in\mathbb R$. The Chern-Weil evaluation is linear in the invariant polynomial, so
\begin{align*}
(a\Phi+b\Psi)(F_A)_M=a\Phi(F_A)_M+b\Psi(F_A)_M.
\end{align*}
Passing to de Rham cohomology gives
\begin{align*}
\operatorname{cw}_P(a\Phi+b\Psi)=a\operatorname{cw}_P(\Phi)+b\operatorname{cw}_P(\Psi).
\end{align*}
For inhomogeneous elements of $I(G)$, the same identity follows by applying this argument separately to each homogeneous component. Thus $\operatorname{cw}_P$ is a graded [linear map](/page/Linear%20Map).
[/step]
[step:Verify multiplicativity from the product convention for invariant polynomials]
Let $\Phi\in I^k(G)$ and $\Psi\in I^\ell(G)$. The product $\Phi\Psi\in I^{k+\ell}(G)$ is the invariant polynomial whose Chern-Weil evaluation is defined by the convention
\begin{align*}
(\Phi\Psi)(F_A)_M=\Phi(F_A)_M\wedge\Psi(F_A)_M.
\end{align*}
Because both $\Phi(F_A)_M$ and $\Psi(F_A)_M$ are closed, the de Rham cup product is represented by the wedge product of these closed differential forms. Therefore
\begin{align*}
\operatorname{cw}_P(\Phi\Psi)=[(\Phi\Psi)(F_A)_M]=[\Phi(F_A)_M\wedge\Psi(F_A)_M]=[\Phi(F_A)_M]\smile[\Psi(F_A)_M].
\end{align*}
Hence
\begin{align*}
\operatorname{cw}_P(\Phi\Psi)=\operatorname{cw}_P(\Phi)\smile\operatorname{cw}_P(\Psi).
\end{align*}
The unit in $I^0(G)=\mathbb R$ is the constant polynomial $1$, whose descended form is the constant $0$-form $1$ on $M$, so $\operatorname{cw}_P(1)=1\in H^0_{\mathrm{dR}}(M)$. Thus $\operatorname{cw}_P$ is a unital graded algebra homomorphism, and the grading statement follows from the assignment $I^k(G)\to H^{2k}_{\mathrm{dR}}(M)$ proved above.
[/step]