Documentation

LeanPool.Champernowne.Count

Occurrence-counting inequalities #

This file gives the lower append bound, a characterization by starting positions, and the allWords enumeration of length-k digit strings. Summing occurrences over allWords bounds the number of windows, allowing upper frequency estimates to be derived from lower ones by complement.

The window convention is documented at countOccurrences. Statements assume w ≠ [] when the empty word needs to be excluded. Further append, take, drop, and exact digit-counting results are in LeanPool.Champernowne.CountExtras.

Extending the list to the right preserves window hits.

The append lower bound #

Lower bound: occurrences inside a and inside b survive in a ++ b. Fails for w = [] (window counts overlap at the seam).

Occurrences in champBlocks #

Per-number occurrences survive in the stream.

Position characterization #

countOccurrences counts window start positions.

Word enumeration and the window pigeonhole #

allWords b k enumerates all length-k digit strings over {0, …, b−1} (leading zeros allowed) — the complement machinery that lets the upper occurrence bound be derived from the lower one: a window matching no v ≠ w must match w.

All length-k digit strings over {0, …, b−1}, leading zeros allowed.

Equations
Instances For
    theorem Champernowne.mem_allWords {b k : ℕ} {l : List ℕ} :
    l ∈ allWords b k ↔ l.length = k ∧ ∀ d ∈ l, d < b

    Window pigeonhole: a window position matches at most one length-k word, so over ALL length-k words the occurrence counts total at most the number of window start positions. This single inequality replaces the entire upper-bound counting chain.