Emergence of equilibrium thermodynamic properties in quantum pure states. I. Theory.