InformationTheory

InformationTheory.Shannon.Kolmogorov.EntropyRateUpper

source

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 #

Main statements #

noncomputable def

InformationTheory.Kolmogorov.primcodableOfFintype

source
@[implicit_reducible]
{α : Type u_1} [Fintype α] :

A 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
      noncomputable def

      InformationTheory.Kolmogorov.decoderAlphabet

      source
      {α : Type u_1} [Fintype α] :
      List α

      The canonical letter list of the finite alphabet; a constant, independent of the block length n.

      Equations
      Instances For
        Used by
          noncomputable def

          InformationTheory.Kolmogorov.enumWords

          source
          {α : Type u_1} [Fintype α] (n : ) :
          List (List α)

          All 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
              noncomputable def

              InformationTheory.Kolmogorov.typeSig

              source
              {α : Type u_1} [Fintype α] [DecidableEq α] (w : List α) :

              The 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
              Instances For
                Used by
                  noncomputable def

                  InformationTheory.Kolmogorov.typeDecoderOption

                  source
                  {α : Type u_1} [Fintype α] [DecidableEq α] (m n : ) :

                  The 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
                      noncomputable def

                      InformationTheory.Kolmogorov.typeDecoder

                      source
                      {α : Type u_1} [Fintype α] [DecidableEq α] (m n : ) :

                      The 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 #

                          theorem

                          InformationTheory.Kolmogorov.enumWords_primrec

                          source
                          {α : Type u_1} [Fintype α] :

                          The word enumerator is primitive recursive in the length.

                          Used by
                            theorem

                            InformationTheory.Kolmogorov.typeSig_primrec

                            source
                            {α : Type u_1} [Fintype α] [DecidableEq α] :

                            The occurrence signature is primitive recursive.

                            Used by
                              theorem

                              InformationTheory.Kolmogorov.ofDigits_primrec

                              source
                              :
                              Primrec₂ fun (b : ) (L : List ) => Nat.ofDigits b L

                              Reading 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
                                theorem

                                InformationTheory.Kolmogorov.typeDecoderOption_computable

                                source
                                {α : Type u_1} [Fintype α] [DecidableEq α] :
                                Computable fun (p : × ) => typeDecoderOption p.1 p.2

                                The Option-valued decoder is total computable in (m, n).

                                Used by
                                  theorem

                                  InformationTheory.Kolmogorov.typeDecoder_partrec

                                  source

                                  The type-class decoder is partial recursive.

                                  Used by