We present a double distribution function of dark matter halos , with respect to both object mass and local over- ( or under- ) density . This analytical tool provides a statistical treatment of the properties of matter surrounding collapsed objects , and can be used to study environmental effects on hierarchical structure formation . The size of the “ local environment ” of a collapsed object is defined to depend on the mass of the object . The Press-Schechter mass function is recovered by integration of our double distribution over the density contrast . We also present a detailed treatment of the evolution of overdensities and underdensities in \Omega _ { m } + \Omega _ { \Lambda } = 1 and \Omega _ { m } = 1 universes according to the spherical evolution model . We explicitly distinguish between true and linearly extrapolated overdensities and provide conversion relations between the two quantities .