Liouville's Theorem

Drop a bead of ink into a glass of water and stir. The ink stretches into thinner and thinner filaments, marbling the whole glass — yet not one molecule of ink is created or destroyed, and the total amount of ink is exactly what you started with. Statistical mechanics runs on a phase-space version of this picture, and Liouville's theorem is the law that makes it exact. Instead of tracking the impossible ∼1023\sim 10^{23} coupled trajectories of a gas, we imagine a cloud of identically prepared systems — a droplet of representative points in the 6N6N-dimensional space of all positions and momenta — and follow its density ρ(q,p,t)\rho(q,p,t). Liouville's theorem says this cloud flows like an incompressible fluid. The droplet can shear, fold, and stretch into threads far finer than any macroscopic scale, but the volume it occupies never changes, and the density measured by an observer riding along with the flow is frozen: dρ/dt=0\mathrm{d}\rho/\mathrm{d}t = 0. This is a theorem, not a modelling choice — it falls straight out of the fact that a single Hamiltonian steers both position and momentum, so every expansion in a coordinate direction is matched, exactly, by a contraction in its conjugate momentum. That one geometric fact does enormous work. It makes the uniform "equal weight" measure on an energy shell dynamically self-consistent (spread probability evenly, and the flow keeps it even), which is the permission slip for every equilibrium ensemble you will build. And it draws a hard boundary: because fine-grained volume is conserved, an isolated mechanical system cannot manufacture entropy on its own. The arrow of time you feel every day has to come from somewhere else — coarse-graining, mixing, contact with a bath — and knowing exactly what Liouville forbids is the first step to understanding where irreversibility is allowed in.

Key takeaways
  • Liouville's theorem: the phase-space density is constant along every Hamiltonian trajectory, dρ/dt=0\mathrm{d}\rho/\mathrm{d}t = 0 — an observer comoving with the flow sees ρ\rho never change.
  • Equivalently, Hamiltonian flow is incompressible: a swarm of representative points preserves its phase-space volume even as its shape distorts wildly.
  • The reason is exact cancellation: q˙i=∂H/∂pi\dot q_i = \partial H/\partial p_i and p˙i=−∂H/∂qi\dot p_i = -\partial H/\partial q_i share the same mixed second derivative, so the flow's divergence vanishes term by term.
  • It is the dynamical foundation of statistical mechanics — it makes stationary ensembles possible and keeps the uniform measure on an energy shell time-invariant.
  • Volume preservation forbids attractors in conservative dynamics: an isolated Hamiltonian system never relaxes onto a lower-dimensional set. Dissipation requires unmodelled degrees of freedom.
  • Because fine-grained volume is conserved, the Gibbs entropy SG=−kB ⁣∫ ⁣ρln⁡ρ dΓS_G = -k_B\!\int\!\rho\ln\rho\,\mathrm{d}\Gamma is exactly constant — the second law needs a coarse-grained description.
  • Key idea: The phase-space density is a conserved label carried by an incompressible flow — volume, not shape, is what the dynamics protects.
The core insight

Hamiltonian flow preserves phase-space volume, so the density ρ\rho is constant along trajectories: dρ/dt=0\mathrm{d}\rho/\mathrm{d}t = 0. Shapes distort without limit; volume is untouched.

Where this lives today

Liouville's theorem is not a museum piece — it is a working constraint in every field that pushes clouds of particles through phase space. Accelerator physicists live by it as the conservation of emittance: the phase-space area of a particle beam cannot be reduced by any conservative optics, so squeezing a beam tighter in position necessarily spreads it in momentum. Beating this limit — "beam cooling" at facilities like CERN and Fermilab — requires deliberately dissipative tricks (stochastic or electron cooling) that add exactly the non-Hamiltonian term Liouville forbids, and the theorem is what tells engineers precisely how much extra machinery they must build. The same law governs plasma simulations (the Vlasov equation is Liouville's theorem for a collisionless plasma), galactic dynamics (stars stream through a 66-dimensional phase space whose fine-grained density is frozen, so galaxies "phase-mix" rather than truly relax), and the design of symplectic integrators — numerical schemes engineered to preserve phase-space volume exactly, so that long molecular-dynamics and planetary simulations don't spuriously gain or lose energy over billions of steps. Wherever a conserved probability rides a Hamiltonian flow, Liouville is quietly setting the rules.

The physical picture

Return to the ink. What Liouville's theorem forbids is not the stretching — the droplet is free to filament into a shape of unbounded complexity — but any change in the amount. Ride along with a single ink particle and the local density around you is fixed forever; that is the content of dρ/dt=0\mathrm{d}\rho/\mathrm{d}t = 0. The stirring is essential (it is what will eventually let coarse observers see equilibration), but the volume is sacred. Why is the flow incompressible? Because qq and pp are yoked by one Hamiltonian. The velocity along a position axis is q˙i=∂H/∂pi\dot q_i = \partial H/\partial p_i; the velocity along the conjugate momentum axis is p˙i=−∂H/∂qi\dot p_i = -\partial H/\partial q_i. When you ask how fast the flow is spreading — its divergence — the position term brings in ∂2H/∂qi∂pi\partial^2 H/\partial q_i\partial p_i and the momentum term brings in −∂2H/∂pi∂qi-\partial^2 H/\partial p_i\partial q_i, and for any smooth HH these mixed partials are equal. They cancel, pair by pair, coordinate by coordinate. Nothing about the form of HH matters; only its smoothness.

Figure
Hamiltonian flow stretches a phase-space droplet but never changes its area
q p t = 0 area A t = t₁ same area A t = t₂ still area A the blob shears and folds into filaments — its area is conserved at every instant

A quick contrast fixes the idea. Add friction — a damped particle with p˙=−γp−∂V/∂q\dot p = -\gamma p - \partial V/\partial q — and now ∂p˙/∂p=−γ≠0\partial \dot p/\partial p = -\gamma \neq 0. The flow is compressible; volume shrinks; trajectories spiral inward onto an attractor. That is exactly what conservative Hamiltonian dynamics cannot do. Liouville's theorem is the precise statement that closed mechanical systems have no attractors: they can mix, but they can never collapse onto a smaller set. The second figure shows the two fates side by side.

Figure
Conservative flow preserves area; dissipative flow collapses onto an attractor
conservative: div v = 0 dissipative: div v = −γ, area shrinks orbits nest — no shrinking spirals to a point

Because volume is preserved, the "obvious" uniform probability on an energy shell is dynamically consistent: spread the probability evenly over accessible microstates and the flow keeps it even. This is the dynamical justification hiding underneath the postulate of equal a priori probabilities — the flow cannot pile probability up anywhere, so uniform is a genuine steady state.

The core equations

An observer standing at a fixed point in phase space and an observer riding along with the flow disagree about how ρ\rho changes, and reconciling them is the whole story. The comoving observer's rate of change is the material (convective) derivative — the local rate plus the streaming brought by the velocity field. Liouville's theorem is the statement that, for a Hamiltonian flow, this comoving rate is identically zero:

dρdt=∂ρ∂t+∑i=13N(q˙i ∂ρ∂qi+p˙i ∂ρ∂pi)=0(1)\frac{\mathrm{d}\rho}{\mathrm{d}t} = \frac{\partial\rho}{\partial t} + \sum_{i=1}^{3N}\left(\dot q_i\,\frac{\partial\rho}{\partial q_i} + \dot p_i\,\frac{\partial\rho}{\partial p_i}\right) = 0 \qquad (1)

where: ρ(q,p,t)\rho(q,p,t) — phase-space probability density; qi,piq_i,p_i — generalized coordinates and conjugate momenta; q˙i,p˙i\dot q_i,\dot p_i — velocities set by Hamilton's equations; 3N3N — configuration-space degrees of freedom. Read it as a conservation law for a label: the value of ρ\rho is painted onto each system and carried along unchanged, no matter how the cloud deforms. The engine underneath is the vanishing divergence of the phase-space velocity field. This is where "a single Hamiltonian steers both qq and pp" becomes an equation:

∇⋅v=∑i=13N(∂q˙i∂qi+∂p˙i∂pi)=0,v=(q˙,p˙)(2)\nabla\cdot\mathbf{v} = \sum_{i=1}^{3N}\left(\frac{\partial\dot q_i}{\partial q_i} + \frac{\partial\dot p_i}{\partial p_i}\right) = 0,\qquad \mathbf{v}=(\dot q,\dot p) \qquad (2)

where: v\mathbf{v} — the 6N6N-dimensional velocity field on phase space. A divergence of zero means the flow neither compresses nor rarefies the cloud anywhere; it is the local face of global volume conservation. Combining a divergence-free velocity with the continuity equation for probability collapses the streaming into a single compact object, the Poisson bracket, giving the differential form of the theorem — the Liouville equation:

∂ρ∂t=−{ρ,H}=−∑i(∂ρ∂qi∂H∂pi−∂ρ∂pi∂H∂qi)(3)\frac{\partial\rho}{\partial t} = -\{\rho,H\} = -\sum_i\left(\frac{\partial\rho}{\partial q_i}\frac{\partial H}{\partial p_i} - \frac{\partial\rho}{\partial p_i}\frac{\partial H}{\partial q_i}\right) \qquad (3)

where: {⋅,⋅}\{\cdot,\cdot\} — Poisson bracket; HH — the Hamiltonian generating the flow. The local rate of change of ρ\rho at a fixed point is entirely the streaming of a frozen profile past that point; it is developed in full in the companion article on the Liouville equation. Finally, two consequences worth stating as equations. Volume conservation of any comoving region RR, and the constancy of the fine-grained Gibbs entropy that follows from it:

∫R(t)dΓ=∫R(0)dΓ,dSGdt=−kBddt∫ρln⁡ρ dΓ=0(4)\int_{R(t)}\mathrm{d}\Gamma = \int_{R(0)}\mathrm{d}\Gamma,\qquad \frac{\mathrm{d}S_G}{\mathrm{d}t} = -k_B\frac{\mathrm{d}}{\mathrm{d}t}\int\rho\ln\rho\,\mathrm{d}\Gamma = 0 \qquad (4)

where: dΓ=∏idqi dpi\mathrm{d}\Gamma = \prod_i \mathrm{d}q_i\,\mathrm{d}p_i — the invariant Liouville measure; SGS_G — fine-grained Gibbs entropy; kBk_B — Boltzmann's constant. The right-hand equation is the sharpest expression of what Liouville forbids: exact mechanics cannot raise fine-grained entropy, full stop.

Derivation AThe flow is incompressible

We want to prove the single fact everything else rests on: the phase-space velocity field of a Hamiltonian system has zero divergence, for any smooth Hamiltonian whatsoever. The strategy is disarmingly short — write the divergence out, substitute Hamilton's equations, and watch the two contributions turn into the same mixed second derivative of HH with opposite signs. The one thing to watch is that the cancellation must happen coordinate by coordinate, not just in aggregate, so we keep the index ii explicit and never sum prematurely.

Step 1. Write the two pieces of the divergence for a single degree of freedom ii. The position piece is ∂q˙i/∂qi\partial\dot q_i/\partial q_i and the momentum piece is ∂p˙i/∂pi\partial\dot p_i/\partial p_i. Why: the divergence in 6N6N dimensions is just the sum of these two over every ii, so if each pair cancels, the whole thing vanishes.

Step 2. Substitute Hamilton's first equation, q˙i=∂H/∂pi\dot q_i = \partial H/\partial p_i:

∂q˙i∂qi=∂∂qi∂H∂pi=∂2H∂qi ∂pi\frac{\partial\dot q_i}{\partial q_i} = \frac{\partial}{\partial q_i}\frac{\partial H}{\partial p_i} = \frac{\partial^2 H}{\partial q_i\,\partial p_i}

Why: the velocity along qiq_i is already a derivative of HH; differentiating again by qiq_i produces a mixed second derivative.

Step 3. Substitute Hamilton's second equation, p˙i=−∂H/∂qi\dot p_i = -\partial H/\partial q_i:

∂p˙i∂pi=∂∂pi(−∂H∂qi)=−∂2H∂pi ∂qi\frac{\partial\dot p_i}{\partial p_i} = \frac{\partial}{\partial p_i}\left(-\frac{\partial H}{\partial q_i}\right) = -\frac{\partial^2 H}{\partial p_i\,\partial q_i}

Why: the minus sign in Hamilton's equation is exactly what will make this term the negative of Step 2.

Step 4. Add the two and use equality of mixed partials for smooth HH:

∂2H∂qi ∂pi−∂2H∂pi ∂qi=0for every i  ⇒  ∇⋅v=0\frac{\partial^2 H}{\partial q_i\,\partial p_i} - \frac{\partial^2 H}{\partial p_i\,\partial q_i} = 0 \quad\text{for every }i \;\Rightarrow\; \nabla\cdot\mathbf{v}=0

Why: Clairaut's theorem says the order of differentiation does not matter, so the two terms are identical in magnitude and opposite in sign. The cancellation is exact and HH-independent — it is a property of the symplectic structure, not of any particular system. *Verified symbolically for a general H(q1,q2,p1,p2)H(q_1,q_2,p_1,p_2) and for the explicit SHO in verify_aq-sm-liouville-theorem.py; a damped flow gives ∇⋅v=−γ≠0\nabla\cdot\mathbf{v} = -\gamma \neq 0, confirming dissipation is exactly what breaks incompressibility.*

Go deeper · Derivation B · 1 minFrom incompressibility to a frozen density
Derivation BFrom incompressibility to a frozen density

With incompressibility in hand, we now show the density is constant along trajectories. The route is the continuity equation — probability, like mass, is neither created nor destroyed — expanded and then pruned by the fact we just proved. The goal is to convert the global statement "no probability is lost" into the local, comoving statement "ρ\rho is frozen on each moving fluid particle," which is the form we actually use when we argue that equilibrium ensembles are stationary.

Step 1. Start from conservation of probability in phase space, the continuity equation ∂tρ+∇⋅(ρv)=0\partial_t\rho + \nabla\cdot(\rho\mathbf{v}) = 0. Why: representative systems are never created or destroyed, so the density obeys the same bookkeeping as any conserved fluid.

Step 2. Expand the divergence of the current with the product rule: ∇⋅(ρv)=v⋅∇ρ+ρ (∇⋅v)\nabla\cdot(\rho\mathbf{v}) = \mathbf{v}\cdot\nabla\rho + \rho\,(\nabla\cdot\mathbf{v}). Why: the current ρv\rho\mathbf{v} carries two effects — the profile ρ\rho being swept along, and the flow spreading — and we want to isolate them.

Step 3. Kill the second term using the incompressibility result, ∇⋅v=0\nabla\cdot\mathbf{v}=0:

∂ρ∂t+v⋅∇ρ=0\frac{\partial\rho}{\partial t} + \mathbf{v}\cdot\nabla\rho = 0

Why: incompressibility removes the "spreading" contribution entirely, leaving only pure advection.

Step 4. Recognize the left side as the material derivative:

dρdt≡∂ρ∂t+∑i(q˙i∂qiρ+p˙i∂piρ)=0\frac{\mathrm{d}\rho}{\mathrm{d}t} \equiv \frac{\partial\rho}{\partial t} + \sum_i\left(\dot q_i\partial_{q_i}\rho + \dot p_i\partial_{p_i}\rho\right) = 0

Why: v⋅∇ρ\mathbf{v}\cdot\nabla\rho is exactly the streaming term of the comoving derivative, so what we have proved is dρ/dt=0\mathrm{d}\rho/\mathrm{d}t=0 — Liouville's theorem. *Verified: the SHO flow matrix (cos⁡ωtsin⁡ωt/mω−mωsin⁡ωtcos⁡ωt)\begin{pmatrix}\cos\omega t & \sin\omega t/m\omega\\ -m\omega\sin\omega t & \cos\omega t\end{pmatrix} has determinant 11 for all tt, and a 0.2×0.20.2\times0.2 phase patch evolved numerically keeps its area 0.04000.0400 to better than 10−1210^{-12} across t∈[0.5,10]t\in[0.5,10].*

Limiting cases

CaseResultMeaning
free particleq(t)=q0+p0t/mq(t)=q_0+p_0t/m, pp fixedpatch shears into a slanted strip; area unchanged (Jacobian =1=1)
harmonic oscillatorpatch rotates rigidly on ellipsesshape rotates, area frozen — the cleanest volume-preserving flow
generic chaotic HHpatch filaments without boundshape complexity grows forever; volume still exactly conserved
add friction γ\gamma∇⋅v=−γ<0\nabla\cdot\mathbf{v}=-\gamma<0volume shrinks onto an attractor — not Hamiltonian
coarse-grain the densityρˉ\bar\rho can spread; ScoarseS_{\text{coarse}} risesfine-grained ρ\rho frozen, but blurred ρˉ\bar\rho equilibrates

Worked examples

1 · A phase-space patch in a harmonic trap (confidence builder)

Take a single oscillator, H=p2/2m+12mω2q2H = p^2/2m + \tfrac12 m\omega^2 q^2, with m=1 kgm=1\ \mathrm{kg} and ω=1.3 s−1\omega = 1.3\ \mathrm{s^{-1}} (natural units). Start with a small square cloud of initial conditions spanning Δq=0.2\Delta q = 0.2 and Δp=0.2\Delta p = 0.2. Show its phase-space area is unchanged after evolving to t=1.7 st = 1.7\ \mathrm{s}, even though the square becomes a tilted parallelogram.

Step 1. Initial area. The starting cloud is a square: A0=Δq Δp=0.2×0.2=0.0400A_0 = \Delta q\,\Delta p = 0.2 \times 0.2 = \boxed{0.0400} in phase-space units.

Step 2. The flow. Each corner (q0,p0)(q_0,p_0) maps to q(t)=q0cos⁡ωt+(p0/mω)sin⁡ωtq(t) = q_0\cos\omega t + (p_0/m\omega)\sin\omega t, p(t)=−mωq0sin⁡ωt+p0cos⁡ωtp(t) = -m\omega q_0\sin\omega t + p_0\cos\omega t. This is a linear map with matrix M(t)=(cos⁡ωtsin⁡ωt/mω−mωsin⁡ωtcos⁡ωt)M(t) = \begin{pmatrix}\cos\omega t & \sin\omega t/m\omega\\ -m\omega\sin\omega t & \cos\omega t\end{pmatrix}.

Step 3. Area scaling factor. A linear map multiplies areas by ∣det⁡M∣|\det M|. Here det⁡M=cos⁡2ωt+sin⁡2ωt=1\det M = \cos^2\omega t + \sin^2\omega t = 1, for every tt — no ω\omega, mm, or tt survives.

Step 4. Final area. A(1.7)=∣det⁡M∣ A0=1×0.0400=0.0400A(1.7) = |\det M|\,A_0 = 1 \times 0.0400 = \boxed{0.0400}. The square has become a rotated, sheared parallelogram, but its area is untouched — a direct, hand-checkable instance of Liouville's theorem. Numerically evolving the four corners with a shoelace-area calculation confirms A(t)=0.0400A(t)=0.0400 to one part in 101210^{12} at t=0.5,1.7,3.9,t = 0.5, 1.7, 3.9, and 10.010.0.

2 · Compression forbidden: why a conservative gas has no attractor (exam level)

A dilute gas of NN molecules starts spread over a phase-space volume Γ0\Gamma_0. A student claims that after long times the gas "settles down" and its representative cloud shrinks to a much smaller volume Γ∞≪Γ0\Gamma_\infty \ll \Gamma_0, the way a damped pendulum settles to rest. Use Liouville's theorem to show this is impossible, and estimate how the claim would violate volume conservation for N=100N = 100 molecules.

Step 1. State what Liouville forbids. For an isolated (Hamiltonian) gas, the comoving volume is exactly conserved: Γ∞=Γ0\Gamma_\infty = \Gamma_0. Any genuine shrinkage Γ∞<Γ0\Gamma_\infty < \Gamma_0 requires ∇⋅v<0\nabla\cdot\mathbf{v} < 0 somewhere, i.e. a dissipative term absent from a closed system.

Step 2. Quantify the divergence a fake "settling" would need. If the cloud shrank by even a modest factor f=Γ∞/Γ0=0.1f = \Gamma_\infty/\Gamma_0 = 0.1 over a relaxation time τ\tau, the average divergence would have to be ⟨∇⋅v⟩=(ln⁡f)/τ=ln⁡(0.1)/τ≈−2.3/τ\langle\nabla\cdot\mathbf{v}\rangle = (\ln f)/\tau = \ln(0.1)/\tau \approx -2.3/\tau — strictly negative, and with no term in Hamilton's equations to supply it.

Step 3. The resolution. The gas does reach equilibrium in every practical sense, but its fine-grained volume does not shrink. Instead the cloud filaments through the accessible region until, to any coarse observer, it looks uniformly spread. The volume Γ0\Gamma_0 is conserved exactly; only the apparent (coarse-grained) volume grows toward the full accessible shell.

Step 4. Contrast with dissipation. A damped pendulum genuinely shrinks its phase volume because ∂p˙/∂p=−γ\partial\dot p/\partial p = -\gamma; its energy leaks into the environment. The isolated gas has no such leak — the settling is an illusion of coarse-graining, not a contraction of phase volume. This is the sharp dividing line between mechanics and thermodynamics, and it is why the second law lives in the coarse description.

Origins · 1 minpaul ehrenfest and how this was discovered
PE
paul ehrenfest
1880–1933 · Vienna, Leiden

Ehrenfest saw more clearly than anyone the puzzle that Liouville's theorem creates: if the phase fluid is exactly incompressible and volume-preserving, where does irreversibility come from? With his wife and collaborator Tatyana Ehrenfest he wrote the 1911 Encyclopädie article on the statistical-mechanical foundations that remains a model of conceptual honesty, and introduced the coarse-graining picture — the fine-grained density obeys Liouville's theorem and never spreads, but a blurred, cell-averaged density does spread and approach equilibrium, so the arrow of time lives in our coarse description, not in the flow. Their toy models, the dog-flea urn and the wind-tree gas, made Boltzmann's statistical arguments concrete enough to compute. Ehrenfest also coined "adiabatic invariant," bridging classical mechanics and the old quantum theory; his students at Leiden included Uhlenbeck, Goudsmit, and Kramers.

History
1838
— Liouville proves, in the theory of first-order differential equations, that a certain "last multiplier" is conserved along the flow — the abstract germ of the theorem.
1871
— Boltzmann uses volume-conservation arguments in phase space while developing kinetic theory and the ergodic idea.
1902
— Gibbs, in Elementary Principles in Statistical Mechanics, makes Liouville's theorem the foundation of stationary ensembles and coins "phase space" and "statistical mechanics."
1913
— Rosenthal and Plancherel sharpen the dimensional argument that a single trajectory cannot fill an energy shell, redirecting attention from literal ergodicity to invariant measures.
1931
— Birkhoff proves the pointwise ergodic theorem (von Neumann's mean ergodic theorem appears in print in 1932), giving Liouville's invariant measure its precise role in justifying ensemble averages.

Going further

Texts. Reif, Fundamentals of Statistical and Thermal Physics, §2.2 · Pathria & Beale, Statistical Mechanics, 3rd ed., §2.2–2.3 · Landau & Lifshitz, Statistical Physics Part 1, §3 · Goldstein, Poole & Safko, Classical Mechanics, 3rd ed., §9.9 (symplectic structure).

Provenance. Base article rigorous and retained; upgraded with intuition-first figures, worked examples, and history. A verifier should confirm: incompressibility ∇⋅v=0\nabla\cdot\mathbf{v}=0 for a general smooth HH (mixed-partial cancellation); the SHO flow-matrix determinant =1=1 for all tt; the free-particle shear Jacobian =1=1; the numerical area conservation of a 0.2×0.20.2\times0.2 patch to <10−12<10^{-12}; and d(ρln⁡ρ)/dt=0\mathrm{d}(\rho\ln\rho)/\mathrm{d}t=0 following from dρ/dt=0\mathrm{d}\rho/\mathrm{d}t=0. All checks pass in verify_aq-sm-liouville-theorem.py.

Prerequisites. Phase space · phase-space density and the distribution function · microstates and macrostates. Leads to. The Liouville equation (the PDE form, ∂tρ=−{ρ,H}\partial_t\rho = -\{\rho,H\}) · statistical ensembles (stationary ρ\rho as equilibrium) · the ergodic hypothesis (does one trajectory sample the whole shell?) · Gibbs entropy (why the fine-grained value is frozen).

If the density is "frozen," how can the gas ever reach equilibrium?

The frozen quantity is the fine-grained density — the value ρ\rho that a comoving, infinitely sharp-eyed observer would measure. That observer never sees equilibration; the cloud just filaments forever. Real equilibration is a statement about a coarse observer who cannot resolve threads thinner than some scale. Averaging ρ\rho over little cells gives ρˉ\bar\rho, and that blurred density spreads and settles. So there is no contradiction: mechanics keeps the fine-grained density frozen, and coarse-graining is what lets the macroscopic state relax.

Does Liouville's theorem depend on the system being harmonic or integrable?

No — that is its remarkable feature. Derivation A never uses the form of HH; it only uses that HH is smooth enough for its mixed partials to commute. So ∇⋅v=0\nabla\cdot\mathbf{v}=0 holds for a free particle, a harmonic oscillator, a chaotic three-body system, and a 102310^{23}-particle gas alike. Integrable systems have their patches rotate or shear tidily; chaotic ones filament wildly — but in every case the phase-space volume is conserved exactly.

What exactly is the difference between dρ/dt and ∂ρ/∂t here?

∂ρ/∂t\partial\rho/\partial t is the rate of change at a fixed point of phase space — fluid can flow in and out of that point, so it generally changes. dρ/dt\mathrm{d}\rho/\mathrm{d}t is the rate measured while riding along with the flow, and it includes the streaming term v⋅∇ρ\mathbf{v}\cdot\nabla\rho. Liouville's theorem says the comoving rate dρ/dt\mathrm{d}\rho/\mathrm{d}t is zero, which rearranges to ∂ρ/∂t=−v⋅∇ρ=−{ρ,H}\partial\rho/\partial t = -\mathbf{v}\cdot\nabla\rho = -\{\rho,H\} — the local rate is entirely due to a frozen profile streaming past.

If phase volume is conserved, why do people talk about "phase-space contraction" in dissipative systems?

Because dissipative systems are not Hamiltonian. The moment you add a friction term like p˙=−γp−∂V/∂q\dot p = -\gamma p - \partial V/\partial q, the divergence becomes ∇⋅v=−γ≠0\nabla\cdot\mathbf{v} = -\gamma \neq 0 and phase volume genuinely shrinks — trajectories collapse onto attractors. Liouville's theorem applies only to closed, conservative systems. The contraction rate is exactly the (negative) divergence, so measuring how fast an attractor forms tells you the dissipation rate.

Doesn't the second law say entropy increases? How is that consistent with dS_G/dt = 0?

The Gibbs entropy that is exactly conserved is the fine-grained one, SG=−kB ⁣∫ ⁣ρln⁡ρ dΓS_G = -k_B\!\int\!\rho\ln\rho\,\mathrm{d}\Gamma. The second-law entropy that increases is a coarse-grained quantity — you first blur ρ\rho to ρˉ\bar\rho, then compute −kB ⁣∫ ⁣ρˉln⁡ρˉ dΓ-k_B\!\int\!\bar\rho\ln\bar\rho\,\mathrm{d}\Gamma. Blurring can only raise this (it is a concavity/data-processing inequality), so the coarse entropy rises while the fine one sits still. The two entropies are genuinely different objects, and Liouville's theorem is precisely why you need the coarse one to get the second law.

Why is the "uniform on the energy shell" measure special?

Because it is stationary under the flow. Liouville's theorem guarantees that phase volume is conserved, so a density that is constant over the accessible energy shell — equal weight on equal volumes — stays constant in time: the flow shuffles microstates around but cannot pile probability up. That dynamical self-consistency is what lets the microcanonical ensemble sit at equilibrium, and it is the hidden justification for the postulate of equal a priori probabilities.

How does emittance in an accelerator relate to this theorem?

A particle beam is a cloud in phase space, and its "emittance" is essentially the phase-space area it occupies. Liouville's theorem says conservative beam optics — magnets, drift spaces, focusing — can rotate and shear that cloud but never shrink its area. So you cannot simultaneously make a beam narrow in position and narrow in momentum using passive optics; squeezing one spreads the other. Genuinely reducing emittance ("cooling") requires deliberately non-Hamiltonian, dissipative processes, which is exactly the term Liouville forbids in a closed system.

Before this

Where this leads