Documentation

ECA.MarkovErrorCount

The Markov error count: a law on the last k symbols, and its bound #

DrivenColumns.lean proves a finite-valued sequence driven by an eventually periodic input eventually periodic, and exhibits a column that is not. This file connects two currencies: a sequence is eventually periodic exactly when SOME fixed law on its last k symbols answers correctly from some point on, and exactly when the fewest errors any such law makes stays bounded as the horizon grows. The fewest errors any such predictor makes before a horizon T is the error count of the best Markov predictor of order k in hindsight; divided by T it is the k-th order Markov predictability of Feder, Merhav and Gutman (1992), up to the convention for the first k symbols.

A sequence is eventually exact at order k when some law on its last k symbols answers the next symbol from some step on (EventuallyExact).

Main results #

Scope #

The two window theorems are registered as [RuleSpace] §4 Proposition 4.3, clause (i), row RS-7; nothing else here is registered against any paper: the class-level corollary is registered against none, [RuleSpace] §3 Proposition 3.1 being the class it ranges over and Proposition 4.3 the count's registration, cited for that reason alone, and it claims nothing at the twenty-eight rules in neither class; [RuleSpace] §4 Proposition 4.2 is what the rest extends, cited for that reason alone. The two window theorems are stated at a general local rule LocalRule.finRule f hq, never specialized beyond the guard pair's own column.

A law on the last k symbols, and eventual periodicity #

def ECA.EventuallyExact {α : Type u_1} (k : ℕ) (x : ℕ → α) :

A law on the last k symbols: some function of the window x t, …, x (t + k - 1) answers x (t + k), from some point on.

Equations
Instances For

    Eventual periodicity gives a law: the law that answers the oldest symbol its own period holds, at the period as order.

    A law gives eventual periodicity, over a finite alphabet. At k = 0 the law directly gives x eventually constant. At k > 0 the block of the last k symbols is itself driven — over a one-point input, by shiftAppendStep — hence eventually periodic by eventuallyPeriodic_of_driven, and x is its 0-th coordinate.

    The two directions above, as one equivalence.

    The finite alphabet is load-bearing in eventuallyPeriodic_of_eventuallyExact: the law that adds one to its one symbol is exact from the start, and the identity on the naturals repeats nowhere.

    The Markov error count #

    noncomputable def ECA.predictorErrors {α : Type u_1} [DecidableEq α] (k : ℕ) (L : (Fin k → α) → α) (x : ℕ → α) (T : ℕ) :

    How many errors a fixed law on the last k symbols makes, before horizon T.

    Equations
    Instances For
      noncomputable def ECA.markovErrorCount {α : Type u_1} [DecidableEq α] (k : ℕ) (x : ℕ → α) (T : ℕ) :

      The Markov error count: the fewest errors any law on the last k symbols makes before T.

      Equations
      Instances For
        theorem ECA.markovErrorCount_bounded_iff_eventuallyExact {α : Type u_1} [Finite α] [DecidableEq α] (k : ℕ) (x : ℕ → α) :
        (∃ (B : ℕ), ∀ (T : ℕ), markovErrorCount k x T ≤ B) ↔ EventuallyExact k x

        A bounded Markov error count is a law: the laws are finitely many, the infimum over a nonempty finite family in ℕ is attained at each T (ciInf_mem), so one law attains the infimum at infinitely many T (Finite.exists_infinite_fiber, the pigeonhole), hence — by monotonicity — at every T; a monotone count bounded above stops rising, and from the last rise on that law never errs.

        The existential count-currency form: bounded Markov error count at SOME order, exactly when eventually periodic.

        The window of a local rule #

        theorem ECA.exists_eventuallyExact_observedWindow_iff (f : LocalRule) (hq : f 0 0 0 = 0) (s₀ : FiniteConfiguration) (a : ℤ) (m : ℕ) :
        (∃ (k : ℕ), EventuallyExact k (observedWindow (f.finRule hq) s₀ a (m + 1))) ↔ (∃ (k : ℕ), EventuallyExact k (observedColumn (f.finRule hq) s₀ a)) ∧ ∃ (k : ℕ), EventuallyExact k (observedColumn (f.finRule hq) s₀ (a + ↑m))

        The window's law-currency form: the width-(m + 1) window is eventually exact at SOME order iff its two boundary columns each are, at their own (separate) orders — three applications of the pieces above around eventuallyPeriodic_observedWindow_iff.

        theorem ECA.exists_markovErrorCount_bounded_observedWindow_iff (f : LocalRule) (hq : f 0 0 0 = 0) (s₀ : FiniteConfiguration) (a : ℤ) (m : ℕ) :
        (∃ (k : ℕ) (B : ℕ), ∀ (T : ℕ), markovErrorCount k (observedWindow (f.finRule hq) s₀ a (m + 1)) T ≤ B) ↔ (∃ (k : ℕ) (B : ℕ), ∀ (T : ℕ), markovErrorCount k (observedColumn (f.finRule hq) s₀ a) T ≤ B) ∧ ∃ (k : ℕ) (B : ℕ), ∀ (T : ℕ), markovErrorCount k (observedColumn (f.finRule hq) s₀ (a + ↑m)) T ≤ B

        The window's count-currency form, the same fact read through markovErrorCount: both sides reduce to exists_markovErrorCount_bounded_iff_eventuallyPeriodic, and what remains is exactly eventuallyPeriodic_observedWindow_iff.

        The guards at rule 90 #

        The center column is eventually exact at order 0: it is eventually 0, from step 1 on.

        The cell beside it is eventually exact at NO order.

        Its Markov error count is unbounded, at every order.

        The count at the two classes of rules #

        theorem ECA.LocalRule.ZeroByEndpoints.exists_markovErrorCount_bounded_observedColumn (f : LocalRule) (hq : f 0 0 0 = 0) (hf : f.ZeroByEndpoints) (s₀ : FiniteConfiguration) (i : ℤ) :
        ∃ (k : ℕ) (B : ℕ), ∀ (T : ℕ), markovErrorCount k (observedColumn (f.finRule hq) s₀ i) T ≤ B

        The observer's bill at the zero class: at every rule of the zero class, every cell's Markov error count is bounded at some order. It is exists_markovErrorCount_bounded_iff_eventuallyPeriodic read through LocalRule.ZeroByEndpoints.eventuallyPeriodic_observedColumn; the class is [RuleSpace] §3 Proposition 3.1's and the count's registration [RuleSpace] §4 Proposition 4.3, cited for that reason alone.

        theorem ECA.LocalRule.ZeroByEndpoints.exists_markovErrorCount_bounded_observedWindow (f : LocalRule) (hq : f 0 0 0 = 0) (hf : f.ZeroByEndpoints) (s₀ : FiniteConfiguration) (a : ℤ) (m : ℕ) :
        ∃ (k : ℕ) (B : ℕ), ∀ (T : ℕ), markovErrorCount k (observedWindow (f.finRule hq) s₀ a (m + 1)) T ≤ B

        The same bill at every window of the zero class: the width-(m + 1) window at cell a has a bounded count at some order, by the window form through the column form at its two end cells.

        Both hypotheses of the corollary hold at once, at rule 170 (the shift) from the single seed 1 at cell 0, and its conclusion is asserted there.

        The class hypothesis is load-bearing: rule 90 lies in the other class, and at it the cell-one column's Markov error count exceeds every bound, at every order.

        Axiom audit #

        Every public theorem above is #print axioms-clean on the standard triple, and the guards below make that build-enforced.