Liouville's theorem & the second law of thermodynamics