Documentation

CsdLean4.Thermo.Jarzynski

TH5a: the Jarzynski equality, two-point-measurement form #

Category: 3-Local (conceptually 1-Mathlib; CSD-free finite-dimensional quantum statistical mechanics) with a CSD reading; kept in the CSD.Thermo tree alongside TH1–TH4 (specs/thermo-plan.md TH5; specs/BACKLOG.md ▶ OPEN QUEUE #1).

Glossary: https://glossary.constraintsurfacedynamics.com/jarzynski-equality/

A finite quantum system with Hamiltonian H₀ starts in the Gibbs state ρ_β = e^{−βH₀}/Z₀ (TH3, gibbsState). The two-point-measurement protocol: measure the energy — outcome i, the eigenvalue E₀ i of H₀, with Born probability the Gibbs weight e^{−βE₀ i}/Z₀; drive the system by a unitary U while its Hamiltonian becomes H₁; measure the energy again — outcome j, the eigenvalue E₁ j of H₁, with Born probability ‖⟨e₁ j, U e₀ i⟩‖². The work done on the system in that run is W = E₁ j − E₀ i. The Jarzynski equality (1997) says that the exponential average of the work over the protocol is a state function of the two endpoints,

⟨e^{−βW}⟩ = Z₁/Z₀ = e^{−βΔF}, ΔF = F₁ − F₀ = −β⁻¹ (log Z₁ − log Z₀),

an equality valid arbitrarily far from equilibrium, whose Jensen consequence ⟨W⟩ ≥ ΔF is the second law for the process (TH2 is its entropy-facing twin). The proof is bookkeeping once the transition matrix is seen to be doubly stochastic: the Gibbs factor e^{−βE₀ i} cancels against the e^{+βE₀ i} inside e^{−βW}, and the sums of ‖⟨e₁ j, U e₀ i⟩‖² over i are 1 by unitarity, leaving ∑ⱼ e^{−βE₁ j}/Z₀.

Main results #

CSD reading #

The protocol's two readouts are records; the Gibbs weights are the Born weights of the first readout in the equilibrium preparation, and the transition probabilities the Born weights of the second after a unitary de-isolation. On the sector the same statement is the two-time record law of RecordLayer/TwoTimeLuders.lean under a Gibbs preparation measure and the Schrödinger flow (the Hamiltonian flow of ⟨H⟩, Q29(e)); that instantiation is the priced row TH5d (specs/BACKLOG.md ▶ OPEN QUEUE #4). This file is the bare-matrix theorem it consumes.

Honest scope #

Finite-dimensional, projective energy measurements with the eigenbases chosen by Matrix.IsHermitian.eigenvectorBasis (degenerate spectra are allowed: the equality sums over eigenvectors, not over distinct eigenvalues, and the transition weights are those of the chosen bases). The work is the two-point-measurement work E₁ j − E₀ i, the standard definition for closed driven systems; ΔF is the difference of the equilibrium free energies of H₁ and H₀ at the same β. No bath, no heat: the driven system is closed, so W = ΔE. Requires [Nonempty n] where a Gibbs state is involved (TH3's hypothesis).

Provenance #

Foundational-triple only (propext, Classical.choice, Quot.sound); no sorry, no new axioms. Consumes TH3 (gibbsState, partitionFn, gibbs_free_energy_eq) and Mathlib's spectral theorem and convexOn_exp; nothing is re-proved.

Unitaries are doubly stochastic in modulus squared #

theorem CSD.Thermo.sum_norm_sq_col_eq_one {n : Type u_1} [Fintype n] [DecidableEq n] (M : ↥(Matrix.unitaryGroup n ℂ)) (i : n) :
∑ j : n, ‖↑M j i‖ ^ 2 = 1

Entry (i, i) of Mᴴ M = 1: the squared moduli down a column of a unitary sum to 1.

theorem CSD.Thermo.sum_norm_sq_row_eq_one {n : Type u_1} [Fintype n] [DecidableEq n] (M : ↥(Matrix.unitaryGroup n ℂ)) (j : n) :
∑ i : n, ‖↑M j i‖ ^ 2 = 1

Entry (j, j) of M Mᴴ = 1: the squared moduli along a row of a unitary sum to 1.

The transition matrix of the protocol #

noncomputable def CSD.Thermo.tpmUnitary {n : Type u_1} [Fintype n] [DecidableEq n] {H₀ H₁ : Matrix n n ℂ} (hH₀ : H₀.IsHermitian) (hH₁ : H₁.IsHermitian) (U : ↥(Matrix.unitaryGroup n ℂ)) :

The process U read between the eigenbases of H₀ and H₁: V₁ᴴ U V₀, with V_k the eigenvector unitary of H_k. Its (j, i) entry is the amplitude ⟨e₁ j, U e₀ i⟩ (tpmUnitary_apply).

Equations
Instances For
    theorem CSD.Thermo.tpmUnitary_coe {n : Type u_1} [Fintype n] [DecidableEq n] {H₀ H₁ : Matrix n n ℂ} (hH₀ : H₀.IsHermitian) (hH₁ : H₁.IsHermitian) (U : ↥(Matrix.unitaryGroup n ℂ)) :
    ↑(tpmUnitary hH₀ hH₁ U) = star ↑hH₁.eigenvectorUnitary * ↑U * ↑hH₀.eigenvectorUnitary
    theorem CSD.Thermo.tpmUnitary_apply {n : Type u_1} [Fintype n] [DecidableEq n] {H₀ H₁ : Matrix n n ℂ} (hH₀ : H₀.IsHermitian) (hH₁ : H₁.IsHermitian) (U : ↥(Matrix.unitaryGroup n ℂ)) (i j : n) :
    ↑(tpmUnitary hH₀ hH₁ U) j i = star (hH₁.eigenvectorBasis j).ofLp ⬝ᵥ (↑U).mulVec (hH₀.eigenvectorBasis i).ofLp

    The (j, i) entry of V₁ᴴ U V₀ is the transition amplitude ⟨e₁ j, U e₀ i⟩ from the i-th eigenvector of H₀ to the j-th eigenvector of H₁.

    noncomputable def CSD.Thermo.tpmTransition {n : Type u_1} [Fintype n] [DecidableEq n] {H₀ H₁ : Matrix n n ℂ} (hH₀ : H₀.IsHermitian) (hH₁ : H₁.IsHermitian) (U : ↥(Matrix.unitaryGroup n ℂ)) (i j : n) :

    The transition probability of the protocol from energy outcome i of H₀ to energy outcome j of H₁: ‖⟨e₁ j, U e₀ i⟩‖², the Born weight of the second readout in the post-first-readout state U e₀ i.

    Equations
    Instances For
      theorem CSD.Thermo.tpmTransition_eq {n : Type u_1} [Fintype n] [DecidableEq n] {H₀ H₁ : Matrix n n ℂ} (hH₀ : H₀.IsHermitian) (hH₁ : H₁.IsHermitian) (U : ↥(Matrix.unitaryGroup n ℂ)) (i j : n) :
      tpmTransition hH₀ hH₁ U i j = ‖star (hH₁.eigenvectorBasis j).ofLp ⬝ᵥ (↑U).mulVec (hH₀.eigenvectorBasis i).ofLp‖ ^ 2
      theorem CSD.Thermo.tpmTransition_nonneg {n : Type u_1} [Fintype n] [DecidableEq n] {H₀ H₁ : Matrix n n ℂ} (hH₀ : H₀.IsHermitian) (hH₁ : H₁.IsHermitian) (U : ↥(Matrix.unitaryGroup n ℂ)) (i j : n) :
      0 ≤ tpmTransition hH₀ hH₁ U i j
      theorem CSD.Thermo.sum_tpmTransition_left {n : Type u_1} [Fintype n] [DecidableEq n] {H₀ H₁ : Matrix n n ℂ} (hH₀ : H₀.IsHermitian) (hH₁ : H₁.IsHermitian) (U : ↥(Matrix.unitaryGroup n ℂ)) (i : n) :
      ∑ j : n, tpmTransition hH₀ hH₁ U i j = 1

      Stochastic in the final outcome: for each initial outcome i, the transition probabilities over j sum to 1.

      theorem CSD.Thermo.sum_tpmTransition_right {n : Type u_1} [Fintype n] [DecidableEq n] {H₀ H₁ : Matrix n n ℂ} (hH₀ : H₀.IsHermitian) (hH₁ : H₁.IsHermitian) (U : ↥(Matrix.unitaryGroup n ℂ)) (j : n) :
      ∑ i : n, tpmTransition hH₀ hH₁ U i j = 1

      Doubly stochastic: for each final outcome j, the transition probabilities over the initial outcome i also sum to 1 — unitarity in the other order. This is the identity that makes the Jarzynski average a state function.

      The Gibbs weights are the Born weights of the first readout #

      theorem CSD.Thermo.sum_gibbsWeight_eigenvalues {n : Type u_1} [Fintype n] [DecidableEq n] [Nonempty n] (H : Matrix n n ℂ) (hH : H.IsHermitian) (β : ℝ) :
      ∑ i : n, gibbsWeight H hH β (hH.eigenvalues i) = 1

      The Gibbs weights over the spectrum sum to 1.

      theorem CSD.Thermo.gibbsState_mulVec_eigenvectorBasis {n : Type u_1} [Fintype n] [DecidableEq n] (H : Matrix n n ℂ) (hH : H.IsHermitian) (β : ℝ) (i : n) :

      The eigenvectors of H are eigenvectors of the Gibbs state, with eigenvalue the Gibbs weight of the energy: ρ_β e_i = (e^{−βE_i}/Z) e_i.

      The eigenvectors are unit vectors: entry (i, i) of V₀ᴴ V₀ = 1.

      theorem CSD.Thermo.gibbsWeight_eq_re_born {n : Type u_1} [Fintype n] [DecidableEq n] (H : Matrix n n ℂ) (hH : H.IsHermitian) (β : ℝ) (i : n) :

      The Gibbs weight is a Born probability: e^{−βE_i}/Z = Re ⟨e_i, ρ_β e_i⟩, the probability of the energy outcome i when the Gibbs state is measured in the eigenbasis of H.

      The joint law and the work #

      noncomputable def CSD.Thermo.tpmLaw {n : Type u_1} [Fintype n] [DecidableEq n] {H₀ H₁ : Matrix n n ℂ} (hH₀ : H₀.IsHermitian) (hH₁ : H₁.IsHermitian) (U : ↥(Matrix.unitaryGroup n ℂ)) (β : ℝ) (i j : n) :

      The joint law of the two readouts: the Gibbs weight of the first outcome times the transition probability to the second.

      Equations
      Instances For
        theorem CSD.Thermo.tpmLaw_nonneg {n : Type u_1} [Fintype n] [DecidableEq n] {H₀ H₁ : Matrix n n ℂ} [Nonempty n] (hH₀ : H₀.IsHermitian) (hH₁ : H₁.IsHermitian) (U : ↥(Matrix.unitaryGroup n ℂ)) (β : ℝ) (i j : n) :
        0 ≤ tpmLaw hH₀ hH₁ U β i j
        theorem CSD.Thermo.sum_tpmLaw {n : Type u_1} [Fintype n] [DecidableEq n] {H₀ H₁ : Matrix n n ℂ} [Nonempty n] (hH₀ : H₀.IsHermitian) (hH₁ : H₁.IsHermitian) (U : ↥(Matrix.unitaryGroup n ℂ)) (β : ℝ) :
        ∑ i : n, ∑ j : n, tpmLaw hH₀ hH₁ U β i j = 1

        The joint law is a probability law on the outcome pairs.

        noncomputable def CSD.Thermo.tpmWork {n : Type u_1} [Fintype n] [DecidableEq n] {H₀ H₁ : Matrix n n ℂ} (hH₀ : H₀.IsHermitian) (hH₁ : H₁.IsHermitian) (i j : n) :

        The two-point-measurement work on the outcome pair (i, j): E₁ j − E₀ i, the energy difference between the two readouts (the system is closed, so this is the work done on it).

        Equations
        Instances For

          The Jarzynski equality #

          theorem CSD.Thermo.jarzynski {n : Type u_1} [Fintype n] [DecidableEq n] {H₀ H₁ : Matrix n n ℂ} [Nonempty n] (hH₀ : H₀.IsHermitian) (hH₁ : H₁.IsHermitian) (U : ↥(Matrix.unitaryGroup n ℂ)) (β : ℝ) :
          ∑ i : n, ∑ j : n, tpmLaw hH₀ hH₁ U β i j * Real.exp (-β * tpmWork hH₀ hH₁ i j) = partitionFn H₁ hH₁ β / partitionFn H₀ hH₀ β

          TH5a — the Jarzynski equality. The exponential average of the two-point-measurement work over the protocol is the ratio of the partition functions of the final and initial Hamiltonians, ⟨e^{−βW}⟩ = Z₁/Z₀, whatever the driving unitary U. The Gibbs factor of the first readout cancels the e^{+βE₀ i} in e^{−βW}, and the transition matrix is doubly stochastic (sum_tpmTransition_right).

          theorem CSD.Thermo.jarzynski_freeEnergy {n : Type u_1} [Fintype n] [DecidableEq n] {H₀ H₁ : Matrix n n ℂ} [Nonempty n] (hH₀ : H₀.IsHermitian) (hH₁ : H₁.IsHermitian) (U : ↥(Matrix.unitaryGroup n ℂ)) {β : ℝ} (hβ : 0 < β) :
          ∑ i : n, ∑ j : n, tpmLaw hH₀ hH₁ U β i j * Real.exp (-β * tpmWork hH₀ hH₁ i j) = Real.exp (-β * (freeEnergy H₁ β⁻¹ ⋯ - freeEnergy H₀ β⁻¹ ⋯))

          The Jarzynski equality in free-energy form: ⟨e^{−βW}⟩ = e^{−β(F₁ − F₀)}, with F_k the TH3 equilibrium free energy −β⁻¹ log Z_k of the Gibbs state of H_k at temperature β⁻¹ (gibbs_free_energy_eq).

          theorem CSD.Thermo.mean_work_ge_freeEnergy_sub {n : Type u_1} [Fintype n] [DecidableEq n] {H₀ H₁ : Matrix n n ℂ} [Nonempty n] (hH₀ : H₀.IsHermitian) (hH₁ : H₁.IsHermitian) (U : ↥(Matrix.unitaryGroup n ℂ)) {β : ℝ} (hβ : 0 < β) :
          freeEnergy H₁ β⁻¹ ⋯ - freeEnergy H₀ β⁻¹ ⋯ ≤ ∑ i : n, ∑ j : n, tpmLaw hH₀ hH₁ U β i j * tpmWork hH₀ hH₁ i j

          The second law of the driven process (Jensen on the Jarzynski equality): the mean two-point-measurement work is at least the free-energy difference, ΔF ≤ ⟨W⟩. Convexity of exp gives e^{−β⟨W⟩} ≤ ⟨e^{−βW}⟩ = e^{−βΔF}.