Theory of first order phase transitions for chaotic attractors of nonlinear dynamical systems