Solution (source code)

= Solution

Let $M$ be a compact <Riemannian manifold> without boundary. Let $\delta=d^*$ be the formal $L^2$ <adjoint operator> of the <exterior derivative>, and let $\Delta_H=d\delta+\delta d$ be the <Hodge Laplacian>. Write $\mathcal H^r(M)=\ker\Delta_H\cap\Omega^r(M)$ for the smooth <harmonic differential forms>. The <Hodge decomposition theorem> states that this space is finite-dimensional and
$$
\boxed{\Omega^r(M)=\mathcal H^r(M)\oplus d\Omega^{r-1}(M)\oplus\delta\Omega^{r+1}(M),}
$$
an $L^2$-orthogonal direct sum. Thus every smooth $r$-form is uniquely the sum of a harmonic, an exact and a coexact form; its exact and coexact components are unique, though the primitives used to write those components need not be unique. Also
$$
\boxed{\mathcal H^r(M)\cong H^r_{\mathrm{dR}}(M;\mathbb R),\qquad
\dim\mathcal H^r(M)=b_r(M).}
$$
The isomorphism sends a <harmonic form> to its <de Rham cohomology> class. For example, a closed coexact component $\delta\gamma$ must vanish because $\|\delta\gamma\|^2=\langle\gamma,d\delta\gamma\rangle=0$; an exact <harmonic form> also vanishes by orthogonality. These facts explain uniqueness of the harmonic representative of a <cohomology class>.

On an oriented $n$-manifold the <codifferential> is $\delta=(-1)^{n(r+1)+1}*d*$ on $r$-forms. The general formulation above also holds on nonorientable <Riemannian manifolds>: use the globally defined Riemannian volume density for the $L^2$ inner product and its formal adjoint, rather than require a global ordinary volume form. The closed-manifold hypothesis is essential unless suitable boundary conditions are added.