Asymptotic frequency of digit blocks #
champM b n is the digit length of the number straddling position n.
The natural-number prefix bounds give an error that is little-o of n, and
therefore the frequency of each nonempty length-k word tends to b⁻ᵏ.
Digit length of the straddling number champIndex b n + 1.
Equations
- Champernowne.champM b n = Nat.log b (Champernowne.champIndex b n + 1) + 1
Instances For
General-w packaging #
Instantiates the Positions.lean straddle transfer at M := champM b n.
w.length ≤ champM b n holds only eventually, since champM b n → ∞
(tendsto_champM_atTop), so the transfer itself is wrapped in ∀ᶠ.
theorem
Champernowne.countOccurrences_champPrefix_sub_isLittleO
{b : ℕ}
(hb : 1 < b)
{w : List ℕ}
(hw : ∀ d ∈ w, d < b)
(hwne : w ≠ [])
:
(fun (n : ℕ) => ↑(countOccurrences w (champPrefix b n)) - ↑n / ↑b ^ w.length) =o[Filter.atTop] fun (n : ℕ) => ↑n
countOccurrences w (champPrefix b n) − n/b^k = o(n).
theorem
Champernowne.tendsto_countOccurrences_champPrefix_div
{b : ℕ}
(hb : 1 < b)
{w : List ℕ}
(hw : ∀ d ∈ w, d < b)
(hwne : w ≠ [])
:
Filter.Tendsto (fun (n : ℕ) => ↑(countOccurrences w (champPrefix b n)) / ↑n) Filter.atTop (nhds (↑b ^ w.length)⁻¹)
Every nonempty block w (digits < b)
occurs in the base-b Champernowne stream with asymptotic frequency
b⁻ᵏ.