FormalConjecturesForMathlib/Computability/AutomaticSequence.lean
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:
- [AS03] Allouche, Jean-Paul, and Jeffrey Shallit. "Automatic Sequences: Theory, Applications, Generalizations." Cambridge University Press, 2003.
- [Eil74] Eilenberg, Samuel. "Automata, Languages, and Machines. Vol. A." Academic Press, 1974. Chapter V, Proposition 3.3.
Main definitions
AutomaticSequence.kKernel: thek-kernel of a sequence.AutomaticSequence.IsAutomatic:k-automaticity, as finiteness of thek-kernel.
Imports (1)
Imported by 2 files
- def
AutomaticSequence.kKernelThek-kernel of a sequenceais the set of subsequences $(a_{k^e n + r})_{n \ge 0}$ with $e \ge 0$ and $0 \le r < k^e$ line 54 sourceSource documentation
The
k-kernel of a sequenceais 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,SetProof uses:
Set.ofPred,Exists,And,LT.lt,HPow.hPow,Eq,HAdd.hAdd,HMul.hMul8 instances, coercions and auxiliary constants left out.
def kKernel (k : ℕ) (a : ℕ → α) : Set (ℕ → α) := …
- theorem
AutomaticSequence.self_mem_kKernelA sequence is a member of its ownk-kernel, viae = r = 0line 58 sourceSource documentation
A sequence is a member of its own
k-kernel, viae = r = 0.standard axioms: Quot.sound, propext what this means
Statement uses:
Nat,Membership.mem,Set, AutomaticSequence.kKernelProof 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_self20 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
- def
AutomaticSequence.IsAutomaticA sequenceaisk-automatic if itsk-kernel is finite line 66 sourceSource documentation
A sequence
aisk-automatic if itsk-kernel is finite. By [Eil74] this is equivalent toabeing generated by a deterministic finite automaton reading the base-kdigits of the index.no axioms what this means
Statement uses:
NatProof uses:
Set.Finite, AutomaticSequence.kKerneldef IsAutomatic (k : ℕ) (a : ℕ → α) : Prop := (kKernel k a).Finite
Mentions: AutomaticSequence.kKernel
- theorem
AutomaticSequence.IsAutomatic.finite_rangeAk-automatic sequence withk ≥ 2takes finitely many values:a mis the value at0of the kernel elementn ↦ a (k ^ m * n + m)line 72 sourceSource documentation
A
k-automatic sequence withk ≥ 2takes finitely many values:a mis the value at0of the kernel elementn ↦ 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.rangeProof 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_trueand 6 more14 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
- theorem
AutomaticSequence.kKernel_constThek-kernel of a constant sequence is a singleton line 79 sourceSource 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.singletonProof 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_true20 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
- theorem
AutomaticSequence.isAutomatic_constA constant sequence isk-automatic line 85 sourceSource documentation
A constant sequence is
k-automatic.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat, AutomaticSequence.IsAutomaticProof uses:
Eq.mpr,Set.Finite, AutomaticSequence.kKernel,id,Eq,congrArg,AutomaticSequence.IsAutomatic.eq_1,Singleton.singleton,Set, AutomaticSequence.kKernel_const,Set.finite_singleton1 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