The foundation of quantum statistics