Documentation

CslibFrontier.Probability.Entropy.Guessing

Guessing a hidden value with low conditional entropy #

Fano's inequality (conditionalEntropy_le_binEntropy_add_mul_logb) says that a hidden value that can be guessed well has low conditional entropy. This module proves a converse: if X has conditional entropy H(X | Y) given an observation Y, the maximum a posteriori estimator guesses X from Y with error probability at most 1 - 2^(-H(X | Y)) ≤ (ln 2) H(X | Y). Guessing bounds of this kind turn entropy estimates into guessing attacks, as in information-theoretic lower bounds for garbled circuits [JRR25]. Joint laws list the observation first, as for Cslib.Probability.PMF.conditionalEntropy.

The proof compares each conditional law with its most likely value: that value has probability at least 2^(-H) because min-entropy is at most Shannon entropy, and Jensen's inequality for the convex function t ↦ 2^(-t) averages these bounds over the observation.

Main definitions #

Main results #

References #

noncomputable def Cslib.Probability.PMF.maxPosteriorGuess {α : Type u_1} {β : Type u_2} [Fintype α] [Nonempty α] (joint : PMF (β × α)) (y : β) :
α

A maximum a posteriori estimator: for each observation, a hidden value of largest conditional probability.

theorem Cslib.Probability.PMF.conditionalSnd_le_conditionalSnd_maxPosteriorGuess {α : Type u_1} {β : Type u_2} [Fintype α] [Nonempty α] (joint : PMF (β × α)) (y : β) (x : α) :
(conditionalSnd joint y) x ≤ (conditionalSnd joint y) (maxPosteriorGuess joint y)
theorem Cslib.Probability.PMF.errorProb_maxPosteriorGuess_le {α : Type u_1} {β : Type u_2} [Finite β] [Fintype α] [Nonempty α] (joint : PMF (β × α)) (g : β → α) :
(joint.toOuterMeasure {z : β × α | maxPosteriorGuess joint z.1 ≠ z.2}).toReal ≤ (joint.toOuterMeasure {z : β × α | g z.1 ≠ z.2}).toReal

The maximum a posteriori estimator errs least among all deterministic estimators.

theorem Cslib.Probability.PMF.errorProb_maxPosteriorGuess_le_one_sub_rpow {α : Type u_1} {β : Type u_2} [Finite β] [Fintype α] [Nonempty α] (joint : PMF (β × α)) :
(joint.toOuterMeasure {z : β × α | maxPosteriorGuess joint z.1 ≠ z.2}).toReal ≤ 1 - 2 ^ (-conditionalEntropy joint)

The maximum a posteriori estimator guesses the hidden value X from the observation Y except with probability at most 1 - 2^(-H(X | Y)).

theorem Cslib.Probability.PMF.errorProb_maxPosteriorGuess_le_log_two_mul {α : Type u_1} {β : Type u_2} [Finite β] [Fintype α] [Nonempty α] (joint : PMF (β × α)) :

The maximum a posteriori estimator errs with probability at most (ln 2) H(X | Y).