Documentation

LeanPool.Shannon1948Formalization.Entropy.Core

Shannon.Entropy.Core #

Foundational definitions for the Shannon characterization development:

Global roadmap (matching Shannon Appendix 2):

  1. Equiprobable case: Apos H (n * m) = Apos H n + Apos H m, then Apos H n = K * log n.
  2. Rational case: grouped equiprobable refinement implies H p = -K * ∑ p_i log p_i for rational probabilities.
  3. Real case: floor-count rational approximants approxProb p N converge to p; continuity upgrades the rational formula to all real probabilities.

p has nonnegative masses that sum to one.

Equations
Instances For
    @[reducible, inline]

    A probability distribution over a finite type α, bundled with simplex proofs. This keeps API signatures clean (no separate IsProbDist assumptions everywhere).

    Equations
    Instances For
      theorem LeanPool.Shannon1948Formalization.prob_nonneg {α : Type} [Fintype α] (p : ProbDist α) (a : α) :
      0 p a
      theorem LeanPool.Shannon1948Formalization.prob_sum_eq_one {α : Type} [Fintype α] (p : ProbDist α) :
      a : α, p a = 1
      theorem LeanPool.Shannon1948Formalization.prob_le_one {α : Type} [Fintype α] (p : ProbDist α) (a : α) :
      p a 1

      Uniform distribution on Fin (n + 1).

      Equations
      Instances For

        Uniform distribution on Fin n for positive natural n : ℕ+. This avoids n + 1 index gymnastics when formalizing Appendix 2.

        Equations
        Instances For
          def LeanPool.Shannon1948Formalization.composeProb {α : Type} [Fintype α] {β : αType} [(a : α) → Fintype (β a)] (p : ProbDist α) (q : (a : α) → ProbDist (β a)) :

          Composite distribution for a two-stage random choice.

          Equations
          Instances For

            Equivalence between two-stage finite outcomes and Fin (n * m).

            Equations
            Instances For
              def LeanPool.Shannon1948Formalization.relabelProb {α β : Type} [Fintype α] [Fintype β] (e : α β) (p : ProbDist α) :

              Relabel a distribution along an equivalence of finite types. This is the formal "event names do not matter" transport map.

              Equations
              Instances For
                structure LeanPool.Shannon1948Formalization.ShannonEntropyAxioms (H : {α : Type} → [inst : Fintype α] → ProbDist α) :

                Shannon's three conditions for a finite-choice uncertainty functional H. The final theorem will show any such H has entropy form up to a positive scale.

                Instances For
                  noncomputable def LeanPool.Shannon1948Formalization.A (H : {α : Type} → [inst : Fintype α] → ProbDist α) (n : ) :

                  A_H(n) is Shannon's notation for uncertainty on the uniform distribution with n + 1 equiprobable outcomes.

                  Equations
                  Instances For
                    noncomputable def LeanPool.Shannon1948Formalization.Apos (H : {α : Type} → [inst : Fintype α] → ProbDist α) (n : ℕ+) :

                    Apos H n is uncertainty for exactly n equiprobable outcomes (n : ℕ+).

                    Equations
                    Instances For