FormalConjecturesForMathlib/Computability/AutomaticSequence.lean

GitHub source file

Explanation legend Lean4 Domain Explanation Language (L4DEL)

L4DEL explanations are a separate layer. They do not change the Lean source. Intuition is explanatory prose; numbered items are a reading path; sources link the wording back to evidence.

L4DEL
Lean4 Domain Explanation Language

Credit: The upstream authors and contributors retain credit for the project and mathematics. lean4-explainer only renders their pinned source and adds the separately disclosed explanation layer.

Project sources: Pinned project documentation, Formal Conjectures paper, arXiv v1

6 declarations, 0 contain sorry, 0 declared as axioms

Automatic sequences

A sequence a : ℕ → α is k-automatic if it is the output of a deterministic finite automaton fed the base-k digits of the index. By the kernel criterion of [Eil74] this holds exactly when the k-kernel of a is finite, and that is the definition used here: it needs no automaton, and finiteness of the kernel is what proofs about automatic sequences consume.

For k ≥ 2, IsAutomatic k a already forces the range of a to be finite, by AutomaticSequence.IsAutomatic.finite_range. For k ≤ 1 the k-kernel of a is {a}, so every sequence is k-automatic.

References:

Main definitions

Imports (1)
Imported by 2 files
  1. def AutomaticSequence.kKernel The k-kernel of a sequence a is the set of subsequences $(a_{k^e n + r})_{n \ge 0}$ with $e \ge 0$ and $0 \le r < k^e$ line 54 source

    Source documentation

    The k-kernel of a sequence a is the set of subsequences $(a_{k^e n + r})_{n \ge 0}$ with $e \ge 0$ and $0 \le r < k^e$.

    no axioms what this means

    Statement uses: Nat, Set

    Proof uses: Set.ofPred, Exists, And, LT.lt, HPow.hPow, Eq, HAdd.hAdd, HMul.hMul

    8 instances, coercions and auxiliary constants left out.

    def kKernel (k : ℕ) (a : ℕ → α) : Set (ℕ → α) :=
    …
  2. theorem AutomaticSequence.self_mem_kKernel A sequence is a member of its own k-kernel, via e = r = 0 line 58 source

    Source documentation

    A sequence is a member of its own k-kernel, via e = r = 0.

    standard axioms: Quot.sound, propext what this means

    Statement uses: Nat, Membership.mem, Set, AutomaticSequence.kKernel

    Proof uses: Exists.intro, Exists, And, LT.lt, HPow.hPow, Eq, HAdd.hAdd, HMul.hMul, OfNat.ofNat, And.intro, of_eq_true, Eq.trans, True, congrArg, funext, congrFun', Nat.one_mul, eq_self

    20 instances, coercions and auxiliary constants left out.

    Tactic trace: 2 steps

    Open to load the checked before-and-after goal states.

    theorem self_mem_kKernel (k : ℕ) (a : ℕ → α) : a ∈ kKernel k a :=
    …

    Mentions: AutomaticSequence.kKernel

  3. def AutomaticSequence.IsAutomatic A sequence a is k-automatic if its k-kernel is finite line 66 source

    Source documentation

    A sequence a is k-automatic if its k-kernel is finite. By [Eil74] this is equivalent to a being generated by a deterministic finite automaton reading the base-k digits of the index.

    no axioms what this means

    Statement uses: Nat

    Proof uses: Set.Finite, AutomaticSequence.kKernel

    def IsAutomatic (k : ℕ) (a : ℕ → α) : Prop := (kKernel k a).Finite

    Mentions: AutomaticSequence.kKernel

  4. theorem AutomaticSequence.IsAutomatic.finite_range A k-automatic sequence with k ≥ 2 takes finitely many values: a m is the value at 0 of the kernel element n ↦ a (k ^ m * n + m) line 72 source

    Source documentation

    A k-automatic sequence with k ≥ 2 takes finitely many values: a m is the value at 0 of the kernel element n ↦ a (k ^ m * n + m).

    standard axioms: Classical.choice, Quot.sound, propext what this means

    Statement uses: Nat, LE.le, OfNat.ofNat, AutomaticSequence.IsAutomatic, Set.Finite, Set.range

    Proof uses: Set.Finite.subset, Set.image, AutomaticSequence.kKernel, Set.Finite.image, Iff.mpr, Set, Membership.mem, Set.range_subset_iff, Exists.intro, And, Eq, HAdd.hAdd, HMul.hMul, HPow.hPow, And.intro, Exists, LT.lt, Nat.lt_pow_self, rfl, of_eq_true and 6 more

    14 instances, coercions and auxiliary constants left out.

    Tactic trace: 1 steps

    Open to load the checked before-and-after goal states.

    theorem IsAutomatic.finite_range {k : ℕ} {a : ℕ → α} (hk : 2 ≤ k) (h : IsAutomatic k a) :
        (Set.range a).Finite :=
    …

    Mentions: AutomaticSequence.IsAutomatic

  5. theorem AutomaticSequence.kKernel_const The k-kernel of a constant sequence is a singleton line 79 source

    Source documentation

    The k-kernel of a constant sequence is a singleton.

    standard axioms: Quot.sound, propext what this means

    Statement uses: Nat, Eq, Set, AutomaticSequence.kKernel, Singleton.singleton

    Proof uses: Set.ext, Eq.mpr, Iff, Membership.mem, Exists, And, LT.lt, HPow.hPow, id, congrArg, Iff.intro, Exists.intro, OfNat.ofNat, And.intro, of_eq_true

    20 instances, coercions and auxiliary constants left out.

    Tactic trace: 4 steps

    Open to load the checked before-and-after goal states.

    theorem kKernel_const (k : ℕ) (c : α) : kKernel k (fun _ : ℕ => c) = {fun _ => c} := by
    …

    Mentions: c, AutomaticSequence.kKernel

  6. theorem AutomaticSequence.isAutomatic_const A constant sequence is k-automatic line 85 source

    Source documentation

    A constant sequence is k-automatic.

    standard axioms: Classical.choice, Quot.sound, propext what this means

    Statement uses: Nat, AutomaticSequence.IsAutomatic

    Proof uses: Eq.mpr, Set.Finite, AutomaticSequence.kKernel, id, Eq, congrArg, AutomaticSequence.IsAutomatic.eq_1, Singleton.singleton, Set, AutomaticSequence.kKernel_const, Set.finite_singleton

    1 instances, coercions and auxiliary constants left out.

    Tactic trace: 2 steps

    Open to load the checked before-and-after goal states.

    theorem isAutomatic_const (k : ℕ) (c : α) : IsAutomatic k (fun _ => c) := by
    …

    Mentions: c, AutomaticSequence.IsAutomatic