Documentation

CodeLayer.PriorNormalization

Universal-prior sub-normalization #

The setting is the prequential-MDL Bayesian mixture P̄(o_t | o_{<t}) = Σ_{R' ∈ M} w(R' | o_{<t}) P_{R'}(o_t | o_{<t}) over a countable hypothesis class M, with prior w(R') ∝ 2^{−K(R')}. For the proportionality ∝ to define a (sub-)probability — and hence the mixture to be well-defined — the unnormalized weights must have finite total mass ≤ 1. That is the Kraft–McMillan inequality.

Status: PROVED as pure code-length statements, on top of Mathlib's IsUniquelyDecodable.finsetSum_one_div_card_pow_length_le_one. This is the arithmetic core of the mixture's well-definedness only.

What this DOES establish #

The Kraft arithmetic itself — unique decodability passing to subsets, the binary specialization of Kraft–McMillan, and its reindexing along an injective code — is generic, and lives in BinaryKraft; this module is its reading for a universal prior.

What this does NOT establish (stays in prose; no overclaiming) #

Hypotheses: standard vs added/strengthened #

theorem PriorNormalization.prior_tsum_le_one (code : ℕ → List Bool) (hinj : Function.Injective code) (hUD : InformationTheory.IsUniquelyDecodable (Set.range code)) :
∑' (n : ℕ), (1 / 2) ^ (code n).length ≤ 1

The Kolmogorov-weighted prior is a sub-probability. For a countable hypothesis class enumerated without repeats by a uniquely-decodable binary code, the unnormalized weights 2^{−ℓ(R)} sum to ≤ 1, so the prior w(R') ∝ 2^{−K(R')} normalizes and the Bayesian mixture is well-defined.

This is BinaryKraft.indexed_tsum_le_one read at the hypothesis class: the enumeration code is the injective code, its codeword lengths are the ℓ(R), and Kraft–McMillan prices them.