At redshifts z >~ 30 neutral hydrogen gas absorbs CMB radiation at the 21cm
spin-flip frequency. In principle this is observable and a high-precision probe
of cosmology. We calculate the linear-theory angular power spectrum of this
signal and cross-correlation between redshifts on scales much larger than the
line width. In addition to the well known redshift-distortion and density
perturbation sources a full linear analysis gives additional contributions to
the power spectrum. On small scales there is a percent-level linear effect due
to perturbations in the 21cm optical depth, and perturbed recombination
modifies the gas temperature perturbation evolution (and hence spin temperature
and 21cm power spectrum). On large scales there are several post-Newtonian and
velocity effects; although negligible on small scales, these additional terms
can be significant at l <~ 100 and can be non-zero even when there is no
background signal. We also discuss the linear effect of reionization
re-scattering, which damps the entire spectrum and gives a very small
polarization signal on large scales. On small scales we also model the
significant non-linear effects of evolution and gravitational lensing. We
include full results for numerical calculation and also various approximate
analytic results for the power spectrum and evolution of small scale
perturbations.Comment: 29 pages; significant extensions including: self-absorption terms
(i.e. change to background radiation due to 21cm absorption); ionization
fraction perturbations; estimates of non-linear effects; approximate analytic
results; results for sharp redshift window functions. Code available at
http://camb.info/sources