[proofplan]
The proof uses the [Hard Lefschetz Theorem](/theorems/3876) to split each cohomology group below the middle degree into primitive classes and Lefschetz multiples from two degrees lower. The key linear-algebra step is to prove
$H^k(X,\mathbb{R}) = P^k(X) \oplus L H^{k-2}(X,\mathbb{R})$
for $0 \leq k \leq n$. Once this two-term splitting is established, iterating it gives the stated direct sum decomposition.
[/proofplan]
[step:Use Hard Lefschetz to isolate the primitive summand]
For each integer $m$, write
\begin{align*}
V^m := H^m(X,\mathbb{R}).
\end{align*}
For $m < 0$, set $V^m := \{0\}$. The operator $L$ is the degree-$2$ [linear map](/page/Linear%20Map)
\begin{align*}
L: V^m &\to V^{m+2} \\
\alpha &\mapsto [\omega] \cup \alpha.
\end{align*}
We use the Hard Lefschetz Theorem, which states that for every integer $0 \leq j \leq n$, the map
\begin{align*}
L^{n-j}: V^j \to V^{2n-j}
\end{align*}
is an isomorphism. This is the single external input in the proof; the required cited result is not yet resolved in the wiki: Hard Lefschetz Theorem.
Fix an integer $k$ with $0 \leq k \leq n$. We prove
\begin{align*}
V^k = P^k(X) \oplus L V^{k-2}.
\end{align*}
If $k=0$ or $k=1$, then $V^{k-2}=\{0\}$ by convention. The Hard Lefschetz map
\begin{align*}
L^{n-k}: V^k \to V^{2n-k}
\end{align*}
is an isomorphism. Hence $L^{n-k+1}\alpha = 0$ for $\alpha \in V^k$ would imply
\begin{align*}
L^{n-k}\alpha \in \ker\left(L: V^{2n-k} \to V^{2n-k+2}\right).
\end{align*}
Since $2n-k+2>2n$, the target is zero only when applying one further Lefschetz operator past the top degree. In degrees $0$ and $1$, the primitive space is exactly the kernel prescribed by the definition, so the desired splitting reduces to $V^k=P^k(X)$ when $L V^{k-2}=\{0\}$.
Now assume $2 \leq k \leq n$. By Hard Lefschetz in degree $k-2$, the map
\begin{align*}
L^{n-k+2}: V^{k-2} \to V^{2n-k+2}
\end{align*}
is an isomorphism. In particular, $L:V^{k-2}\to V^k$ is injective, because if $\beta \in V^{k-2}$ and $L\beta=0$, then
\begin{align*}
L^{n-k+2}\beta = L^{n-k+1}(L\beta)=0,
\end{align*}
and the isomorphism $L^{n-k+2}$ forces $\beta=0$.
The restriction of $L^{n-k+1}$ to $L V^{k-2}$ is an isomorphism onto $V^{2n-k+2}$. Indeed, every element of $L V^{k-2}$ has the form $L\beta$ with $\beta \in V^{k-2}$, and
\begin{align*}
L^{n-k+1}(L\beta)=L^{n-k+2}\beta.
\end{align*}
Since $L^{n-k+2}:V^{k-2}\to V^{2n-k+2}$ is an isomorphism, this restriction is bijective.
Therefore
\begin{align*}
P^k(X) \cap L V^{k-2}=\{0\},
\end{align*}
because $P^k(X)$ is the kernel of $L^{n-k+1}:V^k\to V^{2n-k+2}$ while this same map is injective on $L V^{k-2}$.
Finally, because the restriction to $L V^{k-2}$ is surjective, the rank of
\begin{align*}
L^{n-k+1}:V^k\to V^{2n-k+2}
\end{align*}
is $\dim V^{2n-k+2}$. Since $L^{n-k+2}:V^{k-2}\to V^{2n-k+2}$ is an isomorphism, this rank is $\dim V^{k-2}$. The [rank-nullity theorem](/theorems/916) gives
\begin{align*}
\dim P^k(X)
= \dim V^k - \dim V^{k-2}.
\end{align*}
Because $L:V^{k-2}\to V^k$ is injective, $\dim L V^{k-2}=\dim V^{k-2}$. Hence
\begin{align*}
\dim P^k(X)+\dim L V^{k-2}=\dim V^k.
\end{align*}
Together with $P^k(X)\cap L V^{k-2}=\{0\}$, this proves
\begin{align*}
V^k=P^k(X)\oplus L V^{k-2}.
\end{align*}
[guided]
The goal of this step is to separate a class in $H^k(X,\mathbb{R})$ into a primitive part and a part that already comes from degree $k-2$ by multiplication with the Kähler class. We write
\begin{align*}
V^m := H^m(X,\mathbb{R})
\end{align*}
for each integer $m$, and set $V^m:=\{0\}$ for $m<0$. The Lefschetz operator is the linear map
\begin{align*}
L: V^m &\to V^{m+2} \\
\alpha &\mapsto [\omega]\cup \alpha.
\end{align*}
We use the Hard Lefschetz Theorem: for every $0\leq j\leq n$, the map
\begin{align*}
L^{n-j}:V^j\to V^{2n-j}
\end{align*}
is an isomorphism. This is the structural input that makes the decomposition possible; the required cited result is not yet resolved in the wiki: Hard Lefschetz Theorem.
Fix $k$ with $0\leq k\leq n$. We want to prove the two-term decomposition
\begin{align*}
V^k=P^k(X)\oplus L V^{k-2}.
\end{align*}
The term $P^k(X)$ is the kernel
\begin{align*}
P^k(X)=\ker\left(L^{n-k+1}:V^k\to V^{2n-k+2}\right).
\end{align*}
Thus a class is primitive precisely when one more Lefschetz power than the middle-degree isomorphism kills it.
For $k=0$ or $k=1$, the space $V^{k-2}$ is zero by convention, so there is no lower-degree contribution. The desired splitting says simply that the degree-$k$ cohomology is its primitive part.
Now suppose $2\leq k\leq n$. Apply Hard Lefschetz in degree $k-2$. It gives an isomorphism
\begin{align*}
L^{n-k+2}:V^{k-2}\to V^{2n-k+2}.
\end{align*}
This immediately implies that the first Lefschetz map $L:V^{k-2}\to V^k$ is injective. Indeed, if $\beta\in V^{k-2}$ satisfies $L\beta=0$, then
\begin{align*}
L^{n-k+2}\beta
=
L^{n-k+1}(L\beta)
=
0.
\end{align*}
Since $L^{n-k+2}$ is an isomorphism, its kernel is zero, so $\beta=0$.
Next we examine what $L^{n-k+1}$ does on the subspace $L V^{k-2}\subset V^k$. Every element of this subspace has the form $L\beta$ for some $\beta\in V^{k-2}$, and
\begin{align*}
L^{n-k+1}(L\beta)=L^{n-k+2}\beta.
\end{align*}
Because $L^{n-k+2}:V^{k-2}\to V^{2n-k+2}$ is an isomorphism, the restriction of
\begin{align*}
L^{n-k+1}:V^k\to V^{2n-k+2}
\end{align*}
to $L V^{k-2}$ is also an isomorphism onto $V^{2n-k+2}$.
This has two consequences. First, the primitive part and the Lefschetz image meet only at zero:
\begin{align*}
P^k(X)\cap L V^{k-2}=\{0\}.
\end{align*}
Indeed, $P^k(X)$ is the kernel of $L^{n-k+1}$, while the same map is injective on $L V^{k-2}$.
Second, the dimensions add up correctly. Since the restriction to $L V^{k-2}$ is onto $V^{2n-k+2}$, the rank of $L^{n-k+1}:V^k\to V^{2n-k+2}$ is $\dim V^{2n-k+2}$. The Hard Lefschetz isomorphism
\begin{align*}
L^{n-k+2}:V^{k-2}\to V^{2n-k+2}
\end{align*}
identifies this dimension with $\dim V^{k-2}$. Hence rank-nullity gives
\begin{align*}
\dim P^k(X)=\dim V^k-\dim V^{k-2}.
\end{align*}
Since $L:V^{k-2}\to V^k$ is injective, we also have
\begin{align*}
\dim L V^{k-2}=\dim V^{k-2}.
\end{align*}
Therefore
\begin{align*}
\dim P^k(X)+\dim L V^{k-2}=\dim V^k.
\end{align*}
Together with the zero intersection, this proves
\begin{align*}
V^k=P^k(X)\oplus L V^{k-2}.
\end{align*}
[/guided]
[/step]
[step:Iterate the two-term splitting to obtain the full decomposition]
We prove the stated formula by induction on $k$ for $0\leq k\leq n$.
For $k=0$ and $k=1$, the convention $V^m=\{0\}$ for $m<0$ gives
\begin{align*}
V^k=P^k(X),
\end{align*}
which is the asserted decomposition.
Assume $2\leq k\leq n$, and assume the decomposition has been proved in degree $k-2$. The two-term splitting from the previous step gives
\begin{align*}
V^k=P^k(X)\oplus L V^{k-2}.
\end{align*}
By the induction hypothesis,
\begin{align*}
V^{k-2}
=
\bigoplus_{r=0}^{\lfloor (k-2)/2\rfloor} L^r P^{k-2-2r}(X).
\end{align*}
Applying the linear map $L:V^{k-2}\to V^k$ to this direct sum gives
\begin{align*}
L V^{k-2}
=
\bigoplus_{r=0}^{\lfloor (k-2)/2\rfloor} L^{r+1}P^{k-2-2r}(X).
\end{align*}
Set $s:=r+1$. Then $s$ ranges from $1$ to $\lfloor k/2\rfloor$, and $k-2-2r=k-2s$. Therefore
\begin{align*}
L V^{k-2}
=
\bigoplus_{s=1}^{\lfloor k/2\rfloor} L^s P^{k-2s}(X).
\end{align*}
Substituting this into $V^k=P^k(X)\oplus L V^{k-2}$ yields
\begin{align*}
V^k
=
P^k(X)
\oplus
\bigoplus_{s=1}^{\lfloor k/2\rfloor} L^s P^{k-2s}(X)
=
\bigoplus_{s=0}^{\lfloor k/2\rfloor} L^s P^{k-2s}(X).
\end{align*}
Since $V^k=H^k(X,\mathbb{R})$, this is exactly
\begin{align*}
H^k(X,\mathbb{R})
=
\bigoplus_{r=0}^{\lfloor k/2\rfloor} L^r P^{k-2r}(X).
\end{align*}
This completes the proof.
[/step]