InformationTheory.Shannon.LZ78.ZivAchievabilityComposition
LZ78 achievability composition: threading + (k-state, length) grouping #
This file composes the two upstream bricks of the LZ78 achievability bound
ziv_aseventual_le_blockLogAvg₂
(LZ78/AsymptoticOptimality/ParentBridgeAchievability.lean):
negLogQk_parse_threading(ZivThreading.lean): the a.s. threading identitynegLogQk μ p k n ω = (leading boundary) + (per-phrase sum) + (trailing tail), where the per-phrase sum is position-indexed (∑ j : Fin c).condState_grouping_bound_mean(ZivCondGrouping.lean): the(k-state, length)grouped entropy bound witho(n)mean-length overhead, on aFinset (List α)of distinct phrase strings.
The composition target is the a.s. lower bound c · log c ≤ negLogQk + overhead
in the manifestly-o(n) mean-length form, the input to the downstream
"divide by n, limsup, diagonalize k → ∞" step.
Two sub-steps #
- (A) boundary-nonneg. The threading identity carries two boundary sums of
pmfLogCondMarkov μ p k i ω. SincepmfLogCondMarkovis-logof a conditional kernel singleton mass≤ 1(the kernel is a Markov kernel, so its value at every point is a probability measure), each term is≥ 0, hence the per-phrase sum is≤ negLogQk. This holds unconditionally (no a.s. caveat needed for the positivity). - (B) reindex
Fin c → Finset+ applycondState_grouping_bound_mean. The threading phrase sum is position-indexed;condState_grouping_bound_meanconsumes aFinset (List α)of distinct phrase strings. Bridging the two requires thectiled phrases to be distinct as strings (socard = c) and the content/state correspondence between the position-indexed terms and the string-indexed terms. This is now discharged (sorryAx-free): the slice/content correspondenceflatten_drop_take_getElem(threaded through the tiling chain) identifies thej-th tiled slice with the(bAbsorbed + j)-th greedy phrase,lz78PhraseStrings_nodupgives distinctness (card = c), and the per-term reindex composes viaFinset.sum_image.
Telescoping helper #
InformationTheory.Shannon.sum_range_consecutive_sub_of_monotone
sourceTelescoping of consecutive differences of a monotone ℕ → ℕ sequence:
∑_{j<c} (M (j+1) - M j) = M c - M 0.
Used by
Sub-step (A): nonnegativity of the per-step Markov log-likelihood #
InformationTheory.Shannon.pmfLogCondMarkov_nonneg
sourceThe per-step k-Markov negative conditional log-likelihood is nonnegative:
pmfLogCondMarkov μ p k i ω = -log m where m = (condDistrib … ).real {…} is a
singleton mass of a probability measure (condDistrib is a Markov kernel), hence
0 ≤ m ≤ 1 and -log m ≥ 0. Holds for every ω (no a.s. caveat).
Used by
Sub-step (A): the per-phrase sum is bounded by negLogQk #
InformationTheory.Shannon.phraseSum_le_negLogQk
sourceThe position-indexed per-phrase sum from the threading identity is bounded above
by negLogQk, because the two boundary sums (pmfLogCondMarkov over [0,b) and
[e,n)) are nonnegative. Stated abstractly in the shape produced by
negLogQk_parse_threading.
Used by
InformationTheory.Shannon.condQkState_congr_length
sourceCongruence for condQkState under a length equality: equal state s, equal
lengths (ℓ₁ = ℓ₂), and continuations equal after the Fin.cast give equal masses.
Used to bridge the (phrase j).length-indexed term to the N j.succ - N j.castSucc-indexed
threading term.
Used by
InformationTheory.Shannon.parseTiling_totalLength_le
sourceUsed by
InformationTheory.Shannon.parseTiling_phrase_slice_injective
sourceUsed by
Sub-step (B): the achievability composition lemma #
InformationTheory.Shannon.ziv_achievability_composition
sourceThe LZ78 achievability composition (a.s. form): for a.e. ω, the tiled phrase
count c and total parsed length Ntot ≤ n satisfy the o(n)-overhead Ziv lower
bound
c · log c ≤ negLogQk μ p k n ω + (c · log (Ntot / c) + c + c · log (#states)),
with the phrase count c anchored to the genuine distinct-phrase count of the
parse (c + bAbsorbed = (lz78PhraseStrings …).length, bAbsorbed ≤ k+1).
This is the input to the downstream "divide by n, limsup, diagonalize k → ∞"
step: divide by n, the overhead is o(n) (mean length ~ log n, c = O(n/log n)),
and the boundary terms vanish.
Now genuinely closed (sorryAx-free). The former residual was the (B) reindexing
bridge from the position-indexed threading sum (∑ j : Fin c) onto the distinct-phrase
Finset consumed by condState_grouping_bound_mean. It is discharged by:
- the slice/content correspondence
flatten_drop_take_getElem(GreedyLongestPrefix.lean, sorryAx-free) threaded through the tiling chain (lz78_parse_tiling_positions→lz78_block_tiling→negLogQk_parse_threading), which exposes that thej-th tiled slice is the(bAbsorbed + j)-th greedy phrase string; - the distinctness of those slices via
lz78PhraseStrings_nodup(so the imageFinsethas card= c); - the per-term reindex
condQkState (windowState …) (…) (fun m => p.obs …) ↦ condQkState (st w) |w| (toFinVec |w| w)withstthe trailingk-state read off the parse inverse, plus the per-phrase positivitycondQkState_pos_of_markovFactor_pos.
The c = 0 boundary degenerates honestly to 0 ≤ 0. The rest of the achievability
argument — the variable-depth length-grouping AEP and the limsup discharge connecting
to entropyRate₂ — lives downstream at ziv_aseventual_le_blockLogAvg₂ /
lz78Greedy_achievability_ae, not in this brick (c·log c ≤ negLogQk + o(n)).
@audit:ok (non-circular, non-bundled: conclusion is the unchanged inequality
(c·log c ≤ negLogQk + (c·log(Ntot/c) + c + c·log((card α)^k))), no input hypothesis added.
The two sub-bounds are PROVEN (hA = phraseSum_le_negLogQk, hB from the genuine reindex
onto the distinct-phrase Finset + condState_grouping_bound_mean), combined by linarith
— sufficiency holds, nothing is asserted as a hypothesis. Non-vacuous: the phrase count
c is anchored to the parse by c + bAbsorbed = (lz78PhraseStrings …).length with
bAbsorbed ≤ k + 1, so the existential cannot escape through c = 0 for a long block).