Proposition 7.7 (Scott 1981, PRG-19, §7) — D^§ is effectively given #
Following Dana Scott, Lectures on a Mathematical Theory of Computation, PRG-19, Lecture VII.
Proposition 7.7. For any effectively given domain
D, the domainD^§is also effectively given, and all the combinators of Example 6.1 prove to be computable.
Scott transposes everything back to ℕ and gives the enumeration of D^§
(Example 6.1's tree
algebra, Example61.Dsharp) by a course-of-values recursion. In our model D^§
lives over
List Bool × α (Example 6.1), so the enumeration is V : ℕ → Set (List Bool × α):
V 0 = Γ(the master neighbourhood ofD^§);V (2n+1) = 0·Xₙ(embZeroof then-thD-neighbourhoodXₙ = P.X n);V (2n+2) = 1·V_{p n} ∪ 2·V_{q n}(embPairof two earlier neighbourhoods).
Here p n = n.unpair.1 and q n = n.unpair.2 are Scott's p, q (inverse
pairing): both are ≤ n,
hence the subscripts p n, q n of V_{2n+2} are < 2n+2, so the recursion is
well-founded and
membership stays recursive — exactly Scott's observation.
This file builds the construction in milestones:
A left bound for Nat.unpair (local, to keep Recursive.lean's cache #
warm).
n.unpair.1 ≤ n (choice-free); the decreasing measure for Vsharp's left
child.
Nat.pair is strictly monotone on strict componentwise order. #
Needed so the node∩node recursive child code pair (a.1) (b.1) is < pair (2a+2) (2b+2), hence
present in the memo table. Proof via max² ≤ pair _ _ < (max+1)².
Proposition 7.7 (Scott 1981, PRG-19). Scott's enumeration of D^§:
V₀ = Γ, V_{2n+1} = 0·Xₙ, V_{2n+2} = 1·V_{p n} ∪ 2·V_{q n} (p = unpair.1,
q = unpair.2).
Equations
- One or more equations did not get rendered due to their size.
- Domain.Neighborhood.Proposition77.Vsharp D P 0 = Domain.Neighborhood.Example61.Gamma D
Instances For
One-step unfolding of Vsharp at a successor index.
mem_X, surj, nonemptiness. #
Every V k is a neighbourhood of D^§.
Every neighbourhood of D^§ is enumerated as some V k (surjectivity of
V).
Under ∅ ∉ 𝒟, no V k is empty.
Per-parity intersection identities. #
These are the choice-free heart of Scott's "the reader has to check that
7.1(i)–(ii) hold for the
Vₖ. The idea is that any such check is either (1) trivial, or (2) something
already assumed about
D and the Xₙ, or (3) can be thrown back to some sets Vₘ with strictly
smaller subscripts."
V₀ = Γis the identity for∩(cases (1));- odd ∩ odd reduces to
D's own intersectionXₐ ∩ X_b(case (2)); - odd ∩ even (and even ∩ odd) are
∅— inconsistent (case (1), and∅ ∉ 𝒟^§); - even ∩ even is
embPairof the component intersections, whose subscriptsunpair.1 / unpair.2are strictly smaller (case (3)).
MemS-subset inversions and the consistency-via-subset equivalences. #
A nonempty D^§-neighbourhood contained in embZero Y must itself be an
embZero (its tokens have
empty {1,2}-path); contained in embPair A B, an embPair. These give the
bridge between Scott's
consistency relation on D^§ (∃ l, V_l ⊆ V_n ∩ V_m) and the recursive
sub-checks: embZero
consistency reduces to D's, and embPair consistency to the two components'.
A primitive-recursive course-of-values memo evaluator. #
The D^§ deciders (cons, inter, equality) recurse on the index trees: e.g.
inter(2a+2, 2b+2) recurses on inter(a.1, b.1) and inter(a.2, b.2). The
combined measure
w = Nat.pair n m strictly decreases on every recursive call, so each decider is
a unary
course-of-values recursion on w. We realise course-of-values by a
primitive-recursive memo
table: rtbl step w codes the reverse list [g(w-1), …, g 0] (g v = step (pair v (table for v))),
built by a single Nat.Primrec.prec whose step is a cons. To read g v for v < w inside step,
we look up position w-1-v of the reverse table via listGet. All choice-free.
One step of the list-indexing fold: state pair countdown value; capture the
current element
when countdown = 1, else carry the value and decrement.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Correctness of listGet on a coded list.
listGet is primitive recursive (on the Nat.pair coding of c, i).
The reverse memo table: rtbl step w codes [g(w-1), …, g 0].
Equations
- Domain.Neighborhood.Proposition77.rtbl step 0 = 0
- Domain.Neighborhood.Proposition77.rtbl step k.succ = Nat.pair (step (Nat.pair k (Domain.Neighborhood.Proposition77.rtbl step k))) (Domain.Neighborhood.Proposition77.rtbl step k) + 1
Instances For
The course-of-values value at w: g w = step (pair w (table of g below w)).
Equations
- Domain.Neighborhood.Proposition77.gOf step w = step (Nat.pair w (Domain.Neighborhood.Proposition77.rtbl step w))
Instances For
The reverse list of memo values [g(w-1), …, g 0].
Equations
Instances For
rtbl step is primitive recursive when step is (a single prec whose step
is a cons).
gOf step is primitive recursive when step is.
listGet as a binary primrec composite.
The combined D^§ decider step (eq/cons/inter triple). #
All three D^§ deciders recurse the same way on (i, j), so we compute them
together as a packed
triple packT eqBit consBit interIdx. The step dsharpStep fcons feq finter is
fed Scott's three
D-level primitive-recursive functions: fcons/feq are the extracted {0,1}
characteristic
functions of P.cons_computable/P.eq_computable, and finter is P.inter (on
Nat.pair codes).
The combined index is w = Nat.pair i j; in the node∩node case the children's
results are read from
the memo table by listGet.
Pack the triple (eqBit, consBit, interIdx) into one natural.
Equations
- Domain.Neighborhood.Proposition77.packT e c ii = Nat.pair e (Nat.pair c ii)
Instances For
Equality bit of a packed triple.
Equations
Instances For
Consistency bit of a packed triple.
Equations
- Domain.Neighborhood.Proposition77.consB r = (Nat.unpair (Nat.unpair r).2).1
Instances For
Intersection index of a packed triple.
Equations
- Domain.Neighborhood.Proposition77.intI r = (Nat.unpair (Nat.unpair r).2).2
Instances For
The D^§ decider step. p = pair (pair i j) tbl. Returns packT eqBit consBit interIdx,
case-splitting on i = 0 / j = 0 (the Γ identity), then on parities (leaf
2a+1 vs node
2a+2). Leaf∩leaf delegates to D's deciders; node∩node ANDs/combines the two
children read from
the memo table tbl.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The decider step is primitive recursive when the D-level functions are.
Correctness of the decider step (strong induction on the combined code). #
Given that fcons/feq/finter correctly decide D-consistency / D-equality
/ D-intersection,
the packed triple gOf (dsharpStep …) correctly decides D^§-consistency,
computes the
D^§-intersection index, and decides D^§-equality. Proved together by strong
induction on the
combined code Nat.pair i j; the node∩node case recurses to strictly smaller
codes (present in the
memo table by pair_lt_pair_of_lt).
Intersection-index correctness in isolation. The intI component of gOf (dsharpStep …) is
independent of the eq/cons bits (fcons/feq), so it is correct assuming
only that finter
correctly intersects in D. This lets the inter data field be built with
dummy fcons/feq
while staying choice-free.
Decidability of 7.1(i) for D^§. Vₙ ∩ Vₘ = V_k iff (n,m) is
consistent and the
computed intersection index agrees with k under D^§-equality. Inconsistency
forces the product
to 0 (and then Vₙ ∩ Vₘ = ∅ ≠ V_k, since V_k is nonempty), so the single
product decider is
correct on the nose.
Proposition 7.7: D^§ is effectively given. #
Assembling the pieces into a ComputablePresentation (Dsharp D hD). The
enumeration is Vsharp;
relation 7.1(ii) (consistency) and 7.1(i) (intersection-equality) are decided by
the packed-triple
deciders; the primitive-recursive intersection function reads the intI component
(built with dummy
eq/cons bits, which it does not depend on). Choice-free: the Prop fields
obtain D's
existential deciders, the data fields use only P.inter (data).
Proposition 7.7 (Scott 1981, PRG-19). A computable presentation of D^§
from one of D.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Proposition 7.7 (Scott 1981, PRG-19). If D is effectively given, so is
D^§.