InformationTheory.Shannon.MaxEntropy.ConstrainedKKT
Constrained Maximum Entropy — Lagrange / KKT perspective #
The Boltzmann–Gibbs main theorems (entropy_le_gibbs_of_constraints,
entropy_eq_gibbs_iff_of_constraints), stated in the gibbsPmf f λ notation, are
recast here in the KKT / exponential-family language:
expFamilyDist λ f x := exp (⟨λ, f x⟩ - ψ(λ)) logPartitionψ λ f := log (∑ y, exp ⟨λ, f y⟩)
with ψ(λ) = logPartitionψ the log-partition function. The two presentations
are equal pointwise (expFamilyDist_eq_gibbsPmf), so every property of gibbsPmf
transports to expFamilyDist. The KKT first-order condition (∇ψ(λ) = 𝔼[f] in
the unconstrained Lagrangian) appears as the moment-matching hypothesis
which we pass through (Mathlib lacks the convex-duality theorems needed to
solve for λ; it does have everything we need to use a given solution).
Main definitions #
logPartitionψ— log-partition functionψ(λ)expFamilyDist— exponential-family pmfx ↦ exp (⟨λ, f x⟩ - ψ(λ))KKTSolution— packaged Lagrange multiplier + moment witness
Main statements #
expFamilyDist_eq_gibbsPmf— bridgeexpFamilyDist = gibbsPmfexpFamilyDist_mem_stdSimplex—expFamilyDist λ f ∈ stdSimplexexpFamilyDist_pos— pointwise strict positivityentropy_expFamilyDist_eq_legendre— Legendre identityH(p*) = ψ(λ) - ⟨λ, c⟩expFamily_maximizes_entropy— constraint-respectingPsatisfiesH(P) ≤ H(expFamilyDist λ f)expFamily_unique— equality ⟺P = expFamilyDist λ fexpFamily_maximizes_entropy_of_KKT— upper bound in theKKTSolutionpackagingentropy_le_logPartition_sub_inner— variational formH(P) ≤ ψ(λ) - ⟨λ, c⟩
Approach #
We define logPartitionψ and expFamilyDist via the existing gibbsZ and
gibbsPmf (a single Real.exp_sub step bridges the two presentations). All
theorems are then proved by direct reduction to their gibbsPmf analogues in
MaxEntropy/Constrained.lean. The KKT first-order condition is encoded as the
constraint-witness hypothesis ∀ i, ∑ x, expFamilyDist λ f x · f i x = c i
(equivalent to ∇ψ(λ) = 𝔼_{p*}[f] at the saddle point, but stated in the
ansatz-pass-through form to avoid the convex-duality theorems Mathlib does
not provide).
References #
- T. M. Cover and J. A. Thomas, Elements of Information Theory (2nd ed.), Wiley, 2006.
Section 1 — Log-partition function and exponential-family pmf #
InformationTheory.Shannon.MaxEntropyConstrainedKKT.logPartitionψ
sourceLog-partition function ψ(λ) := log (∑ y, exp ⟨λ, f y⟩).
In the Lagrangian for constrained maximum entropy, ψ(λ) is the Legendre dual
of H and its gradient ∇ψ(λ) = 𝔼_{p_λ^*}[f] encodes the KKT first-order
condition (moment matching).
Equations
Instances For
Used by
InformationTheory.Shannon.MaxEntropyConstrainedKKT.expFamilyDist
sourceExponential family pmf, Lagrangian / KKT-canonical form:
expFamilyDist λ f x := exp (⟨λ, f x⟩ - ψ(λ))
where ⟨λ, f x⟩ = ∑ i, λ i · f i x. This is the saddle-point optimizer of the
Lagrangian L(p, λ) = H(p) + ∑ i, λ i (𝔼_p[f i] - c i). By
expFamilyDist_eq_gibbsPmf it agrees pointwise with gibbsPmf f λ, so all
positivity / pmf properties transfer.
Equations
- InformationTheory.Shannon.MaxEntropyConstrainedKKT.expFamilyDist f lam x = Real.exp (∑ i : Fin k, lam i * f i x - InformationTheory.Shannon.MaxEntropyConstrainedKKT.logPartitionψ f lam)
Instances For
Used by
InformationTheory.Shannon.MaxEntropyConstrainedKKT.expFamilyDist_eq_gibbsPmf
sourceBridge: the KKT-canonical form expFamilyDist agrees pointwise with the
Boltzmann–Gibbs form gibbsPmf:
exp (⟨λ, f x⟩ - ψ(λ)) = exp ⟨λ, f x⟩ / Z(λ).
Proof: Real.exp_sub + Real.exp_log on Z(λ) > 0.
Used by
Section 2 — Basic positivity / pmf properties transported from gibbsPmf #
InformationTheory.Shannon.MaxEntropyConstrainedKKT.expFamilyDist_pos
sourceexpFamilyDist is pointwise strictly positive.
Used by
InformationTheory.Shannon.MaxEntropyConstrainedKKT.expFamilyDist_mem_stdSimplex
sourceexpFamilyDist λ f ∈ stdSimplex ℝ α.
Used by
Section 3 — KKT solution packaging #
InformationTheory.Shannon.MaxEntropyConstrainedKKT.KKTSolution
sourceKKT solution for the constrained maximum-entropy problem with feature
maps f : Fin k → α → ℝ and moment targets c : Fin k → ℝ.
A KKTSolution f c packages a Lagrange multiplier vector lam : Fin k → ℝ
with a proof that the exponential-family ansatz expFamilyDist f lam satisfies
the moment-matching first-order condition 𝔼_{p*}[f i] = c i for all i.
This is precisely the KKT condition for the Lagrangian
L(p, λ) = H(p) + ∑ i, λ i (𝔼_p[f i] - c i): stationarity in p picks out
the exponential family, and feasibility in λ is the moment match.
Lagrange multiplier (one per feature / constraint).
KKT moment-matching condition —
∇ψ(λ) = c, equivalently𝔼_{p*}[f i] = c ifor alli.
Instances For
Used by
InformationTheory.Shannon.MaxEntropyConstrainedKKT.KKTSolution.gibbs_moment_match
sourceKKT-solution moment matching restated in the gibbsPmf language.
Used by
Section 4 — Legendre identity: self-entropy of the exponential family #
InformationTheory.Shannon.MaxEntropyConstrainedKKT.entropy_expFamilyDist_eq_legendre
sourceLegendre / saddle-point identity for the exponential family. With KKT
solution (λ, moment_match) for constraints c, the entropy of the
exponential-family optimum has the closed form
H(p*) = ψ(λ) - ⟨λ, c⟩.
This is the KKT duality: at the saddle point of the Lagrangian, the primal value
equals the dual value ψ(λ) - ⟨λ, c⟩.
Used by
Section 5 — Main theorem: exponential family maximizes constrained entropy #
InformationTheory.Shannon.MaxEntropyConstrainedKKT.expFamily_maximizes_entropy
sourceMaximum entropy theorem (upper bound, KKT form): under moment constraints
𝔼_P[f i] = c i for all i, the entropy of P is bounded above by the entropy of the
exponential-family solution expFamilyDist f λ, provided the latter also satisfies the
same moments (KKT first-order condition).
Used by
InformationTheory.Shannon.MaxEntropyConstrainedKKT.expFamily_maximizes_entropy_of_KKT
sourceMaximum entropy theorem (upper bound, KKTSolution form): a constraint-feasible
P cannot exceed the entropy of the exponential-family solution attached to a KKT
witness.
See also expFamily_maximizes_entropy.
Used by
Section 6 — Uniqueness of the exponential-family maximizer #
InformationTheory.Shannon.MaxEntropyConstrainedKKT.expFamily_unique
sourceMaximum entropy theorem (uniqueness, KKT form): for constraint-feasible P and a
KKT-witnessed exponential-family solution, entropy equality
H(P) = H(expFamilyDist f λ) holds if and only if P = expFamilyDist f λ pointwise.
Used by
InformationTheory.Shannon.MaxEntropyConstrainedKKT.expFamily_unique_of_KKT
sourceMaximum entropy theorem (uniqueness, KKTSolution form): entropy equality holds
if and only if P = expFamilyDist f λ pointwise.
See also expFamily_unique.
Used by
Section 7 — Variational form (free-energy / Legendre dual upper bound) #
InformationTheory.Shannon.MaxEntropyConstrainedKKT.entropy_le_logPartition_sub_inner
sourceVariational upper bound (Legendre / free-energy form) — any constraint-feasible
P satisfies the dual bound
H(P) ≤ ψ(λ) - ⟨λ, c⟩
for every λ whose exponential-family solution satisfies the same moments.
This is the variational characterization of logPartitionψ as the Legendre
transform of -H restricted to the feasibility set.
Used by
InformationTheory.Shannon.MaxEntropyConstrainedKKT.entropy_le_logPartition_sub_inner_of_KKT
sourceKKT-packaged variational form.
Used by
Section 8 — KKT first-order moment-matching reformulation #
InformationTheory.Shannon.MaxEntropyConstrainedKKT.KKT_moment_match_iff_gibbs_moment_match
sourceKKT first-order condition equivalence — the moment-matching hypothesis
𝔼_{p*}[f] = c (the gradient-of-ψ condition ∇ψ(λ) = c) is equivalent to
the gibbs ansatz satisfying the same constraint as P. This is the formal
content of "KKT stationarity in λ".
Used by
Section 9 — Stationarity expansion: log-pmf is affine in features #
Section 10 — Tier 3 stretch: zero-multiplier reduction = uniform #
InformationTheory.Shannon.MaxEntropyConstrainedKKT.expFamilyDist_lam_zero_eq
sourceKKT zero-multiplier reduction: expFamilyDist f 0 = expFamilyDist g 0
for any features f, g (both equal to the uniform pmf). This is the
unconstrained-Lagrangian degenerate case λ = 0.