InformationTheory.Shannon.Kolmogorov.EntropyRateUpper
A partial recursive type-class decoder for the entropy-rate upper bound #
The method-of-types upper half of kolmogorov_entropy_rate encodes a length-n
block by the pair ⟨type descriptor, index in its type class⟩. To turn this into
a condComplexity bound through invariance, the corresponding decoder — the map
that recovers a block from such a pair — must be a single partial recursive function,
uniform in the block length n (a per-n code would make the additive constant of
invariance_code diverge with n).
This file builds that decoder over a finite alphabet α and certifies it as
Partrec₂. The decoder A(m, n) splits m by division and remainder against
K = (n + 1) ^ card α: the type descriptor is the remainder m % K (the base-(n + 1)
numeral of the occurrence signature, whose letter counts each lie in [0, n]), and the
index is the quotient m / K. It enumerates every length-n word (a value-level
List α, not the length-indexed Fin n → α), keeps those whose signature re-encodes to
m % K, and returns the m / K-th such word as its base-card α numeral. This
div/mod packing is length-additive (natLen m ≈ natLen index + card α · log (n + 1)),
unlike Nat.pair, and the base-card α output matches the block encoder used by the
upper bound.
Main definitions #
typeDecoder— the decoder as a functionℕ → ℕ → Part ℕ.enumWords/typeSig— the length-nword enumerator and the occurrence signature.
Main statements #
InformationTheory.Kolmogorov.primcodableOfFintype
sourceA Primcodable structure on the finite type α, derived locally from
α ≃ Fin (Fintype.card α). This keeps the certification unconditional: no ambient
[Primcodable α] hypothesis is threaded through the entropy-rate development.
Equations
Instances For
Used by
InformationTheory.Kolmogorov.decoderAlphabet
sourceThe canonical letter list of the finite alphabet; a constant, independent of the
block length n.
Instances For
Used by
InformationTheory.Kolmogorov.enumWords
sourceAll length-n words over α, listed in canonical order. Built by primitive
recursion: enumWords 0 = [[]] and each step prepends every letter.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Used by
InformationTheory.Kolmogorov.typeSig
sourceThe occurrence signature of a word: for every letter a (in canonical order), the
number of times a appears in w. Two words lie in the same type class iff their
signatures agree.
Equations
- InformationTheory.Kolmogorov.typeSig w = List.map (fun (a : α) => (List.filter (fun (b : α) => decide (b = a)) w).length) InformationTheory.Kolmogorov.decoderAlphabet
Instances For
Used by
InformationTheory.Kolmogorov.typeDecoderOption
sourceThe decoder as an Option-valued total-computable map: None marks the index being
out of range of the enumerated type class. The modulus K = (n + 1) ^ card α bounds the
base-(n + 1) numeral of every length-n signature, so m % K recovers the type
descriptor and m / K the index inside the type class.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Used by
InformationTheory.Kolmogorov.typeDecoder
sourceThe type-class decoder consumed by invariance: on input (m, n) it recovers the
n-block indexed inside its type class.
Equations
Instances For
Used by
Primitive-recursive certification of the pieces #
InformationTheory.Kolmogorov.enumWords_primrec
sourceThe word enumerator is primitive recursive in the length.
Used by
InformationTheory.Kolmogorov.typeSig_primrec
sourceThe occurrence signature is primitive recursive.
Used by
InformationTheory.Kolmogorov.ofDigits_primrec
sourceReading a list of digits in a variable base is primitive recursive in the base and
the digit list, via the foldr form of Nat.ofDigits.
Used by
InformationTheory.Kolmogorov.typeDecoderOption_computable
sourceThe Option-valued decoder is total computable in (m, n).
Used by
InformationTheory.Kolmogorov.typeDecoder_partrec
sourceThe type-class decoder is partial recursive.