Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Boson-fermion partition function: states, modes, fermionic product, theta series

Definition
QseriesFormalization_Chapter05_BosonFermion

by FormallyCorrect · Oct 23, 2026 · Mathlib 0df444a (Lean v4.33.1)

chan-invitation-qseriescombinatoricsjacobi-triple-producttheta-functions

This bundle defines the boson-fermion partition function Z(q,z)=∑Szcharge(S)qenergy(S)Z(q,z)=\sum_S z^{\mathrm{charge}(S)}q^{\mathrm{energy}(S)}Z(q,z)=∑S​zcharge(S)qenergy(S) over admissible states, the added and removed mode weights zqn+1zq^{n+1}zqn+1 and z−1qn+1z^{-1}q^{n+1}z−1qn+1, finite and infinite fermionic products ∏n(1+zqn+1)(1+z−1qn+1)\prod_n(1+zq^{n+1})(1+z^{-1}q^{n+1})∏n​(1+zqn+1)(1+z−1qn+1), the Euler product ∏(1−qn+1)\prod(1-q^{n+1})∏(1−qn+1), the theta series ∑n∈Zznqn(n+1)/2\sum_{n\in\mathbb{Z}}z^nq^{n(n+1)/2}∑n∈Z​znqn(n+1)/2, and the product (q;q)∞(zq;q)∞(z−1q;q)∞(q;q)_\infty(zq;q)_\infty(z^{-1}q;q)_\infty(q;q)∞​(zq;q)∞​(z−1q;q)∞​ in the shifted convention. It also defines bounded (finite) versions of the state space: pair states, charge spectrum and charge sectors with their monomials and energy generating functions, and an equivalence between states and pairs of finite sets.

These definitions use Lean’s totalized operations: 0−1=00^{-1}=00−1=0, tsum is 000 for a nonsummable complex family, and tprod is 111 for a nonmultipliable complex family. Convergence is established separately under the parameter conditions of the relevant theorems.

Definition code
-- Generated by qseries-p2m/p2m/generate.py from QseriesFormalization.Chapter05_BosonFermion: skeleton subtraction
-- keeps 22 declaration(s); proofs kept; project imports -> Definitions bundles.
import Definitions.Def_QseriesFormalization_Chapter04_FranklinPentagonal
import Mathlib.Analysis.Normed.Group.Tannery
import Mathlib
import Mathlib.Analysis.SpecialFunctions.Log.Summable

/-!
# Chapter 5 Boson-Fermion partition function

This file adds the Chapter 5 partition-function layer on top of the
`AdmissibleState` setup in `Chapter05.lean`.

The global partition function is the formal/infinite sum over all admissible
states.  The closed proofs below are finite-mode versions: for modes
`0, ..., N - 1`, the state sum factors into the fermionic product over
single-mode occupations, and the same finite sum decomposes by charge sector.

The energy convention is the one already present in `Chapter05.lean`:
mode `n` contributes `n + 1`, avoiding half-powers.
-/

namespace QseriesFormalization
namespace PartI
namespace Ch04Franklin

open scoped BigOperators
open Filter
open scoped Topology

/-- Plural alias for the Chapter 5 state space used by the partition function. -/
abbrev AdmissibleStates := AdmissibleState

/-- The monomial attached to a state: `z^charge q^energy`. -/
noncomputable def stateMonomial (q z : ℂ) (S : AdmissibleStates) : ℂ :=
  z ^ charge S * q ^ energy S

/-- The full Boson-Fermion partition function over admissible states. -/
noncomputable def Z (q z : ℂ) : ℂ :=
  ∑' S : AdmissibleStates, stateMonomial q z S

/-- Contribution of occupying a positive mode `n`. -/
noncomputable def addedModeWeight (q z : ℂ) (n : Nat) : ℂ :=
  z * q ^ (n + 1)

/-- Contribution of creating a hole in negative mode `n`. -/
noncomputable def removedModeWeight (q z : ℂ) (n : Nat) : ℂ :=
  z⁻¹ * q ^ (n + 1)

/-- The two fermionic occupation choices at one added mode. -/
noncomputable def addedFermionPartial (N : Nat) (q z : ℂ) : ℂ :=
  ∏ n ∈ Finset.range N, (1 + addedModeWeight q z n)

/-- The two fermionic occupation choices at one removed mode. -/
noncomputable def removedFermionPartial (N : Nat) (q z : ℂ) : ℂ :=
  ∏ n ∈ Finset.range N, (1 + removedModeWeight q z n)

/-- Factorized finite fermionic product, separated into added and removed modes. -/
noncomputable def fermionicProductPartial (N : Nat) (q z : ℂ) : ℂ :=
  addedFermionPartial N q z * removedFermionPartial N q z

/-- The complete one-mode fermionic factor. -/
noncomputable def fermionicModeFactor (q z : ℂ) (n : Nat) : ℂ :=
  (1 + addedModeWeight q z n) * (1 + removedModeWeight q z n)

/-- Infinite fermionic product suggested by the finite-mode evaluation. -/
noncomputable def fermionicProduct (q z : ℂ) : ℂ :=
  ∏' n : Nat, fermionicModeFactor q z n

/-- Euler factor that converts the fermionic partition function to the
Jacobi-type product in the current integer-energy convention. -/
noncomputable def bosonEulerProduct (q : ℂ) : ℂ :=
  ∏' n : Nat, (1 - q ^ (n + 1))

/-- Theta series in the current integer-energy convention. -/
noncomputable def bosonFermionThetaSeries (q z : ℂ) : ℂ :=
  ∑' n : Int, z ^ n * q ^ (n * (n + 1) / 2)

/-- Finite state sum over subsets of the first `N` added and removed modes. -/
noncomputable def finiteZ (N : Nat) (q z : ℂ) : ℂ :=
  ∑ A ∈ (Finset.range N).powerset, ∑ R ∈ (Finset.range N).powerset,
    stateMonomial q z ⟨A, R⟩

/-- A bounded state represented as the pair `(added, removed)`. -/
noncomputable def boundedStatePairs (N : Nat) : Finset (Finset Nat × Finset Nat) :=
  (Finset.range N).powerset.product (Finset.range N).powerset

/-- Charge of a bounded pair-state. -/
def pairCharge (p : Finset Nat × Finset Nat) : Int :=
  charge ⟨p.1, p.2⟩

/-- Monomial of a bounded pair-state. -/
noncomputable def pairMonomial (q z : ℂ) (p : Finset Nat × Finset Nat) : ℂ :=
  stateMonomial q z ⟨p.1, p.2⟩

/-- The state space is equivalent to pairs of added/removed finite sets. -/
def admissibleStatesEquivPairs : AdmissibleStates ≃ Finset Nat × Finset Nat where
  toFun S := (S.added, S.removed)
  invFun p := ⟨p.1, p.2⟩
  left_inv := by
    intro S
    cases S
    rfl
  right_inv := by
    intro p
    cases p
    rfl

/-- Energy-only monomial of a bounded pair-state. -/
noncomputable def pairEnergyMonomial (q : ℂ) (p : Finset Nat × Finset Nat) : ℂ :=
  q ^ energy ⟨p.1, p.2⟩

/-- The finite set of charge values appearing among states bounded by `N`. -/
noncomputable def finiteChargeSpectrum (N : Nat) : Finset Int :=
  (boundedStatePairs N).image pairCharge

/-- Finite charge sector in the bounded state sum. -/
noncomputable def finiteChargeSector (N : Nat) (q z : ℂ) (c : Int) : ℂ :=
  ∑ p ∈ boundedStatePairs N with pairCharge p = c, pairMonomial q z p

/-- Energy generating function inside one finite charge sector. -/
noncomputable def finiteChargeEnergySector (N : Nat) (q : ℂ) (c : Int) : ℂ :=
  ∑ p ∈ boundedStatePairs N with pairCharge p = c, pairEnergyMonomial q p

/-! ### Infinite fermionic side -/

/-! ### Boson-Fermion product side as Jacobi's triple product -/

/-- Product side `(q, zq, z⁻¹q; q)_∞` in the shifted JTP convention. -/
noncomputable def shiftedJTPProduct (q z : ℂ) : ℂ :=
  (∏' n : Nat, (1 - q ^ (n + 1))) *
    (∏' n : Nat, (1 - z * q ^ (n + 1))) *
      (∏' n : Nat, (1 - z⁻¹ * q ^ (n + 1)))

end Ch04Franklin
end PartI
end QseriesFormalization
Source
Lean formalization (Xiang Huang) of Hei-Chi Chan, An Invitation to q-Series: From Jacobi's Triple Product Identity to Ramanujan's "Most Beautiful Identity" (World Scientific, 2011), Chapter 5. Lean source: https://github.com/xiangyazi24/invitation-to-qseries-lean/blob/5df34b280b6a9c4a68ab09105b4e5d3c7bbe88d1/QseriesFormalization/Chapter05_BosonFermion.lean (definitions of this module that the uploaded theorems need; ported to Lean v4.33.1 / Mathlib 0df444a).

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me