  We have investigated the mass-metallicity (M-Z) relation using galaxies at
0.4<z<1.0 from the Gemini Deep Deep Survey and Canada-France Redshift Survey.
Deep K and z' band photometry allowed us to measure stellar masses for 69
galaxies. From a subsample of 56 galaxies, for which metallicity of the
interstellar medium is also measured, we identified a strong correlation
between mass and metallicity, for the first time in the distant Universe. This
was possible because of the larger base line spanned by the sample in terms of
metallicity (a factor of 7) and mass (a factor of 400) than in previous works.
This correlation is much stronger and tighter than the luminosity-metallicity,
confirming that stellar mass is a more meaningful physical parameter than
luminosity. We find clear evidence for temporal evolution in the M-Z relation
in the sense that at a given mass, a galaxy at z=0.7 tends to have lower
metallicity than a local galaxy of similar mass. We use the z=0.1 SDSS M-Z
relation, and a small sample of z=2.3 Lyman break galaxies with known mass and
metallicity, to propose an empirical redshift-dependent M-Z relation, according
to which the stellar mass and metallicity in small galaxies evolve for a longer
time than in massive galaxies. This relation predicts that the generally metal
poor damped Lyman-alpha galaxies have stellar masses of the order of 10^8.8
M_sun (with a dispersion of 0.7 dex) all the way from z=0.2 to z=4. The
observed redshift evolution of the M-Z relation can be reproduced remarkably
well by a simple closed-box model where the key assumption is an e-folding time
for star formation which is higher or, in other words, a period of star
formation that lasts longer in less massive galaxies than in more massive
galaxies. Such a picture supports the downsizing scenario for galaxy formation.
