InformationTheory

InformationTheory.Shannon.LZ78.ZivInequality

source

LZ78 Ziv's inequality — combinatorial counting layer #

This file publishes the combinatorial counting plumbing layer of Ziv's inequality (Cover–Thomas; the upper-bound half of the LZ78 asymptotic optimality theorem). It establishes the combinatorial layer (Nat-level phrase-space cardinality bound) as concrete theorems, consumed by the IsLZ78PhraseCountAsymptotic asymptotic layer; the entropy layer (H(X^n) ≤ Σ H(phrase_i)) and the log-sum layer (final Ziv form) are developed elsewhere. The genuine a.s. achievability residual of LZ78 optimality is scoped out as lz78Greedy_achievability_ae in AsymptoticOptimality.lean.

File layout #

  • §1. LZ78Phrase cardinality plumbing — LZ78Phrase.equivOptionNatProd-style cardinality / image-card bounds.
  • §2. LZ78Parsing.count combinatorial bounds — Nat-level inequalities on p.count = p.phrases.length purely from the parsing invariant.
  • §3. ZivCountingBound predicate — a real-valued predicate that exposes the combinatorial-layer Ziv counting bound at the Prop level, with a .refl constructor and a constructor taking a real bound directly. The entropy-side layer plugs ZivCountingBound into the IsLZ78PhraseCountAsymptotic envelope.

Scope #

  • Combinatorial counting bound: LZ78Parsing.count_le_card_phrase_space and friends. Pure Nat/Finset, no measure-theoretic infrastructure.
  • ZivCountingBound real-valued Prop slot.
  • Entropy chain-rule layer (H(X^n) ≤ Σ H(phrase_i)), developed elsewhere.
  • Log-sum + final Ziv inequality main form, developed elsewhere.

Pattern source #

The "extract the most tractable fragments" pattern is the same as InformationTheory/Shannon/WynerZiv/RateMonotonicity.lean: the parent placeholder is not fully discharged; the file publishes the fragments that are tractable now plus a real-valued predicate exposing the layered shape, with .trivial bridges to the parent placeholder.

§1. LZ78Phrase cardinality plumbing #

def

InformationTheory.Shannon.LZ78Phrase.parentBounded

source
(c : ) (α : Type u_2) :
Type u_2

An LZ78 phrase whose parent is in Option (Fin c) (i.e. either the empty-prefix root none, or a back-reference some k with k < c). This is the natural ambient finite type that bounds the dictionary phrase space after the first c phrases have been emitted: each subsequent phrase is (parent ∈ {none, some 0, ..., some (c-1)}) × (symbol ∈ α).

Equations
Instances For
    Used by
      instance

      InformationTheory.Shannon.LZ78Phrase.parentBounded_fintype

      source
      @[implicit_reducible]
      (c : ) (α : Type u_2) [Fintype α] :
      Equations
      Used by
        theorem

        InformationTheory.Shannon.LZ78Phrase.card_parentBounded

        source
        @[simp]
        (c : ) (α : Type u_2) [Fintype α] :

        Cardinality of the bounded-parent phrase space: (c + 1) · |α|.

        Used by
          def

          InformationTheory.Shannon.LZ78Phrase.ofParentBounded

          source
          {c : } (α : Type u_2) (pb : parentBounded c α) :

          The "embed-with-bound" function from parentBounded c α back into LZ78Phrase α: forget the bound.

          Equations
          Instances For
            Used by
              def

              InformationTheory.Shannon.LZ78Phrase.boundParent

              source
              {c : } (o : Option ) :
              (∀ (k : ), o = some kk < c)Option (Fin c)

              Convert an Option whose some k case satisfies k < c into Option (Fin c). The "round-trip" forget-then-attach direction.

              Equations
              Instances For
                Used by
                  theorem

                  InformationTheory.Shannon.LZ78Phrase.boundParent_none

                  source
                  @[simp]
                  {c : } (h : ∀ (k : ), none = some kk < c) :
                  Used by
                    theorem

                    InformationTheory.Shannon.LZ78Phrase.boundParent_some

                    source
                    @[simp]
                    {c : } (k : ) (h : ∀ (k' : ), some k = some k'k' < c) :
                    Used by
                      theorem

                      InformationTheory.Shannon.LZ78Phrase.map_val_boundParent

                      source
                      @[simp]
                      {c : } (o : Option ) (h : ∀ (k : ), o = some kk < c) :
                      Option.map (fun (x : Fin c) => x) (boundParent o h) = o
                      Used by
                        def

                        InformationTheory.Shannon.LZ78Phrase.toParentBounded

                        source
                        {α : Type u_1} {c : } (ph : LZ78Phrase α) (h : ∀ (k : ), ph.parent = some kk < c) :

                        Convert an LZ78Phrase whose parent is either none or some k with k < c into the bounded type parentBounded c α.

                        Equations
                        Instances For
                          Used by
                            theorem

                            InformationTheory.Shannon.LZ78Phrase.ofParentBounded_toParentBounded

                            source
                            @[simp]
                            {α : Type u_1} {c : } (ph : LZ78Phrase α) (h : ∀ (k : ), ph.parent = some kk < c) :
                            Used by

                              §2. LZ78Parsing.count combinatorial bounds #

                              theorem

                              InformationTheory.Shannon.LZ78Parsing.count_eq_length'

                              source
                              {α : Type u_1} (p : LZ78Parsing α) :

                              LZ78Parsing.count is the list length. Restatement of LZ78Parsing.count_eq_length for direct citation in counting proofs.

                              Used by
                                theorem

                                InformationTheory.Shannon.LZ78Parsing.count_empty'

                                source
                                @[simp]
                                {α : Type u_1} :
                                (empty α).count = 0

                                The empty parsing has count zero.

                                Used by
                                  noncomputable def

                                  InformationTheory.Shannon.LZ78Parsing.phraseSet

                                  source
                                  {α : Type u_1} (p : LZ78Parsing α) :

                                  The set of phrases of a parsing, as a finset. Built by mapping the Fin p.count index space through the get accessor and packaging as a Finset via Finset.image. Uses Classical.decEq so that no DecidableEq instance on LZ78Phrase α is required at the call site.

                                  Equations
                                  Instances For
                                    Used by
                                      theorem

                                      InformationTheory.Shannon.LZ78Parsing.parent_bounded

                                      source
                                      {α : Type u_1} (p : LZ78Parsing α) (i : ) (hi : i < p.phrases.length) (k : ) :

                                      Every phrase in the parsing has bounded parent. Direct consequence of the inRange invariant: phrase at index i < count has parent in Option (Fin count).

                                      Used by
                                        noncomputable def

                                        InformationTheory.Shannon.LZ78Parsing.indexToBounded

                                        source

                                        The phrase-index map factors through parentBounded. Map each Fin p.count index to its corresponding bounded-parent phrase, then forget the bound to recover the phrase itself.

                                        Equations
                                        Instances For
                                          Used by
                                            theorem

                                            InformationTheory.Shannon.LZ78Parsing.ofParentBounded_indexToBounded

                                            source
                                            Used by
                                              theorem

                                              InformationTheory.Shannon.LZ78Parsing.card_phraseSet_le_pow

                                              source
                                              {α : Type u_1} [Fintype α] (p : LZ78Parsing α) :

                                              The count upper bound via the bounded-parent ambient. For any LZ78 parsing on a finite alphabet, the number of distinct phrases is at most (count + 1) · |α|: every phrase is a pair (parent ∈ Option (Fin count), symbol ∈ α).

                                              Used by
                                                theorem

                                                InformationTheory.Shannon.LZ78Parsing.count_nonneg

                                                source
                                                @[simp]
                                                {α : Type u_1} (p : LZ78Parsing α) :

                                                Trivial monotonicity: count ≥ 0. A useful base hypothesis for Ziv-style real-valued bounds (avoids pos/nonneg re-derivation downstream).

                                                Used by
                                                  theorem

                                                  InformationTheory.Shannon.LZ78Parsing.phraseSet_empty

                                                  source
                                                  @[simp]
                                                  {α : Type u_1} :

                                                  The empty parsing has an empty phrase set.

                                                  Used by

                                                    §3. ZivCountingBound predicate #

                                                    def

                                                    InformationTheory.Shannon.ZivCountingBound

                                                    source
                                                    {α : Type u_1} (p : LZ78Parsing α) (B : ) :

                                                    The real-valued Ziv counting-layer predicate.

                                                    For a parsing p and a real-valued upper bound B : ℝ, this predicate asserts that the combinatorial layer of the Ziv inequality holds: the cast (p.count : ℝ) is bounded by B. The predicate is shaped so that the entropy-side layer can supply B = n / log c(n) (Cover–Thomas) or any analogous real-valued upper bound and plug it into the IsLZ78PhraseCountAsymptotic envelope.

                                                    The combinatorial layer of B is established by card_phraseSet_le_pow (§2); the entropy / log-sum layers are developed elsewhere.

                                                    Equations
                                                    Instances For
                                                      Used by
                                                        theorem

                                                        InformationTheory.Shannon.ZivCountingBound.refl

                                                        source
                                                        @[simp]
                                                        {α : Type u_1} (p : LZ78Parsing α) :

                                                        Trivially count ≤ count.

                                                        Used by
                                                          theorem

                                                          InformationTheory.Shannon.ZivCountingBound.mono

                                                          source
                                                          {α : Type u_1} {p : LZ78Parsing α} {B B' : } (h : ZivCountingBound p B) (hB : B B') :

                                                          Monotonicity in the real bound.

                                                          Used by
                                                            theorem

                                                            InformationTheory.Shannon.ZivCountingBound.add_nonneg

                                                            source
                                                            {α : Type u_1} {p : LZ78Parsing α} {B ε : } (h : ZivCountingBound p B) ( : 0 ε) :

                                                            Adding a positive slack preserves the bound (BB + ε).

                                                            Used by