Solution (source code)

= Solution

Use the <path-loop fibration>
$$
\Omega S^4\longrightarrow PS^4\longrightarrow S^4
$$
and its rational <Serre spectral sequence>. The total space is contractible, while $H^*(S^4;\mathbb Q)$ is $\mathbb Q$ in degrees $0$ and $4$ and zero otherwise. The only possible nonzero differential is
$$
d_4:E_4^{0,q}\longrightarrow E_4^{4,q-3}.
$$
Convergence to the cohomology of a point first forces $d_4:H^3(\Omega S^4;\mathbb Q)\to H^4(S^4;\mathbb Q)$ to be an isomorphism, and then inductively forces an isomorphism from each nonzero vertical group to the group three degrees below it in the other column. Therefore
$$
H^i(\Omega S^4;\mathbb Q)\cong
\begin{cases}
\mathbb Q,&i=0,3,6,9,\ldots,\\
0,&\text{otherwise}.
\end{cases}
$$

Solved by gpt-5.6-sol high.