[proofplan]
We prove the decomposition by applying the Hodge-Fredholm theorem to the Hodge Laplacian on $k$-forms. This gives an $L^2$-[orthogonal projection](/theorems/437) onto harmonic forms and a Green operator whose Laplacian reconstructs the orthogonal complement of the harmonic space. Expanding the Hodge Laplacian identity
\begin{align*}
\Delta = d d^* + d^* d
\end{align*}
produces the exact and coexact pieces. Orthogonality follows from the defining adjointness of $d^*$ and from the identity
\begin{align*}
(\Delta\omega,\omega)_{L^2} = \|d\omega\|_{L^2}^2 + \|d^*\omega\|_{L^2}^2.
\end{align*}
[/proofplan]
[step:Apply the Hodge-Fredholm theorem to the Hodge Laplacian]
Fix $k \in \{0,\dots,\dim M\}$. Let
\begin{align*}
d: \Omega^k(M) &\to \Omega^{k+1}(M)
\end{align*}
denote the [exterior derivative](/theorems/1525), let
\begin{align*}
d^*: \Omega^k(M) &\to \Omega^{k-1}(M)
\end{align*}
denote its formal adjoint with respect to the $L^2$ inner product induced by $g$ and the Riemannian volume measure, and let
\begin{align*}
\Delta: \Omega^k(M) &\to \Omega^k(M), \\
\omega &\mapsto d d^*\omega + d^*d\omega
\end{align*}
be the Hodge Laplacian on $k$-forms.
Since $(M,g)$ is closed and Riemannian, the Hodge Laplacian is a self-adjoint elliptic differential operator on the compact manifold $M$. By the Hodge-Fredholm theorem for the Hodge Laplacian, there are an $L^2$-orthogonal projection
\begin{align*}
P_{\mathcal H}: \Omega^k(M) &\to \mathcal H^k(M)
\end{align*}
and a Green operator
\begin{align*}
G: \Omega^k(M) &\to \Omega^k(M)
\end{align*}
such that, for every $\omega \in \Omega^k(M)$,
\begin{align*}
\omega = P_{\mathcal H}\omega + \Delta G\omega.
\end{align*}
Elliptic regularity is part of this theorem, so $G\omega$ is smooth whenever $\omega$ is smooth.
[guided]
Fix $k \in \{0,\dots,\dim M\}$. The operators used in the decomposition must be declared on $k$-forms. The exterior derivative is the map
\begin{align*}
d: \Omega^k(M) &\to \Omega^{k+1}(M),
\end{align*}
and its formal adjoint with respect to the $L^2$ inner product induced by the Riemannian metric $g$ and the Riemannian volume measure is the map
\begin{align*}
d^*: \Omega^k(M) &\to \Omega^{k-1}(M).
\end{align*}
The Hodge Laplacian on $k$-forms is the differential operator
\begin{align*}
\Delta: \Omega^k(M) &\to \Omega^k(M), \\
\omega &\mapsto d d^*\omega + d^*d\omega.
\end{align*}
The analytic input is the Hodge-Fredholm theorem for this operator. Its hypotheses are met because $M$ is closed, hence compact without boundary, and $g$ makes the Hodge Laplacian a self-adjoint elliptic operator on smooth differential forms. The theorem gives an $L^2$-orthogonal projection
\begin{align*}
P_{\mathcal H}: \Omega^k(M) &\to \mathcal H^k(M)
\end{align*}
onto the harmonic forms and a Green operator
\begin{align*}
G: \Omega^k(M) &\to \Omega^k(M)
\end{align*}
such that every smooth $k$-form $\omega$ satisfies
\begin{align*}
\omega = P_{\mathcal H}\omega + \Delta G\omega.
\end{align*}
The elliptic regularity part of the theorem is what keeps the argument inside $\Omega^k(M)$: if $\omega$ is smooth, then $G\omega$ is smooth, so the expressions $dG\omega$ and $d^*G\omega$ are smooth forms of the required degrees.
[/guided]
[/step]
[step:Expand the Green operator identity into exact and coexact terms]
Let $\omega \in \Omega^k(M)$ and define
\begin{align*}
h &:= P_{\mathcal H}\omega \in \mathcal H^k(M), \\
\alpha &:= d^*G\omega \in \Omega^{k-1}(M), \\
\beta &:= dG\omega \in \Omega^{k+1}(M).
\end{align*}
Using the Hodge Laplacian identity
\begin{align*}
\Delta = d d^* + d^*d
\end{align*}
in the Green operator formula gives
\begin{align*}
\omega
&= h + \Delta G\omega \\
&= h + d d^*G\omega + d^*dG\omega \\
&= h + d\alpha + d^*\beta.
\end{align*}
Thus
\begin{align*}
\Omega^k(M) \subset d\Omega^{k-1}(M) + d^*\Omega^{k+1}(M) + \mathcal H^k(M).
\end{align*}
The reverse inclusion follows from the definitions of the three summands as subspaces of $\Omega^k(M)$.
[/step]
[step:Prove the exact and coexact summands are orthogonal]
Let $\eta \in \Omega^{k-1}(M)$ and $\theta \in \Omega^{k+1}(M)$. By definition of the formal adjoint $d^*$,
\begin{align*}
(d\eta, d^*\theta)_{L^2} = (d^2\eta, \theta)_{L^2}.
\end{align*}
Since $d^2 = 0$, this gives
\begin{align*}
(d\eta, d^*\theta)_{L^2} = 0.
\end{align*}
Therefore $d\Omega^{k-1}(M)$ is orthogonal to $d^*\Omega^{k+1}(M)$.
[/step]
[step:Prove harmonic forms are orthogonal to exact and coexact forms]
Let $h \in \mathcal H^k(M)$. The identity $\Delta h = 0$ and the formal adjointness of $d$ and $d^*$ give
\begin{align*}
0
&= (\Delta h,h)_{L^2} \\
&= (d d^*h,h)_{L^2} + (d^*dh,h)_{L^2} \\
&= (d^*h,d^*h)_{L^2} + (dh,dh)_{L^2} \\
&= \|d^*h\|_{L^2}^2 + \|dh\|_{L^2}^2.
\end{align*}
Both terms are non-negative, so $dh=0$ and $d^*h=0$.
If $\eta \in \Omega^{k-1}(M)$, then
\begin{align*}
(d\eta,h)_{L^2} = (\eta,d^*h)_{L^2}=0.
\end{align*}
If $\theta \in \Omega^{k+1}(M)$, then
\begin{align*}
(d^*\theta,h)_{L^2} = (\theta,dh)_{L^2}=0.
\end{align*}
Hence $\mathcal H^k(M)$ is orthogonal to both $d\Omega^{k-1}(M)$ and $d^*\Omega^{k+1}(M)$.
[guided]
Take $h \in \mathcal H^k(M)$, so by definition $\Delta h=0$. To show that $h$ is orthogonal to exact and coexact forms, we first prove the stronger identities $dh=0$ and $d^*h=0$. Using the definition of the Hodge Laplacian and the formal adjointness of $d$ and $d^*$, we compute
\begin{align*}
0
&= (\Delta h,h)_{L^2} \\
&= (d d^*h,h)_{L^2} + (d^*dh,h)_{L^2} \\
&= (d^*h,d^*h)_{L^2} + (dh,dh)_{L^2} \\
&= \|d^*h\|_{L^2}^2 + \|dh\|_{L^2}^2.
\end{align*}
Each summand is non-negative, so both must vanish. Therefore $dh=0$ and $d^*h=0$.
Now let $\eta \in \Omega^{k-1}(M)$. The exact form $d\eta$ is orthogonal to $h$ because
\begin{align*}
(d\eta,h)_{L^2} = (\eta,d^*h)_{L^2}=0.
\end{align*}
Similarly, for $\theta \in \Omega^{k+1}(M)$, the coexact form $d^*\theta$ is orthogonal to $h$ because
\begin{align*}
(d^*\theta,h)_{L^2} = (\theta,dh)_{L^2}=0.
\end{align*}
Thus harmonic forms are orthogonal to both the exact and coexact summands.
[/guided]
[/step]
[step:Use orthogonality to identify the sum as direct]
The preceding steps show that the three subspaces $d\Omega^{k-1}(M)$, $d^*\Omega^{k+1}(M)$, and $\mathcal H^k(M)$ are pairwise orthogonal in the $L^2$ inner product. If
\begin{align*}
\gamma_1 + \gamma_2 + h = 0
\end{align*}
with $\gamma_1 \in d\Omega^{k-1}(M)$, $\gamma_2 \in d^*\Omega^{k+1}(M)$, and $h \in \mathcal H^k(M)$, then taking the $L^2$ inner product with each summand gives
\begin{align*}
\|\gamma_1\|_{L^2}^2 = \|\gamma_2\|_{L^2}^2 = \|h\|_{L^2}^2 = 0.
\end{align*}
Hence $\gamma_1=0$, $\gamma_2=0$, and $h=0$. Therefore the sum is direct, and the decomposition
\begin{align*}
\Omega^k(M)=d\Omega^{k-1}(M) \oplus d^*\Omega^{k+1}(M) \oplus \mathcal H^k(M)
\end{align*}
holds with pairwise orthogonal summands.
[/step]