AFTD Auto-Formalizing Theoretical Domains

boltzmann_distribution_sum_eq_one

theoremverifiedformalization

For any nonempty finite configuration space Ω, Hamiltonian H : Ω → ℝ, and inverse temperature β, the sum of the Boltzmann distribution over all configurations is equal to 1.

Statement

theorem boltzmann_distribution_sum_eq_one {Ω : Type*} [Fintype Ω] [Nonempty Ω] (H : Ω → ℝ) (β : ℝ) :
    ∑ ω : Ω, boltzmannDistribution H β ω = 1
Formalizes
Friedli & Velenik, Statistical Mechanics of Lattice Systems (2017), Section 1.2
Verified
06 Oct 2026
Axioms
Classical.choiceQuot.soundpropext
Built on 2
  • boltzmannDistributionThe Boltzmann (Gibbs) distribution on a finite configuration space Ω with Hamiltonian H : Ω → ℝ at inverse temperature β assigns to each…
  • canonical_partition_function_posFor any nonempty finite configuration space Ω, Hamiltonian H : Ω → ℝ, and inverse temperature β, the canonical partition function is…

Read back from the Lean

For every finite, nonempty type Ω, every function H : Ω → ℝ, and every real number β, the sum over all ω : Ω of boltzmannDistribution H β ω equals 1.

Written by a model that saw only the Lean, never the English above. If the two disagree, that is worth a challenge.

The proof, explained

The proof expands the Boltzmann distribution into the ratio of the Boltzmann factor $\exp(-\beta H(\omega))$ to the canonical partition function $Z = \sum_{\omega} \exp(-\beta H(\omega))$. Factoring the common denominator $Z$ out of the sum reduces the total sum to $Z / Z$. Since $\Omega$ is finite and nonempty, $Z$ is strictly positive, hence nonzero, which allows simplifying $Z / Z$ to 1.

  1. The canonical partition function is strictly positive: $Z > 0$.

    By `canonical_partition_function_pos`, the partition function $Z = \sum_{\omega \in \Omega} \exp(-\beta H(\omega))$ is strictly positive because the state space $\Omega$ is finite and nonempty, and each exponential term is positive.

    line 4

    uses canonical_partition_function_pos

      have hpos := canonical_partition_function_pos H β
  2. The sum of the Boltzmann probabilities factors into the unnormalized sum divided by the partition function: $\frac{\sum_{\omega \in \Omega} \exp(-\beta H(\omega))}{Z} = 1$.

    Unfolding the definition of `boltzmannDistribution` expresses each probability as $\exp(-\beta H(\omega)) / Z$. Applying `Finset.sum_div` in reverse factors the common denominator $Z$ out of the finite sum.

    lines 5–6

    uses Finset.sum_div

      dsimp [boltzmannDistribution]
      rw [← Finset.sum_div]
  3. The quotient of the partition function by itself equals 1.

    The numerator is definitionally the canonical partition function $Z$. Since $Z > 0$ implies $Z \neq 0$, the quotient $Z / Z$ evaluates to 1 by `div_self`.

    line 7

    uses div_self

      exact div_self hpos.ne'
canonical_partition_function_pos
For any finite, nonempty configuration space $\Omega$, the canonical partition function $\sum_{\omega \in \Omega} \exp(-\beta H(\omega))$ is strictly positive.
Finset.sum_div
A common divisor can be factored out of a finite sum: $\sum_{i \in s} (f(i) / a) = (\sum_{i \in s} f(i)) / a$.
div_self
Any nonzero element divided by itself equals 1: if $a \neq 0$, then $a / a = 1$.

Written by a model (gemini-3.8-flash) from the Lean proof and the goal states Lean reported at each step. Lean verified the proof; this explanation is a reading aid and is not itself machine-checked.

Lean source view module on GitHub

/-- The Boltzmann distribution sums to 1 over the configuration space. -/theorem boltzmann_distribution_sum_eq_one {Ω : Type*} [Fintype Ω] [Nonempty Ω] (H : Ω → ℝ) (β : ℝ) :    ∑ ω : Ω, boltzmannDistribution H β ω = 1 := by  have hpos := canonical_partition_function_pos H β  dsimp [boltzmannDistribution]  rw [← Finset.sum_div]  exact div_self hpos.ne'
See it in the graphDiscuss this resultChallenge it