We invoke the classical fact that the algebra of bi-invariant forms on a compact connected Lie group G is naturally isomorphic to the de Rham cohomology H*dR(G) itself. Then, we show that when a flat connection A exists on a principal G-bundle P, we may construct a homomorphism EA: H*dR(G)→H*dR(P), which eventually shows that the bundle satisfies a condition for the Leray–Hirsch theorem. A similar argument is shown to apply to its adjoint bundle. As a corollary, we show that that both the flat principal bundle and its adjoint bundle have the real coefficient cohomology isomorphic to that of the trivial bundle.