InformationTheory.Shannon.LZ78.PhraseCountAsymptotics
LZ78 phrase-count asymptotic envelope (IsBigO bound) #
This file discharges the predicate IsLZ78PhraseCountAsymptotic p B
(published in InformationTheory/Shannon/LZ78/ConverseAsymptotic.lean) with
real-analysis content rather than a hypothesis pass-through.
The target predicate unfolds to
(fun n => ((p n).count : ℝ)) =O[atTop] (fun n => (n : ℝ) / Real.log n),
i.e. the Cover–Thomas statement c(n) = O(n / log n).
Approach #
The substantive ingredient is the inversion of the Ziv counting
inequality. Cover–Thomas gives, for an LZ78 parsing of a
length-n string over a b-symbol alphabet, the primitive bound
c(n) · log c(n) ≤ K · n (K = log b, large n) (★)
We take (★) as the more-primitive hypothesis and prove the
real-analysis lemma
(★) + (c n → handled pointwise) ⟹ c(n) = O(n / log n).
The proof is a two-case argument at the threshold √n = n^(1/2):
- Large branch
c(n) > √n: thenlog c(n) > ½ log n, so(★)givesc(n) · ½ log n < K n, hencec(n) · log n ≤ 2K n. - Small branch
c(n) ≤ √n: thenc(n) · log n ≤ √n · log n, andlog n ≤ 2√n(Real.log_natCast_le_rpow_divwithε = ½), soc(n) · log n ≤ √n · 2√n = 2n.
In both branches c(n) · log n ≤ C · n with C = max (2K) 2, which —
since log n > 0 eventually — is exactly c(n) ≤ C · (n / log n), i.e.
the IsBigO bound with constant C.
Layering #
- §1 — the threshold algebra helpers (
√n · √n = n,log √n, thelog n ≤ 2√nenvelope). - §2 — the inversion lemma
isBigO_natCast_div_log_of_mul_log_le. - §3 —
IsZivCountingMulLogBound, the primitive(★)predicate, plus the dischargeIsLZ78PhraseCountAsymptoticfrom it. - §4 — re-published wrappers
lz78_phrase_count_asymptotic_of_mul_logon top ofLZ78/ConverseAsymptotic.lean's envelope.
§1. Threshold algebra (√n = n^(1/2)) #
InformationTheory.Shannon.rpow_half_mul_self
source√x · √x = x for 0 ≤ x, with √x := x ^ (1/2 : ℝ).
Used by
InformationTheory.Shannon.log_rpow_half
sourcelog (x ^ (1/2)) = (1/2) · log x for 0 < x.
Used by
InformationTheory.Shannon.log_natCast_le_two_mul_rpow_half
sourceThe square-root envelope of log: log n ≤ 2 · n^(1/2).
Used by
InformationTheory.Shannon.rpow_half_nonneg
source0 ≤ n^(1/2).
Used by
§2. The inversion lemma #
InformationTheory.Shannon.isBigO_natCast_div_log_of_mul_log_le
sourceFrom the primitive Cover–Thomas
c(n) · log c(n) ≤ K · n bound, the count c(n) is O(n / log n).
f : ℕ → ℝ is the (nonnegative, real-valued) count sequence. The
hypotheses are all eventual: f n ≥ 0 and the primitive product
bound. The IsBigO constant is max (2K) 2, so the result holds for
any real K (the negative-K case is vacuously stronger).
Used by
§3. The primitive predicate IsZivCountingMulLogBound and discharge #
InformationTheory.Shannon.IsZivCountingMulLogBound
sourceThe primitive Ziv c·log c product predicate.
For a family of parsings p : ℕ → LZ78Parsing α and constant K : ℝ,
this asserts the Cover–Thomas primitive bound (★):
eventually c(n) · log c(n) ≤ K · n. This is strictly more primitive
than IsLZ78PhraseCountAsymptotic — the latter is derived from it by the
inversion lemma of §2.
Equations
Instances For
Used by
InformationTheory.Shannon.IsLZ78PhraseCountAsymptotic.of_mul_log_bound
sourceDischarge of IsLZ78PhraseCountAsymptotic from the
primitive c·log c ≤ Kn product bound: the
asymptotic envelope predicate holds with IsBigO content.
Used by
§4. Re-published wrappers #
InformationTheory.Shannon.lz78_phrase_count_asymptotic_of_mul_log
sourceThe re-published main statement: the LZ78 phrase-count is
O(n / log n) whenever the primitive product bound holds. Mirrors the
shape of lz78_phrase_count_asymptotic_n_div_log but with the
IsBigO content supplied (no eventual-≤ hypothesis needed).
Used by
InformationTheory.Shannon.IsLZ78PhraseCountSandwich.of_mul_log_bound
sourceCombine the upper envelope with the reflexive lower envelope into a phrase-count sandwich.