  We present the results of the archaeological analysis of the stellar
populations of a sample of ~4,000 galaxies observed by the SDSS-IV-MaNGA survey
using Pipe3D. Based on this analysis we extract a sample of ~150,000 SFRs and
stellar masses that mimic a single cosmological survey covering the redshift
range between z~0 to z~7. We confirm that the Star-Forming Main Sequence holds
as a tight relation in this range of redshifts, and evolves strongly in both
the zero-point and slope. This evolution is different for the population of
local star-forming (SFGs) and retired (RGs) galaxies, with the latter
presenting a stronger evolution in the zero-point and a weaker evolution in the
slope. The fraction of RGs decreases rapidly with z, particularly for those
classified as RGs at z~0. Contrary to previous studies we detect RGs well above
z>1, although not all of them are progenitors of local RGs. Finally, adopting
the required corrections to make the survey complete in mass in a limited
volume, we recover the cosmic star-formation rate (SFR), stellar mass density,
and average specific SFR histories of the Universe in this wide range of
look-back times, with a remarkable agreement with the values reported by
various cosmological surveys. We demonstrate that the progenitors of local RGs
were more actively forming stars in the past, contributing to most of the
cosmic SFR density at z>0.5, and to most of the cosmic stellar mass density at
any redshift. They suffer a general quenching in the SFR at z~0.35. Below this
redshift the progenitors of local SFGs dominate the SFR density of the
Universe.
