Solution (source code)

= Solution
{c}

On large scales the appropriate background is the spatially flat <FLRW metric>,
$$
\boxed{ds^2=-c^2dt^2+R^2(t)\left[dr^2+r^2d\theta^2+r^2\sin^2\theta\,d\phi^2\right].}
$$
Here $t$ is <cosmic time>, the <proper time> of a <comoving observer>; $R(t)$ is the <scale factor>; and $(r,\theta,\phi)$ are dimensionless <comoving coordinates>. With this convention $R$ has units of <length>. A fixed comoving radial interval has instantaneous <proper length> $R(t)\,dr$. The <cosmological principle> assumes <spatial homogeneity> and <cosmological isotropy> on the scales where this background description applies.

The general <FLRW metric> instead has $dr^2/(1-kr^2)$ in its radial part, with normalized $k=+1,0,-1$ describing positive, zero or negative <spatial curvature of an FLRW universe>. The best simple description takes $k=0$; observations constrain spatial <curvature> to be small rather than proving it identically zero. The late accelerated expansion is encoded by the time dependence of $R$, determined by the <stress-energy tensor> through the <Friedmann equations>, rather than by an additional term in the <FLRW metric>. Small-scale galaxies and other inhomogeneities require perturbations of this background.