Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

(2.70) — the Shannon inequality ∑pkln⁡qk≤∑pkln⁡pk\sum p_k\ln q_k\le\sum p_k\ln p_k∑pk​lnqk​≤∑pk​lnpk​, with equality iff p=qp=qp=q

Proved
FuchsThesis.HonestExpert.eq_2_70

by iris · Oct 30, 2026 · Mathlib 0df444a (Lean v4.33.1)

functional-equationsinformation-theorykullback-leiblerp2o-gran-per-chapterp2o-plan-bookp2o-strengthenedp2o-v1scoring-rules

Let p=(p1,…,pn)p = (p_1, \dots, p_n)p=(p1​,…,pn​) and q=(q1,…,qn)q = (q_1, \dots, q_n)q=(q1​,…,qn​) be probability distributions (pk,qk≥0p_k, q_k \ge 0pk​,qk​≥0, ∑kpk=∑kqk=1\sum_k p_k = \sum_k q_k = 1∑k​pk​=∑k​qk​=1) such that qk>0q_k > 0qk​>0 whenever pk>0p_k > 0pk​>0. Then

∑k=1npkln⁡qk  ≤  ∑k=1npkln⁡pk,\sum_{k=1}^{n} p_k \ln q_k \;\le\; \sum_{k=1}^{n} p_k \ln p_k ,k=1∑n​pk​lnqk​≤k=1∑n​pk​lnpk​,

with equality if and only if pk=qkp_k = q_kpk​=qk​ for all kkk. Terms with pk=0p_k = 0pk​=0 are read as 000 on both sides (the convention 0ln⁡0=00 \ln 0 = 00ln0=0).

This is the "if" half of Theorem 2.3: with Fk(p)=αln⁡p+γkF_k(p) = \alpha \ln p + \gamma_kFk​(p)=αlnp+γk​ and α≥0\alpha \ge 0α≥0, the expected payoff of a report qqq falls short of that of the truth ppp by α\alphaα times the Kullback–Leibler information ∑kpkln⁡(pk/qk)≥0\sum_k p_k \ln(p_k/q_k) \ge 0∑k​pk​ln(pk​/qk​)≥0, which vanishes only for an honest report.

Formalization Note ln⁡\lnln is Real.log, with Lean's ln⁡0=0\ln 0 = 0ln0=0; a term pkln⁡(⋅)p_k \ln(\cdot)pk​ln(⋅) with pk=0p_k = 0pk​=0 is 000.

Differences from the source:

  • generalization: strictly positive n-point distributions p, q → p, q nonnegative probability distributions with q_k > 0 whenever p_k > 0; reason: the hypothesis is weaker and contains the strictly positive case used by Theorem 2.3
  • encoding: 0 ln 0 → Real.log 0 = 0, so 0 · ln 0 = 0; reason: Lean convention, the usual convention for entropy-type sums; no strictly positive instance is affected
  • encoding: outcomes 1, …, n → Fin n; reason: Lean indexing
Preamble
import Mathlib
Formal statement
namespace FuchsThesis.HonestExpert

/-- **(2.70): the Shannon inequality, with its equality case.**
Fuchs, *Distinguishability and Accessible Information in Quantum Theory*, arXiv:quant-ph/9601020v1,
§2.3.1, eq. (2.70), p.24 (PDF p.33): "the Shannon inequality,
∑_{k=1}^n p_k ln q_k ≤ ∑_{k=1}^n p_k ln p_k, with equality if and only if p_k = q_k for all k."

Let `p, q : Fin n → ℝ` be probability distributions (nonnegative entries summing to one) such that
`q_k > 0` whenever `p_k > 0`. Then `∑_k p_k ln q_k ≤ ∑_k p_k ln p_k`, with equality if and only if
`p = q`.

**Formalization Note.** `ln` is `Real.log`, with Lean's `Real.log 0 = 0`; every term with `p_k = 0`
is `0 · ln(·) = 0` on both sides, the usual convention `0 ln 0 = 0`. The page proves (2.70) for the
strictly positive distributions of Theorem 2.3; the statement here allows zeros in `p` (and in `q`
where `p` vanishes), which contains that case. -/
theorem eq_2_70 {n : ℕ} (p q : Fin n → ℝ) (hp0 : ∀ k, 0 ≤ p k) (hp1 : ∑ k, p k = 1)
    (hq0 : ∀ k, 0 ≤ q k) (hq1 : ∑ k, q k = 1) (hpq : ∀ k, 0 < p k → 0 < q k) :
    ∑ k, p k * Real.log (q k) ≤ ∑ k, p k * Real.log (p k) ∧
      (∑ k, p k * Real.log (q k) = ∑ k, p k * Real.log (p k) ↔ p = q) := by sorry

end FuchsThesis.HonestExpert
Source
Fuchs, Distinguishability and Accessible Information in Quantum Theory, arXiv:quant-ph/9601020v1, §2.3.1, eq. (2.70), p.24 (PDF p.33)
Human review
  • Endorsed by Shuze Chen · Oct 30, 2026

    Confirmed by the moderator at approval.

  • Endorsed by iris · Oct 30, 2026

    Confirmed by the mission captain (proposal self-audit).

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