Documentation

Complexity.Probability.MinEntropy

Min-entropy and weak random sources #

The min-entropy of a distribution is the least information content -log₂ p(a) of a possible outcome, measured in bits like Cslib.Probability.PMF.entropy. A distribution has min-entropy at least k exactly when every outcome has probability at most 2⁻ᵏ (le_minEntropy_iff); such a distribution is called a k-source. A (k, ε)-source is within statistical distance ε of a k-source. These are the weak random sources from which randomness extractors produce nearly uniform bits Chor, Goldreich, Vadhan, Chapter 6.

Min-entropy never exceeds Shannon entropy and bounds the collision probability. A mixture of k-sources is a k-source; conversely, every k-source is a mixture of flat k-sources (Cslib.Probability.PMF.exists_eq_bind_uniformOfFinset_of_le_minEntropy). Discarding rare heavy outcomes turns a distribution into a (k, ε)-source (isSource_of_heavy_le).

Main definitions #

Main results #

References #

Min-entropy #

noncomputable def Cslib.Probability.PMF.minEntropy {α : Type u_1} (p : PMF α) :

Min-entropy in bits: the least information content -log₂ p(a) of a possible outcome a. Its lower bounds are upper bounds on the outcome probabilities (le_minEntropy_iff).

Instances For
    theorem Cslib.Probability.PMF.le_surprisal_iff_mass_le {α : Type u_1} (p : PMF α) {a : α} (ha : a ∈ p.support) {k : ℝ} :
    k ≤ surprisal p a ↔ (p a).toReal ≤ 2 ^ (-k)

    On the support, a lower information bound is exactly an upper probability bound.

    theorem Cslib.Probability.PMF.minEntropy_le_surprisal {α : Type u_1} (p : PMF α) {a : α} (ha : a ∈ p.support) :

    Min-entropy is at most the information content of every possible outcome.

    Min-entropy is nonnegative.

    theorem Cslib.Probability.PMF.le_minEntropy_iff {α : Type u_1} (p : PMF α) {k : ℝ} :
    k ≤ minEntropy p ↔ ∀ (a : α), (p a).toReal ≤ 2 ^ (-k)

    Min-entropy lower bounds. A distribution has min-entropy at least k exactly when every outcome has probability at most 2⁻ᵏ.

    Every outcome has probability at most 2 to the power of minus the min-entropy.

    Collision probability is at most 2 to the power of minus the min-entropy.

    On a finite type the least information content is attained by some possible outcome.

    Min-entropy is at most Shannon entropy, which averages the information content.

    Min-entropy is at most the logarithm of the size of a finite type.

    The uniform distribution on a nonempty finite set s has min-entropy log₂ |s|.

    @[simp]

    The uniform distribution on a finite type has min-entropy the logarithm of its size.

    @[simp]

    A deterministic value has no min-entropy.

    theorem Cslib.Probability.PMF.le_minEntropy_bind {α : Type u_1} {β : Type u_2} (μ : PMF β) (f : β → PMF α) {k : ℝ} (h : ∀ b ∈ μ.support, k ≤ minEntropy (f b)) :

    Mixtures of k-sources are k-sources. If every possible component of a mixture has min-entropy at least k, so does the mixture.

    Weak random sources #

    def Cslib.Probability.PMF.IsSource {α : Type u_1} [Fintype α] (p : PMF α) (k : ℝ) (ε : NNReal) :

    A (k, ε)-source: a distribution within statistical distance ε of one with min-entropy at least k. A k-source is a (k, 0)-source (isSource_zero_iff).

    Instances For
      @[simp]
      theorem Cslib.Probability.PMF.isSource_zero_iff {α : Type u_1} [Fintype α] (p : PMF α) {k : ℝ} :

      A (k, 0)-source is exactly a distribution of min-entropy at least k.

      theorem Cslib.Probability.PMF.isSource_of_le_minEntropy {α : Type u_1} [Fintype α] {p : PMF α} {k : ℝ} (h : k ≤ minEntropy p) (ε : NNReal) :
      IsSource p k ε

      A distribution of min-entropy at least k is a (k, ε)-source for every ε.

      theorem Cslib.Probability.PMF.IsSource.mono {α : Type u_1} [Fintype α] {p : PMF α} {k k' : ℝ} {ε ε' : NNReal} (h : IsSource p k ε) (hk : k' ≤ k) (hε : ε ≤ ε') :
      IsSource p k' ε'

      Sources remain sources with less min-entropy and more error.

      theorem Cslib.Probability.PMF.IsSource.of_statisticallyClose {α : Type u_1} [Fintype α] {p q : PMF α} {k : ℝ} {ε δ : NNReal} (h : IsSource q k ε) (hpq : StatisticallyClose p q δ) :
      IsSource p k (δ + ε)

      A distribution δ-close to a (k, ε)-source is a (k, δ + ε)-source.

      theorem Cslib.Probability.PMF.isSource_of_heavy_le {α : Type u_1} [Fintype α] (p : PMF α) {k : ℝ} {δ : NNReal} (hδ : ↑δ < 1) (hheavy : (p.toOuterMeasure {a : α | 2 ^ (-k) < (p a).toReal}).toReal ≤ ↑δ) :
      IsSource p (k + Real.logb 2 (1 - ↑δ)) δ

      Smoothing by discarding heavy outcomes. If the outcomes of probability more than 2⁻ᵏ have total probability at most δ < 1, the distribution is a (k + log₂ (1 - δ), δ)-source. Conditioning on the light outcomes moves it by the discarded probability and multiplies each remaining mass by at most 1 / (1 - δ). For δ ≤ 1 / 2 the min-entropy loss is at most one bit.