Example 6.2 (Scott 1981, PRG-19, §6) — the generalisation A ≅ Aⁿ + Aⁿ #
Following Dana Scott, Lectures on a Mathematical Theory of Computation, PRG-19
(1981), Lecture VI.
After the staple equations B ≅ B + B and C ≅ {{Λ}} + C + C (see
Example62.lean/Example62C.lean),
Scott proposes "a simple, yet interesting generalization of B": for any n, the
domain equation
A ≅ Aⁿ + Aⁿ,
where Aⁿ is the n-fold cartesian power. He solves it concretely over Σ* = {0,1}* as the least
family
A = {Σ*} ∪ ⋃_{i∈{0,1}} { i ⋃_{j<n} 1ʲ0 X_j ∣ X_j ∈ A for all j < n },
so a neighbourhood (other than the master Σ*) is a tag bit i (Scott's +/−,
here true/false)
followed by n slots, slot j reached behind the self-delimiting prefix 1ʲ0.
An element of A
(other than ⊥) is thus ±⟨a₀, …, a_{n-1}⟩: an n-tuple of elements of A, in
one of two copies.
This module delivers:
npow V n— the flatn-fold productVⁿoverFin n × β, with neighbourhoods the proper productsprodN X = ⋃_j {j} × X_j. (Closure under intersection is componentwise — no tags, so no non-emptiness needed.)Asys n hn— Scott's domainAover{0,1}*(the inductive familyMemA), a neighbourhood system under0 < n(so there is a coordinate to witness non-emptiness, Scott's∅ ∉ A). The slot encoding isembTuple, parsed via the uniqueness lemmaslotPre_inj.A_domain_equation— the order-isomorphismaaEquiv : |A| ≃o |Aⁿ + Aⁿ|, i.e.Asys n hn ≅ᴰ sum (npow A n) (npow A n) …, mirroringExample61.dsharpEquiv.
For n = 1 this recovers B ≅ B + B (one slot per copy); the tree picture and
the automata-theory
aside (eventually-periodic trees ↔ regular events) are formalised in
Example62Regular.lean.
All data is choice-free (#print axioms ⊆ {propext, Quot.sound}).
The proper product neighbourhood ⋃_{j<n} {j} × X_j: token (j, b) lies in
it iff b ∈ X_j.
This is the n-ary analogue of prodNbhd (Definition 3.1).
Instances For
The n-fold product Vⁿ of a neighbourhood system V, over Fin n × β.
Its
neighbourhoods
are exactly the proper products prodN X with each component X j ∈ V. Closure
under intersection is
componentwise (no tags to disambiguate, so no non-emptiness is needed here).
Equations
- One or more equations did not get rendered due to their size.
Instances For
Under Scott's standing assumption ∅ ∉ V, no neighbourhood of Vⁿ is empty
(provided 0 < n,
so there is a coordinate to witness).
Scott's slot encoding i ⋃_{j<n} 1ʲ0 X_j over {0,1}*. #
The slot prefix i 1ʲ 0: the leading tag bit i (Scott's +/−), then j
ones, then a zero.
Reaching component j of the tag-i tuple means matching this prefix.
Equations
Instances For
Parsing the 1ʲ0 body: the position of the first false pins down j and
the remainder.
Uniqueness of slot decomposition. A token i 1ʲ 0 u determines the tag
i, the index j,
and the remainder u. This is what makes the slots pairwise disjoint.
Scott's tag-i tuple neighbourhood i ⋃_{j<n} 1ʲ0 X_j: the union of the
n slots,
slot j
holding X j behind the prefix i 1ʲ 0. (For i = false/true these are
Scott's left/right
copies, the −/+ summands.)
Equations
- One or more equations did not get rendered due to their size.
Instances For
The neighbourhood system A solving A ≅ Aⁿ + Aⁿ. #
Scott's domain A as the least family of subsets of Σ* = {0,1}*
containing (i) the
master
Σ* and (ii) every tag-i tuple i ⋃_{j<n} 1ʲ0 X_j built from components X j
already in A:
A = {Σ*} ∪ ⋃_{i∈{0,1}} { i ⋃_{j<n} 1ʲ0 X_j ∣ X_j ∈ A }.
- univ {n : ℕ} : MemA n Set.univ
- tuple {n : ℕ} (i : Bool) {X : Fin n → Set ExampleB.Str} : (∀ (j : Fin n), MemA n (X j)) → MemA n (embTuple i X)
Instances For
Under 0 < n every neighbourhood of A is non-empty (Scott's ∅ ∉ A).
A is closed under consistent intersection. Scott's verification, by
induction on the
way X
entered A: the cross case embTuple false · ∩ embTuple true · collapses to ∅
(killed by the
non-empty witness), the same-tag case combines componentwise (recursing on the
consistency witness's
slots).
Scott's domain A packaged as a neighbourhood system over {0,1}* (needs
0 < n).
Equations
- Domain.Neighborhood.Example62A.Asys n hn = { mem := Domain.Neighborhood.Example62A.MemA n, master := Set.univ, master_mem := ⋯, inter_mem := ⋯, sub_master := ⋯ }
Instances For
The domain equation A ≅ Aⁿ + Aⁿ. #
The n-fold product Aⁿ = npow A n.
Equations
Instances For
The right-hand side of Scott's equation: the separated sum Aⁿ + Aⁿ.
Equations
Instances For
Forward half of A ≅ Aⁿ + Aⁿ. An element z of A is sent to the sum
element
recording, for
each branch, whether z reaches the left copy 0X (left summand Aⁿ) or the
right copy 1Y (right
summand Aⁿ).
Equations
- One or more equations did not get rendered due to their size.
Instances For
Example 6.2 (Scott 1981, PRG-19) — the domain equation A ≅ Aⁿ + Aⁿ.
Scott's "simple, yet
interesting generalization of B": the domain A over {0,1}* (whose non-⊥
elements are the two
copies — left − and right + — of an n-tuple of elements of A) is
isomorphic to the separated
sum Aⁿ + Aⁿ of two copies of its own n-fold cartesian power.