  We present a backward approach for the interpretation of the evolution of the
near-infrared and the far-infrared luminosity functions across the redshift
range 0<z<3. In our method, late-type galaxies are treated by means of a
parametric phenomenological method based on PEP/HerMES data up to z~4, whereas
spheroids are described by means of a physically motivated backward model. The
spectral evolution of spheroids is modelled by means of a single-mass model,
associated to a present-day elliptical with K-band luminosity comparable to the
break of the local early-type luminosity function. The formation of
proto-spheroids is assumed to occurr across the redshift range 1< z < 5. The
key parameter is represented by the redshift z_0.5 at which half
proto-spheroids are already formed. A statistical study indicates for this
parameter values between z_0.5=1.5 and z_0.5=3. We assume as fiducial value
z_0.5~2, and show that this assumption allows us to describe accourately the
redshift distributions and the source counts. By assuming z_0.5 ~ 2 at the
far-IR flux limit of the PEP-COSMOS survey, the PEP-selected sources observed
at z>2 can be explained as progenitors of local spheroids caught during their
formation. We also test the effects of mass downsizing by dividing the
spheroids into three populations of different present-day stellar masses. The
results obtained in this case confirm the validity of our approach, i.e. that
the bulk of proto-spheroids can be modelled by means of a single model which
describes the evolution of galaxies at the break of the present-day early type
K-band LF.
