InformationTheory.Shannon.LZ78.ZivInequality
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.
LZ78Phrasecardinality plumbing —LZ78Phrase.equivOptionNatProd-style cardinality / image-card bounds. - §2.
LZ78Parsing.countcombinatorial bounds — Nat-level inequalities onp.count = p.phrases.lengthpurely from the parsing invariant. - §3.
ZivCountingBoundpredicate — a real-valued predicate that exposes the combinatorial-layer Ziv counting bound at theProplevel, with a.reflconstructor and a constructor taking a real bound directly. The entropy-side layer plugsZivCountingBoundinto theIsLZ78PhraseCountAsymptoticenvelope.
Scope #
- Combinatorial counting bound:
LZ78Parsing.count_le_card_phrase_spaceand friends. Pure Nat/Finset, no measure-theoretic infrastructure. ZivCountingBoundreal-valuedPropslot.- 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 #
InformationTheory.Shannon.LZ78Phrase.parentBounded
sourceAn 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
- InformationTheory.Shannon.LZ78Phrase.parentBounded c α = (Option (Fin c) × α)
Instances For
Used by
InformationTheory.Shannon.LZ78Phrase.parentBounded_fintype
sourceUsed by
InformationTheory.Shannon.LZ78Phrase.card_parentBounded
sourceCardinality of the bounded-parent phrase space: (c + 1) · |α|.
Used by
InformationTheory.Shannon.LZ78Phrase.ofParentBounded
sourceThe "embed-with-bound" function from parentBounded c α back into
LZ78Phrase α: forget the bound.
Equations
- InformationTheory.Shannon.LZ78Phrase.ofParentBounded α pb = { parent := Option.map (fun (x : Fin c) => ↑x) pb.1, symbol := pb.2 }
Instances For
Used by
InformationTheory.Shannon.LZ78Phrase.boundParent
sourceConvert 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
InformationTheory.Shannon.LZ78Phrase.boundParent_none
sourceUsed by
InformationTheory.Shannon.LZ78Phrase.boundParent_some
sourceUsed by
InformationTheory.Shannon.LZ78Phrase.map_val_boundParent
sourceUsed by
InformationTheory.Shannon.LZ78Phrase.toParentBounded
sourceConvert an LZ78Phrase whose parent is either none or some k
with k < c into the bounded type parentBounded c α.
Equations
Instances For
Used by
InformationTheory.Shannon.LZ78Phrase.ofParentBounded_toParentBounded
sourceUsed by
§2. LZ78Parsing.count combinatorial bounds #
InformationTheory.Shannon.LZ78Parsing.count_eq_length'
sourceLZ78Parsing.count is the list length. Restatement of
LZ78Parsing.count_eq_length for direct citation in counting proofs.
Used by
InformationTheory.Shannon.LZ78Parsing.count_empty'
sourceThe empty parsing has count zero.
Used by
InformationTheory.Shannon.LZ78Parsing.phraseSet
sourceThe 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
- p.phraseSet = Finset.image (fun (i : Fin p.phrases.length) => p.phrases.get i) Finset.univ
Instances For
Used by
InformationTheory.Shannon.LZ78Parsing.parent_bounded
sourceEvery 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
InformationTheory.Shannon.LZ78Parsing.indexToBounded
sourceThe 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
- p.indexToBounded i = (p.phrases.get i).toParentBounded ⋯
Instances For
Used by
InformationTheory.Shannon.LZ78Parsing.ofParentBounded_indexToBounded
sourceUsed by
InformationTheory.Shannon.LZ78Parsing.card_phraseSet_le_pow
sourceThe 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
InformationTheory.Shannon.LZ78Parsing.count_nonneg
sourceTrivial monotonicity: count ≥ 0. A useful base hypothesis for
Ziv-style real-valued bounds (avoids pos/nonneg re-derivation
downstream).
Used by
InformationTheory.Shannon.LZ78Parsing.phraseSet_empty
sourceThe empty parsing has an empty phrase set.
Used by
§3. ZivCountingBound predicate #
InformationTheory.Shannon.ZivCountingBound
sourceThe 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
- InformationTheory.Shannon.ZivCountingBound p B = (↑p.count ≤ B)
Instances For
Used by
InformationTheory.Shannon.ZivCountingBound.refl
sourceTrivially count ≤ count.
Used by
InformationTheory.Shannon.ZivCountingBound.mono
sourceMonotonicity in the real bound.
Used by
InformationTheory.Shannon.ZivCountingBound.add_nonneg
sourceAdding a positive slack preserves the bound (B ≤ B + ε).