  We study light propagation through a slab of cold gas using both the standard
electrodynamics of polarizable media, and massive atom-by-atom simulations of
the electrodynamics. The main finding is that the predictions from the two
methods may differ qualitatively when the density of the atomic sample $\rho$
and the wavenumber of resonant light $k$ satisfy $\rho k^{-3}\gtrsim 1$. The
reason is that the standard electrodynamics is a mean-field theory, whereas for
sufficiently strong light-mediated dipole-dipole interactions the atomic sample
becomes correlated. The deviations from mean-field theory appear to scale with
the parameter $\rho k^{-3}$, and we demonstrate noticeable effects already at
$\rho k^{-3} \simeq 10^{-2}$. In dilute gases and in gases with an added
inhomogeneous broadening the simulations show shifts of the resonance lines in
qualitative agreement with the predicted Lorentz-Lorenz shift and "cooperative
Lamb shift", but the quantitative agreement is unsatisfactory. Our
interpretation is that the microscopic basis for the local-field corrections in
electrodynamics is not fully understood.
