Shannon.Entropy.Core #
Foundational definitions for the Shannon characterization development:
- finite probability distributions (
ProbDist); - Shannon-style condition bundle (
ShannonEntropyAxioms); - basic constructions used in all later phases
(
uniformPNat,composeProb,relabelProb).
Global roadmap (matching Shannon Appendix 2):
- Equiprobable case:
Apos H (n * m) = Apos H n + Apos H m, thenApos H n = K * log n. - Rational case: grouped equiprobable refinement implies
H p = -K * ∑ p_i log p_ifor rational probabilities. - Real case: floor-count rational approximants
approxProb p Nconverge top; continuity upgrades the rational formula to all real probabilities.
A probability distribution over a finite type α, bundled with simplex proofs.
This keeps API signatures clean (no separate IsProbDist assumptions everywhere).
Equations
Instances For
Equations
- LeanPool.Shannon1948Formalization.instCoeFunProbDistForallReal = { coe := fun (p : LeanPool.Shannon1948Formalization.ProbDist α) => ↑p }
Uniform distribution on Fin n for positive natural n : ℕ+.
This avoids n + 1 index gymnastics when formalizing Appendix 2.
Instances For
Equivalence between two-stage finite outcomes and Fin (n * m).
Equations
- LeanPool.Shannon1948Formalization.sigmaConstFinEquivFinMul n m = (Equiv.sigmaEquivProdOfEquiv fun (x : Fin ↑n) => Equiv.refl (Fin ↑m)).trans finProdFinEquiv
Instances For
Relabel a distribution along an equivalence of finite types. This is the formal "event names do not matter" transport map.
Equations
- LeanPool.Shannon1948Formalization.relabelProb e p = ⟨fun (b : β) => ↑p (e.symm b), ⋯⟩
Instances For
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.
Continuity in probabilities (for each finite alphabet).
- uniformMonotone : StrictMono fun (n : ℕ+) => H (uniformPNat n)
On uniform distributions, uncertainty is monotone in alphabet size.
- relabelInvariant {α β : Type} [Fintype α] [Fintype β] (e : α ≃ β) (p : ProbDist α) : H (relabelProb e p) = H p
Invariance under relabeling outcomes by a finite equivalence.
- grouping {α : Type} [Fintype α] {β : α → Type} [(a : α) → Fintype (β a)] (p : ProbDist α) (q : (a : α) → ProbDist (β a)) : H (composeProb p q) = H p + ∑ a : α, ↑p a * H (q a)
Grouping (recursivity): a two-stage choice decomposes additively.