Solution (source code)

= Solution

Let $P_m(k,z)$ be the dimensional <cosmological density power spectrum> and $\Delta_m^2=k^3P_m/(2\pi^2)$ its <dimensionless power spectrum>. In linear theory,
$$
P_m(k,z)=D^2(z)\,P_{\rm prim}(k)\,\mathcal T^2(k),
$$
where $D$ is the <linear growth factor> and $\mathcal T$ is the <cosmological transfer function>. An approximately scale-invariant primordial curvature spectrum corresponds, with the conventional matter-spectrum normalization, to $P_{\rm prim}\propto k^{n_s}$ with $n_s\simeq1$. This does not say that the dimensional density spectrum is white noise or that the early curvature and density perturbations are the same variable.

The crucial scale dependence develops around horizon entry and <matter-radiation equality>. Modes entering during <radiation domination> undergo only logarithmic cold-matter growth, whereas modes entering later avoid that suppression. For <cold dark matter>, the large-scale transfer tends to a constant and the small-scale transfer behaves schematically as $\mathcal T(k)\propto\ln(k/k_{\rm eq})/k^2$. Thus
$$
P_m(k)\propto\begin{cases}k^{n_s},&k\ll k_{\rm eq},\\ k^{n_s-4}\ln^2(k/k_{\rm eq}),&k\gg k_{\rm eq}.
\end{cases}
$$
For $n_s\simeq1$, the dimensional spectrum turns from an approximately $k$ rise to an approximately $k^{-3}\ln^2k$ decline. Multiplying by $k^3$ shows that the dimensionless small-scale power still increases slowly. The resulting variance of density fluctuations smoothed on mass $M$ generally increases as $M$ decreases, over the scales relevant to galaxy assembly.

After equality, and over scales where linear growth is scale-independent, the transfer shape is approximately preserved while the amplitude grows. During <matter domination>, $D\propto a$; late accelerated expansion slows that growth. A region collapses when its linearly evolved <density contrast> reaches the <linear spherical-collapse threshold>. Smaller mass scales, having larger variance, typically reach this threshold earlier. Small haloes form first, then accrete matter and merge into larger haloes; galaxies form from cooling baryons in those wells and themselves merge. \b[This small-to-large assembly is <hierarchical galaxy formation>.] It is a statistical trend: rare high peaks can produce unusually massive early objects, and gas cooling and feedback prevent a one-to-one identification of halo collapse with <star formation>.

For <cold dark matter>, random particle velocities are small enough that <collisionless free streaming> erases little power on galactic scales. <Warm dark matter> retains a larger early velocity dispersion and a larger free-streaming length, suppressing power below a finite scale. There are consequently fewer low-mass haloes, delayed formation of the smallest galaxies, and a lower limit to the hierarchy that can develop. Above the cutoff, warm-matter structure can still assemble hierarchically. The distinction concerns the particles' velocity history and transfer function, not the thermal temperature of gas in a galaxy today. The broad late-time shape was largely established by early horizon-entry physics, with subsequent nonlinear collapse and merging altering the spectrum at high wavenumber.