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 #
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
- Champernowne.allWords b 0 = {[]}
- Champernowne.allWords b k.succ = (Finset.range b).biUnion fun (d : ℕ) => Finset.image (fun (x : List ℕ) => d :: x) (Champernowne.allWords b k)
Instances For
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.