  Using the observations of the star formation rate and HI densities to z ~ 4,
with measurements of the Molecular Gas Depletion Rate (MGDR) and local density
of H_2 at z = 0, we derive the history of the gas consumption by star formation
to z ~ 4. We find that closed-box models in which H_2 is not replenished by HI
require improbably large increases in rho(H_2) and a decrease in the MGDR with
lookback time that is inconsistent with observations. Allowing the H_2 used in
star formation to be replenished by HI does not alleviate the problem because
observations show that there is very little evolution of rho(HI) from z = 0 to
z = 4. We show that to be consistent with observational constraints, star
formation on cosmic timescales must be fueled by intergalactic ionized gas,
which may come from either accretion of gas through cold (but ionized) flows or
from ionized gas associated with accretion of dark matter halos. We constrain
the rate at which the extraglactic ionized gas must be converted into HI and
ultimately into H_2. The ionized gas inflow rate roughly traces the SFRD: about
1 - 2 x 10^8 M_sun Gyr^-1 Mpc^-3 from z ~ 1 - 4, decreasing by about an order
of magnitude from z=1 to z=0 with details depending largely on MGDR(t). All
models considered require the volume averaged density of rho(H_2) to increase
by a factor of 1.5 - 10 to z ~ 1.5 over the currently measured value. Because
the molecular gas must reside in galaxies, it implies that galaxies at high z
must, on average, be more molecule rich than they are at the present epoch,
which is consistent with observations. These quantitative results, derived
solely from observations, agree well with cosmological simulations.
