Example 4.4 (Scott 1981, PRG-19, §4) — the domain C of binary sequences #
Scott's domain C of finite or infinite binary sequences (pages 61–64), a
generalization of the
natural-number domain N of Example 4.3. Over the tokens Σ* = List Bool
(Scott's Σ = {0,1},
Λ = []), recall the cones cone σ = σΣ* of Example 1.B. The system C adds the
singletons:
C = {σΣ* ∣ σ ∈ Σ*} ∪ {{σ} ∣ σ ∈ Σ*}.
The total elements correspond to finite or infinite sequences: σ = ↑{σ}
(strElem σ, the finite
sequence σ completed) and σ⊥ = ↑σΣ* (strBot σ, the partial element "starts
with σ"). C
is again nested-or-disjoint, so it is a neighbourhood system
(ofNestedOrDisjoint).
We equip C with the two successors x ↦ 0x and x ↦ 1x (consMap false,
consMap true),
prepending a bit, with their action on the finite/partial elements
(consMap_strElem,
consMap_strBot). As Scott's illustration that recursion now lives inside |C|,
we then define the
alternating sequence a = 01a as the least fixed point of x ↦ 0(1x) (altElt,
altElt_eq),
using the Fixed-point Theorem 4.1.
The remaining structure maps Scott lists for ⟨C, Λ, 0, 1, tail, empty, zero, one⟩ — the
predecessor analogue tail (tail(0x) = tail(1x) = x, tail(Λ) = ⊥) and the
three tests
empty, zero, one : C → T — are exactly the parts Scott leaves as exercises ("It
is left to the
reader to show that tail exists as an approximable mapping"; "it is an
exercise to show these
are approximable", Exercise 4.19); they are out of scope for this module.
The data constructions (C, consMap) are choice-free (#print axioms ⊆ {propext, Quot.sound}).
Prepending a bit: set-level lemmas (reused from Example 1.B). #
σ{τ} = {στ}: prepending σ to a singleton is the singleton of the
concatenation.
Prepending is monotone in its set argument.
Membership in C: a neighbourhood is a cone σΣ* or a singleton {σ}.
Equations
- Domain.Neighborhood.Example44.memC X = ((∃ (σ : Domain.Neighborhood.ExampleB.Str), X = Domain.Neighborhood.ExampleB.cone σ) ∨ ∃ (σ : Domain.Neighborhood.ExampleB.Str), X = {σ})
Instances For
{τ} ⊆ σΣ* iff σ is an initial segment of τ.
A singleton and a cone are nested-or-disjoint.
Any two neighbourhoods of C are nested or disjoint.
Scott's partial element σ⊥ = ↑σΣ* ("the sequence starts with σ").
Instances For
Scott's total element σ = ↑{σ} (the finite sequence σ, completed).
Instances For
Prepending the bit b (or, generally, a prefix σ) to a neighbourhood of C
lands back in
C: σ(τΣ*) = (στ)Σ* and σ{τ} = {στ}.
σX ⊆ X along the prefix order: a prepended neighbourhood is contained in any
neighbourhood it
refines. (Used only via prepend_mono; kept implicit.)
Example 4.4 — the successors x ↦ bx. The approximable map prepending the
bit b:
X (bx) Y ↔ bX ⊆ Y. Approximable because bX is again a neighbourhood
(memC_prepend) and
prepending is monotone.
Equations
- One or more equations did not get rendered due to their size.
Instances For
bx on a partial element: b(σ⊥) = (bσ)⊥.
bx on a total element: b(σ) = (bσ) (prepend the bit to a finite sequence).
A fixed-point element: the alternating sequence a = 01a. #
a = 0(1a): altElt satisfies Scott's defining equation.