Documentation

LeanPool.Champernowne.Defs

Champernowne sequence: core definitions #

The digits of each positive integer are written in big-endian order in base b. champBlocks b N concatenates the first N blocks, and champDigit b is the resulting infinite digit stream. countOccurrences counts overlapping finite words, and IsNormalSequence states their limiting frequencies.

Definitions allow every base; hypotheses 1 < b appear on the results that need them. The prefix-coherence API is in LeanPool.Champernowne.Prefix.

Big-endian digits of n in base b.

Equations
Instances For

    First N blocks of the base-b Champernowne sequence: digits of 1..N.

    Equations
    Instances For

      The i-th digit (0-indexed) of the base-b Champernowne sequence.

      Equations
      Instances For

        Number of (overlapping) occurrences of w as a contiguous block of l.

        Window convention: l.tails yields the suffixes starting at positions 0, 1, …, l.length (the last being []). A tail shorter than w can never satisfy w.isPrefixOf, so the windows that can count are exactly the start positions 0 … l.length - w.length; there are no partial windows at the end of the list. In particular countOccurrences w l = 0 whenever w.length > l.length, and countOccurrences [] l = l.length + 1 (the empty word is a prefix of every tail) — callers always pass w ≠ [].

        Equations
        Instances For

          Normality of a digit sequence in base b: every block of length k (entries < b, leading zeros allowed) has asymptotic frequency b⁻ᵏ.

          Equations
          • One or more equations did not get rendered due to their size.
          Instances For