Exercise 5.16 follow-up (Scott 1981, PRG-19, Lecture V) — the Thue–Morse #
sequence t
The unfinished tail of Exercise 5.16. Returning to the domain C of
finite/infinite binary
sequences (Example 4.4), Scott studies the element
t = 0·merge(neg t, tail t),
the least fixed point of Φ(x) = 0·merge(neg x, tail x), and (Lambek's
observation) identifies its
n-th digit with the parity of the binary digits of n — the Thue–Morse
sequence.
This module formalizes:
- Step 0 — the element and its unfolding.
tElt := Φ.fixElementandtElt_unfoldprovingt = 0·merge(neg t, tail t). - The Thue–Morse morphism
expand(the substitution0 ↦ 01,1 ↦ 10) and the key bridgePhi_strBot_expand: applied to a partial element(0σ)⊥, the operatorΦis exactlyexpand. Consequently the finite approximants of the least fixed point areΦⁿ⁺¹(⊥) = (expandⁿ[0])⊥(iterElem_succ_eq). - The parity bit-function
tmwithtm n = ⊕ (binary digits of n)(viaNat.bits), its recurrencestm (2n) = tm n,tm (2n+1) = ¬ tm n, and the bridgeexpand_iterate_eqshowing the approximant strings are precisely the Thue–Morse parity prefixestmList (2ⁿ). - Property (a) — the digit characterization.
tElt_mem_cone_iff: a finite stringσis a prefix oftiffσis the length-σ.lengthThue–Morse prefix (σ = tmList σ.length); and the digit readingtElt_digit : (tmList n ++ [tm n])⊥ ≤ t, i.e. then-th digit oftistm n, the parity of the binary digits ofn(Lambek).
The tElt data is choice-free; the Prop-level digit facts may use
Classical.choice (through the
project's eq_of_toElementMap_principal and the truth-domain primitives), exactly
like the existing
uniqueness lemmas. Overlap-freeness (property (b)) is a self-contained
word-combinatorics theorem and
lives in its own module.
The Thue–Morse substitution applied letterwise: each bit b is replaced by b (¬b).
Equations
Instances For
expand distributes over append (it is a monoid morphism Σ* → Σ*).
The second (total/partial-flag) component of an interleaving with a partial
first input is
always
false: a partial input keeps the output partial.
The interleaving of h :: flip ρ with ρ (both starting after a common head
h) is
h :: expand ρ. This is the heart of why Φ is the Thue–Morse morphism on the
trajectory.
Exercise 5.16 (the operator Φ). Φ(x) = 0·merge(neg x, tail x) as an
approximable map.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The value of Φ on a partial element σ⊥ is (0 · weave σ)⊥, the leading
0 prepended to the
interleaving of (flip σ)⊥ and (tail σ)⊥.
The Thue–Morse trajectory. On a partial element whose string starts with
0, Φ acts
as the
Thue–Morse morphism expand.
The finite approximants of the least fixed point are the morphism #
iterates.
The base of the iterated bottom element: f⁰(⊥) = ⊥.
A one-step unfolding of the iterated bottom element: fⁿ⁺¹(⊥) = f(fⁿ(⊥)).
⊥ = []⊥ in C (the cone of Λ is the master).
Exercise 5.16 (the approximants). The (k+1)-st approximant of the least
fixed point is the
partial element of the k-fold Thue–Morse morphism iterate of [0]:
Φᵏ⁺¹(⊥) = (expandᵏ[0])⊥.
The Thue–Morse bit-function: tm n = ⊕(binary digits of n), the parity of the
number of 1s in
the binary expansion of n (Lambek's description).
Equations
Instances For
Step 0 — the element t and its unfolding. #
Exercise 5.16 (Scott 1981, PRG-19). Scott's Thue–Morse element t = 0·merge(neg t, tail t),
the least fixed point of Φ.
Instances For
Exercise 5.16 — the defining unfolding. t = 0·merge(neg t, tail t).
Property (a) — the digit characterization. #
(strBot τ) has the cone of σ as a neighbourhood iff σ is a prefix of
τ.
σΣ* = Σ* iff σ = Λ.
Each approximant is below the least fixed point.
Property (a), prefix form. Every Thue–Morse parity prefix is a prefix of
t:
(tmList n)⊥ ⊑ t for all n.
Property (a) (Scott 1981, PRG-19; Lambek). The finite-prefix
characterization of t: a
string σ is a prefix of t iff it is the length-σ.length Thue–Morse
parity prefix. Reading
off position n, the n-th digit of t is tm n, the parity of the binary
digits of n.