[proofplan]
Throughout the proof $n\geq 1$, as assumed in the theorem statement. We use the two-sheeted covering map $q:S^n \to \mathbb{R}P^n$ and compare differential forms on $\mathbb{R}P^n$ with antipodal-invariant differential forms on $S^n$. The pullback $q^*$ identifies the de Rham complex of $\mathbb{R}P^n$ with the invariant subcomplex for the deck group $\{\operatorname{id}_{S^n}, a\}$, where $a:S^n \to S^n$ is the antipodal map. Averaging over this finite group shows that the cohomology of the invariant subcomplex is the invariant part of $H^\bullet_{\mathrm{dR}}(S^n)$. The known de Rham cohomology of the sphere and the fact that the antipodal map has degree $(-1)^{n+1}$ then give exactly the stated groups.
[/proofplan]
[step:Identify forms on $\mathbb{R}P^n$ with antipodal-invariant forms on $S^n$]
Let
\begin{align*}
q:S^n &\to \mathbb{R}P^n
\end{align*}
be the smooth quotient map sending a point $x \in S^n$ to the line $[x] \in \mathbb{R}P^n$. We use the standard smooth structure on $\mathbb{R}P^n$ for which $q$ is a smooth two-sheeted covering map. In particular, every evenly covered [open set](/page/Open%20Set) admits smooth local sections of $q$. Let
\begin{align*}
a:S^n &\to S^n,\\
x &\mapsto -x
\end{align*}
be the antipodal map. The deck transformation group of $q$ is
\begin{align*}
G:=\{\operatorname{id}_{S^n},a\}.
\end{align*}
For each $k \in \{0,\dots,n\}$, define the invariant subspace
\begin{align*}
\Omega^k(S^n)^G:=\{\alpha \in \Omega^k(S^n): a^*\alpha=\alpha\}.
\end{align*}
We claim that pullback by $q$ gives an isomorphism of cochain complexes
\begin{align*}
q^*:\Omega^\bullet(\mathbb{R}P^n) &\longrightarrow \Omega^\bullet(S^n)^G.
\end{align*}
First, if $\omega \in \Omega^k(\mathbb{R}P^n)$, then
\begin{align*}
a^*q^*\omega=(q\circ a)^*\omega=q^*\omega,
\end{align*}
because $q\circ a=q$. Hence $q^*\omega$ is $G$-invariant.
Conversely, let $\alpha \in \Omega^k(S^n)^G$. For each point $p \in \mathbb{R}P^n$, choose an open neighbourhood $U_p \subset \mathbb{R}P^n$ evenly covered by $q$, and choose one sheet
\begin{align*}
s_p:U_p &\to S^n
\end{align*}
of the covering map, so that $q\circ s_p=\operatorname{id}_{U_p}$. Define a local $k$-form
\begin{align*}
\omega_p \in \Omega^k(U_p)
\end{align*}
by
\begin{align*}
\omega_p:=s_p^*\alpha.
\end{align*}
If $s_p'$ is the other local sheet over $U_p$, then $s_p'=a\circ s_p$, and therefore
\begin{align*}
(s_p')^*\alpha=s_p^*a^*\alpha=s_p^*\alpha,
\end{align*}
because $\alpha$ is $G$-invariant. Thus the definition is independent of the chosen sheet. On an overlap $U_p\cap U_r$, let $y\in U_p\cap U_r$. The two points $s_p(y)$ and $s_r(y)$ lie in the fibre $q^{-1}(y)$, so either $s_r(y)=s_p(y)$ or $s_r(y)=a(s_p(y))$. Since $U_p\cap U_r$ is open and the two sheets over it are disjoint open subsets of $q^{-1}(U_p\cap U_r)$, this alternative is locally constant. Therefore on each connected component $V$ of $U_p\cap U_r$ we have either $s_r|_V=s_p|_V$ or $s_r|_V=a\circ s_p|_V$. In the first case $s_r^*\alpha=s_p^*\alpha$ on $V$, and in the second case
\begin{align*}
s_r^*\alpha=s_p^*a^*\alpha=s_p^*\alpha
\end{align*}
on $V$. Hence $\omega_p$ and $\omega_r$ agree on $U_p\cap U_r$, so the local forms glue to a unique form
\begin{align*}
\omega \in \Omega^k(\mathbb{R}P^n)
\end{align*}
with $q^*\omega=\alpha$. This proves surjectivity. Injectivity follows because $q$ is surjective: if $q^*\omega=0$, then for every local section $s_p:U_p\to S^n$,
\begin{align*}
\omega|_{U_p}=s_p^*q^*\omega=0.
\end{align*}
Hence $\omega=0$.
Finally, pullback commutes with exterior differentiation:
\begin{align*}
d(q^*\omega)=q^*(d\omega)
\end{align*}
for every $\omega \in \Omega^\bullet(\mathbb{R}P^n)$. Therefore $q^*$ is an isomorphism of cochain complexes, and hence
\begin{align*}
H^k_{\mathrm{dR}}(\mathbb{R}P^n)\cong H^k(\Omega^\bullet(S^n)^G,d)
\end{align*}
for every $k$.
[guided]
The quotient map $q:S^n\to \mathbb{R}P^n$ identifies two points of the sphere exactly when they differ by the antipodal map. We use the standard smooth structure on $\mathbb{R}P^n$ for which
\begin{align*}
q:S^n&\to \mathbb{R}P^n
\end{align*}
is a smooth two-sheeted covering map. Thus every evenly covered open set admits smooth local sections of $q$, and a differential form on $\mathbb{R}P^n$ should pull back to a form on $S^n$ that cannot distinguish $x$ from $-x$.
Let
\begin{align*}
a:S^n &\to S^n,\\
x &\mapsto -x
\end{align*}
be the antipodal map, and let
\begin{align*}
G:=\{\operatorname{id}_{S^n},a\}
\end{align*}
be the deck transformation group of the covering $q:S^n\to \mathbb{R}P^n$. For each degree $k$, define
\begin{align*}
\Omega^k(S^n)^G:=\{\alpha \in \Omega^k(S^n): a^*\alpha=\alpha\}.
\end{align*}
We first show that pullback lands in this invariant space. If $\omega \in \Omega^k(\mathbb{R}P^n)$, then
\begin{align*}
a^*q^*\omega=(q\circ a)^*\omega=q^*\omega,
\end{align*}
because $q(a(x))=q(x)$ for every $x\in S^n$. Therefore $q^*\omega$ is invariant under $a$.
Now suppose conversely that $\alpha \in \Omega^k(S^n)^G$. We want to descend $\alpha$ to the quotient. Since $q$ is a covering map, every point $p\in \mathbb{R}P^n$ has an open neighbourhood $U_p$ over which $q$ admits local sections. Choose one such section
\begin{align*}
s_p:U_p &\to S^n
\end{align*}
with $q\circ s_p=\operatorname{id}_{U_p}$, and define
\begin{align*}
\omega_p:=s_p^*\alpha \in \Omega^k(U_p).
\end{align*}
The possible ambiguity is the choice of sheet. The other sheet is $a\circ s_p$, and because $\alpha$ is invariant,
\begin{align*}
(a\circ s_p)^*\alpha=s_p^*a^*\alpha=s_p^*\alpha.
\end{align*}
Thus the local form $\omega_p$ is independent of which sheet was chosen. Now consider an overlap $U_p\cap U_r$. For a point $y\in U_p\cap U_r$, the two chosen lifts $s_p(y)$ and $s_r(y)$ lie in the same two-point fibre $q^{-1}(y)$, so either $s_r(y)=s_p(y)$ or $s_r(y)=a(s_p(y))$. Because the two sheets over an evenly covered open set are disjoint open subsets of the preimage, this choice is locally constant in $y$. Hence on each connected component $V$ of $U_p\cap U_r$ we have either $s_r|_V=s_p|_V$ or $s_r|_V=a\circ s_p|_V$. In the first case the two local forms agree directly. In the second case the invariance of $\alpha$ gives
\begin{align*}
s_r^*\alpha=s_p^*a^*\alpha=s_p^*\alpha
\end{align*}
on $V$. Therefore $\omega_p$ and $\omega_r$ agree on every connected component of $U_p\cap U_r$, hence on the whole overlap. The local forms glue to a unique global form
\begin{align*}
\omega \in \Omega^k(\mathbb{R}P^n)
\end{align*}
satisfying $q^*\omega=\alpha$.
This proves that every invariant form descends. Pullback is injective because $q$ is surjective: if $q^*\omega=0$, then on every evenly covered neighbourhood $U_p$ with local section $s_p$,
\begin{align*}
\omega|_{U_p}=s_p^*q^*\omega=0.
\end{align*}
The neighbourhoods $U_p$ cover $\mathbb{R}P^n$, so $\omega=0$.
Since exterior differentiation commutes with pullback,
\begin{align*}
d(q^*\omega)=q^*(d\omega),
\end{align*}
this is not merely an isomorphism of vector spaces in each degree; it is an isomorphism of cochain complexes:
\begin{align*}
q^*:\Omega^\bullet(\mathbb{R}P^n)\to \Omega^\bullet(S^n)^G.
\end{align*}
Therefore
\begin{align*}
H^k_{\mathrm{dR}}(\mathbb{R}P^n)\cong H^k(\Omega^\bullet(S^n)^G,d)
\end{align*}
for every $k$.
[/guided]
[/step]
[step:Identify the invariant complex cohomology with invariant sphere cohomology]
Let
\begin{align*}
i:\Omega^\bullet(S^n)^G &\hookrightarrow \Omega^\bullet(S^n)
\end{align*}
be the inclusion of cochain complexes. We show that the induced map identifies
\begin{align*}
H^k(\Omega^\bullet(S^n)^G,d)
\end{align*}
with the invariant subspace
\begin{align*}
H^k_{\mathrm{dR}}(S^n)^G:=\{[\alpha]\in H^k_{\mathrm{dR}}(S^n):a^*[\alpha]=[\alpha]\}.
\end{align*}
First, if $\alpha \in \Omega^k(S^n)^G$ is closed and represents zero in $H^k_{\mathrm{dR}}(S^n)$, then there exists $\beta \in \Omega^{k-1}(S^n)$ with $\alpha=d\beta$. Define the averaged primitive
\begin{align*}
\overline{\beta}:=\frac{1}{2}\left(\beta+a^*\beta\right)\in \Omega^{k-1}(S^n).
\end{align*}
Then $a^*\overline{\beta}=\overline{\beta}$, so $\overline{\beta}\in \Omega^{k-1}(S^n)^G$, and
\begin{align*}
d\overline{\beta}
&=\frac{1}{2}\left(d\beta+d(a^*\beta)\right)\\
&=\frac{1}{2}\left(\alpha+a^*d\beta\right)\\
&=\frac{1}{2}\left(\alpha+a^*\alpha\right)\\
&=\alpha.
\end{align*}
Thus $i^*$ is injective on cohomology.
Second, let $[\alpha]\in H^k_{\mathrm{dR}}(S^n)^G$, where $\alpha\in\Omega^k(S^n)$ is closed. Define the averaged closed form
\begin{align*}
\overline{\alpha}:=\frac{1}{2}\left(\alpha+a^*\alpha\right)\in \Omega^k(S^n).
\end{align*}
Then $a^*\overline{\alpha}=\overline{\alpha}$, and
\begin{align*}
d\overline{\alpha}
=\frac{1}{2}\left(d\alpha+d(a^*\alpha)\right)
=\frac{1}{2}\left(d\alpha+a^*d\alpha\right)
=0.
\end{align*}
Since $[\alpha]$ is $G$-invariant, $[a^*\alpha]=[\alpha]$, and hence
\begin{align*}
[\overline{\alpha}]
=\frac{1}{2}\left([\alpha]+[a^*\alpha]\right)
=[\alpha].
\end{align*}
Therefore every invariant cohomology class has an invariant closed representative. Thus
\begin{align*}
H^k(\Omega^\bullet(S^n)^G,d)\cong H^k_{\mathrm{dR}}(S^n)^G.
\end{align*}
[guided]
The subtle point is that taking cohomology and taking invariants do not automatically commute for arbitrary group actions. Here they do because the group is finite and we can average.
Let
\begin{align*}
i:\Omega^\bullet(S^n)^G &\hookrightarrow \Omega^\bullet(S^n)
\end{align*}
be the inclusion. We prove that $i$ induces an isomorphism from the cohomology of invariant forms onto the invariant part of the ordinary cohomology of $S^n$.
For injectivity, suppose $\alpha\in \Omega^k(S^n)^G$ is closed and becomes exact in the full de Rham complex. Thus there exists a form
\begin{align*}
\beta\in \Omega^{k-1}(S^n)
\end{align*}
such that $\alpha=d\beta$. The primitive $\beta$ need not be invariant, so we replace it by its average:
\begin{align*}
\overline{\beta}:=\frac{1}{2}\left(\beta+a^*\beta\right).
\end{align*}
This form is invariant because
\begin{align*}
a^*\overline{\beta}
=\frac{1}{2}\left(a^*\beta+(a\circ a)^*\beta\right)
=\frac{1}{2}\left(a^*\beta+\beta\right)
=\overline{\beta}.
\end{align*}
It is still a primitive of $\alpha$, since pullback commutes with exterior differentiation:
\begin{align*}
d\overline{\beta}
&=\frac{1}{2}\left(d\beta+d(a^*\beta)\right)\\
&=\frac{1}{2}\left(\alpha+a^*d\beta\right)\\
&=\frac{1}{2}\left(\alpha+a^*\alpha\right)\\
&=\alpha.
\end{align*}
Thus a closed invariant form that is exact among all forms is already exact among invariant forms.
For surjectivity, let $[\alpha]\in H^k_{\mathrm{dR}}(S^n)^G$ be an invariant cohomology class, represented by a closed form $\alpha\in\Omega^k(S^n)$. The form $\alpha$ itself may not be invariant, but the averaged form
\begin{align*}
\overline{\alpha}:=\frac{1}{2}\left(\alpha+a^*\alpha\right)
\end{align*}
is invariant. It is closed because
\begin{align*}
d\overline{\alpha}
=\frac{1}{2}\left(d\alpha+d(a^*\alpha)\right)
=\frac{1}{2}\left(d\alpha+a^*d\alpha\right)
=0.
\end{align*}
Moreover, since the cohomology class $[\alpha]$ is invariant, we have $[a^*\alpha]=[\alpha]$. Therefore
\begin{align*}
[\overline{\alpha}]
=\frac{1}{2}\left([\alpha]+[a^*\alpha]\right)
=[\alpha].
\end{align*}
So every invariant cohomology class has an invariant representative.
Combining injectivity and surjectivity gives
\begin{align*}
H^k(\Omega^\bullet(S^n)^G,d)\cong H^k_{\mathrm{dR}}(S^n)^G.
\end{align*}
[/guided]
[/step]
[step:Use the sphere cohomology and the antipodal degree to compute the invariant subspaces]
Because the theorem assumes $n\geq 1$, the sphere $S^n$ is connected. We use the [de Rham cohomology of spheres](/page/De%20Rham%20Cohomology%20of%20Spheres) in this range:
\begin{align*}
H^0_{\mathrm{dR}}(S^n)&\cong \mathbb{R},\\
H^k_{\mathrm{dR}}(S^n)&=0 \quad \text{for } 0<k<n,\\
H^n_{\mathrm{dR}}(S^n)&\cong \mathbb{R}.
\end{align*}
Since $S^n$ is connected, the degree-zero cohomology consists of constant functions. The antipodal pullback fixes constant functions, so
\begin{align*}
H^0_{\mathrm{dR}}(S^n)^G\cong \mathbb{R}.
\end{align*}
For $0<k<n$, the [vector space](/page/Vector%20Space) $H^k_{\mathrm{dR}}(S^n)$ is zero, and hence its invariant subspace is also zero:
\begin{align*}
H^k_{\mathrm{dR}}(S^n)^G=0.
\end{align*}
It remains to compute the invariant part in degree $n$. By the [degree of the antipodal map](/page/Degree%20of%20the%20Antipodal%20Map), the antipodal map has degree
\begin{align*}
\deg(a)=(-1)^{n+1}.
\end{align*}
By the [top-degree de Rham action of degree](/page/Degree%20Determines%20the%20Action%20on%20Top%20De%20Rham%20Cohomology), the induced map on top-degree de Rham cohomology is multiplication by the degree, so
\begin{align*}
a^*:H^n_{\mathrm{dR}}(S^n)&\to H^n_{\mathrm{dR}}(S^n),\\
[\omega]&\mapsto (-1)^{n+1}[\omega].
\end{align*}
Since $H^n_{\mathrm{dR}}(S^n)\cong\mathbb{R}$ is one-dimensional, its invariant subspace is all of $H^n_{\mathrm{dR}}(S^n)$ if $(-1)^{n+1}=1$, and it is zero if $(-1)^{n+1}=-1$. Therefore
\begin{align*}
H^n_{\mathrm{dR}}(S^n)^G\cong
\begin{cases}
\mathbb{R}, & \text{if } n \text{ is odd},\\
0, & \text{if } n \text{ is even}.
\end{cases}
\end{align*}
[guided]
At this point the quotient problem has been reduced to a computation on the sphere. The theorem assumes $n\geq 1$, so $S^n$ is connected. The [de Rham cohomology of spheres](/page/De%20Rham%20Cohomology%20of%20Spheres) in this range says
\begin{align*}
H^0_{\mathrm{dR}}(S^n)&\cong \mathbb{R},\\
H^k_{\mathrm{dR}}(S^n)&=0 \quad \text{for } 0<k<n,\\
H^n_{\mathrm{dR}}(S^n)&\cong \mathbb{R}.
\end{align*}
The invariant part in degree $0$ is immediate from the interpretation of $H^0_{\mathrm{dR}}$ as locally constant functions. Since $S^n$ is connected, every closed $0$-form is constant, and constant functions are fixed by pullback under every map. Hence
\begin{align*}
H^0_{\mathrm{dR}}(S^n)^G\cong \mathbb{R}.
\end{align*}
In the middle degrees, there is no cohomology to take invariants of. If $0<k<n$, then
\begin{align*}
H^k_{\mathrm{dR}}(S^n)=0,
\end{align*}
so
\begin{align*}
H^k_{\mathrm{dR}}(S^n)^G=0.
\end{align*}
The only nontrivial issue is the top degree. A generator of $H^n_{\mathrm{dR}}(S^n)$ records orientation. The antipodal map preserves orientation exactly when $n$ is odd and reverses orientation exactly when $n$ is even. Equivalently, by the [degree of the antipodal map](/page/Degree%20of%20the%20Antipodal%20Map),
\begin{align*}
\deg(a)=(-1)^{n+1}.
\end{align*}
The [top-degree de Rham action of degree](/page/Degree%20Determines%20the%20Action%20on%20Top%20De%20Rham%20Cohomology) says that a smooth map of an oriented compact connected $n$-manifold acts on top de Rham cohomology by multiplication by its degree. Applying this to
\begin{align*}
a:S^n\to S^n
\end{align*}
gives
\begin{align*}
a^*:H^n_{\mathrm{dR}}(S^n)&\to H^n_{\mathrm{dR}}(S^n),\\
[\omega]&\mapsto (-1)^{n+1}[\omega].
\end{align*}
Because $H^n_{\mathrm{dR}}(S^n)\cong\mathbb{R}$ is one-dimensional, the fixed subspace of multiplication by $+1$ is all of $\mathbb{R}$, while the fixed subspace of multiplication by $-1$ is zero. Thus
\begin{align*}
H^n_{\mathrm{dR}}(S^n)^G\cong
\begin{cases}
\mathbb{R}, & \text{if } n \text{ is odd},\\
0, & \text{if } n \text{ is even}.
\end{cases}
\end{align*}
[/guided]
[/step]
[step:Transfer the invariant computation back to $\mathbb{R}P^n$]
From the first two steps, for every $k\in\{0,\dots,n\}$ we have natural isomorphisms
\begin{align*}
H^k_{\mathrm{dR}}(\mathbb{R}P^n)
\cong H^k(\Omega^\bullet(S^n)^G,d)
\cong H^k_{\mathrm{dR}}(S^n)^G.
\end{align*}
Substituting the invariant subspaces computed above gives
\begin{align*}
H^0_{\mathrm{dR}}(\mathbb{R}P^n)&\cong \mathbb{R},\\
H^k_{\mathrm{dR}}(\mathbb{R}P^n)&=0 \quad \text{for } 0<k<n,\\
H^n_{\mathrm{dR}}(\mathbb{R}P^n)&\cong
\begin{cases}
\mathbb{R}, & \text{if } n \text{ is odd},\\
0, & \text{if } n \text{ is even}.
\end{cases}
\end{align*}
This is the claimed computation of the real de Rham cohomology of $\mathbb{R}P^n$.
[/step]