The first theorem only shows that the density uniquely defines the potential, while the second one introduces its own variational principle. I think the link between the ground-state energy and the density is not just a direct result of the first theorem, probably because of local minima.