On the way to the mathematical foundations of statistical mechanics