thumb|The local geometry of the universe is determined by whether the relative density Ω is less than, equal to or greater than 1. From top to bottom: a [[spherical universe with greater than critical density (Ω>1, k>0); a hyperbolic, underdense universe (Ω<1, k<0); and a flat universe with exactly the critical density (Ω=1, k=0). The spacetime of the universe is, unlike the diagrams, four-dimensional.]]

The flatness problem (also known as the oldness problem) is a cosmological fine-tuning problem within the Big Bang model of the universe. Measurements find the current universe close to perfectly flat and expansion of the universe increases flatness. Consequently the early universe must have been exceptionally close to flat.

In standard cosmology based on the Friedmann equations the density of matter and energy in the universe affects the curvature of space-time, with a very specific critical value being required for a flat universe. The current density of the universe is observed to be very close to this critical value. Since any departure of the total density from the critical value would increase rapidly over cosmic time, the early universe must have had a density even closer to the critical density, departing from it by one part in 10<sup>62</sup> or less. This leads cosmologists to question how the initial density came to be so closely fine-tuned to this 'special' value.

The problem was first mentioned by Robert Dicke in 1969. The most commonly accepted solution among cosmologists is cosmic inflation, the idea that the universe went through a brief period of extremely rapid expansion in the first fraction of a second after the Big Bang; along with the monopole problem and the horizon problem, the flatness problem is one of the three primary motivations for inflationary theory.

Flatness <span class="anchor" id="Flatness"></span>

Flatness in cosmology is a curved spacetime geometry with zero curvature. Curvature can be measured by comparing the radius of a circle around any point to the circumference:

<math display="block">R = \lim_{\textrm{radius}\rightarrow 0} \frac{6}{(\textrm{radius})^2} ( 1-\frac{\textrm{circumference{2\pi\ \textrm{radius)</math>

Any small region in spacetime is locally flat. By analogy, the Earth appears flat in small region.

Energy density and the Friedmann equation

According to Einstein's field equations of general relativity, the structure of spacetime is affected by the presence of matter and energy. On large scales space is curved by the gravitational effect of matter. Since relativity indicates that matter and energy are equivalent, this effect is also produced by the presence of energy (such as light and other electromagnetic radiation) in addition to matter. The amount of bending (or curvature) of the universe depends on the density of matter/energy present.

This relationship can be expressed by the first Friedmann equation. In a universe without a cosmological constant, this is:

:<math>H^2 = \frac{8 \pi G}{3} \rho - \frac{kc^2}{a^2}</math>

Here <math>H</math> is the Hubble parameter, a measure of the rate at which the universe is expanding. <math>\rho</math> is the total density of mass and energy in the universe, <math>a</math> is the scale factor (essentially the 'size' of the universe), and <math>k</math> is the curvature parameter &mdash; that is, a measure of how curved spacetime is. A positive, zero or negative value of <math>k</math> corresponds to a respectively closed, flat or open universe. The constants <math>G</math> and <math>c</math> are Newton's gravitational constant and the speed of light, respectively.

Cosmologists often simplify this equation by defining a critical density, <math>\rho_c</math>. For a given value of <math>H</math>, this is defined as the density required for a flat universe, i.e. . Thus the above equation implies

:<math>\rho_c = \frac{3H^2}{8\pi G}</math>.

Since the constant <math>G</math> is known and the expansion rate <math>H</math> can be measured by observing the speed at which distant galaxies are receding from us,

<math>\rho_c</math> can be determined. Its value is currently around . The ratio of the actual density to this critical value is called Ω, and its difference from 1 determines the geometry of the universe: corresponds to a greater than critical density, , and hence a closed universe. gives a low density open universe, and Ω equal to exactly 1 gives a flat universe.

The Friedmann equation,

:<math>\frac{3a^2}{8\pi G}H^2 = \rho a^2 - \frac{3kc^2}{8 \pi G},</math>

can be re-arranged into

:<math>\rho_c a^2 - \rho a^2 = - \frac{3kc^2}{8 \pi G},</math>

which after factoring <math>\rho a^2</math>, and using <math>\Omega=\rho/\rho_c</math>, leads to

:<math>(\Omega^{-1} - 1)\rho a^2 = \frac{-3kc^2}{8 \pi G}.</math>

The right hand side of the last expression above contains constants only and therefore the left hand side must remain constant throughout the evolution of the universe.

As the universe expands the scale factor <math>a</math> increases, but the density <math>\rho</math> decreases as matter (or energy) becomes spread out. For the standard model of the universe which contains mainly matter and radiation for most of its history, <math>\rho</math> decreases more quickly than <math>a^2</math> increases, and so the factor will decrease. Since the time of the Planck era, shortly after the Big Bang, this term has decreased by a factor of around <math>10^{60},</math> - depends on the curvature of the universe which in turn depends on its density as described above. Thus, measurements of this angular scale allow an estimation of Ω<sub>0</sub>.