Example 6.2 (Scott 1981, PRG-19, §6) — eventually-periodic trees and regular #
events
Following Dana Scott, Lectures on a Mathematical Theory of Computation, PRG-19
(1981), Lecture VI,
Introduction to domain equations. After exhibiting the generalised domain
equation A ≅ Aⁿ + Aⁿ
(formalised in Example62A.lean), Scott closes Example 6.2 with a casual aside
connecting his
infinite ±-labelled n-ary trees to automata theory:
"We say that a (total) tree
ais eventually periodic iff the set{aσ ∣ σ ∈ Σ*}is finite. The result is that the 'language'L_a = {σ ∈ Σ* ∣ pos(aσ) = true}corresponding to an eventually periodic tree is always a regular event of automata theory, and every such language has this form. In fact,ajust represents the initial state of an automaton, andaσrepresents the state after 'reading' a tapeσ."
This file makes that remark precise and proves it. Scott's total trees over Σ = {0, …, n-1} are
exactly the functions a : Σ* → Bool assigning a ± label (pos) to every node,
addressed by a
finite selector σ ∈ Σ*. The subtree operation σ ↦ aσ is Scott's selector
recursion
aΛ = a, a(iσ) = (aᵢ)σ; its language L_a is the set of selectors landing on
a + node.
The two halves of Scott's claim are exactly the two halves of the Myhill–Nerode
theorem: a tree
is eventually periodic (finitely many distinct subtrees) iff its language has
finitely many left
quotients iff (Myhill–Nerode, Language.isRegular_iff_finite_range_leftQuotient)
the language is
regular. The bridge is that the subtree aσ is the left quotient σ⁻¹ L_a:
reading the tape σ
moves the automaton to the residual language, which is precisely the subtree at
σ.
This is a Prop-level result (about regularity), so Classical.choice is
unobjectionable here; the
content is entirely the combinatorics-on-words / automata correspondence,
orthogonal to the
neighbourhood-system machinery.
A total tree over the alphabet Σ = Fin n (Scott's n-ary ± tree): an
assignment of a
± label (Bool, true = +) to every node, addressed by a finite selector σ ∈ Σ*. A tree is
total in Scott's sense (every node carries a genuine label), as opposed to the
partial elements of
the domain A of Example62A.lean where labels may be ⊥.
Equations
- Domain.Neighborhood.Example62Regular.Tree n = (List (Fin n) → Bool)
Instances For
Scott's subtree selector σ ↦ aσ: the subtree of a reached by the selector
σ. Defined so
that (aσ)τ = a(στ); the pos-label at node τ of aσ is the label at node
στ of a.
Equations
- Domain.Neighborhood.Example62Regular.select a σ τ = a (σ ++ τ)
Instances For
The i-th immediate subtree aᵢ = a i (Scott's children of the root node).
Equations
Instances For
Scott's language of a tree. L_a = {σ ∈ Σ* ∣ pos(aσ) = true} — the
selectors that land on a
+ node. Equivalently (by pos_select) the set of σ with a σ = true. A
Language (Fin n) is
just a set of words over the alphabet, exactly Scott's "language".
Instances For
The subtree is the left quotient. L_{aσ} = σ⁻¹ L_a: the language of the
subtree reached by
reading σ is exactly the left quotient of L_a by σ (the residual / "state
after reading
σ"). This is the heart of Scott's "a is the initial state, aσ the state
after reading σ".
The label function recovers the tree from its language, so treeLang is
one-one: two trees
with the same language are the same tree (a node's ± label is recorded by
whether its selector is
in the language).
Eventual periodicity (Scott). A tree a is eventually periodic iff the
set of its
subtrees
{aσ ∣ σ ∈ Σ*} is finite. (Equivalently — by the picture — the tree is built from
finitely many
distinct subtrees, so it is "ultimately periodic" along every branch.)
Equations
Instances For
Scott's closing claim, made precise (Example 6.2). A tree's language L_a
is a regular
event of automata theory iff the tree is eventually periodic. This is the
Myhill–Nerode theorem
in disguise: the subtrees aσ are the left quotients σ⁻¹ L_a
(treeLang_select), so "finitely many
subtrees" is "finitely many left quotients", which Myhill–Nerode equates with
regularity.
The inverse half of Scott's claim: every regular event arises as the
language of an
eventually
periodic tree. Concretely, take the tree whose root labels record membership in
L; reading a tape
σ lands on the residual language σ⁻¹ L, of which there are finitely many
exactly when L is
regular.