Exercise 5.14 (Scott 1981, PRG-19, Lecture V) — the graph model Pω #
Using the pairing function of Exercise 5.13, code finite sequences by
[n₀, …, n_k] = num(n₀, [n₁, …, n_k])and define
fun(u)(x) = {m ∣ ∃ n₀ … n_{k-1} ∈ x, [n₀+1, …, n_{k-1}+1, 0, m] ∈ u},graph(f) = {[n₀+1, …, n_{k-1}+1, 0, m] ∣ m ∈ f({n₀, …, n_{k-1}})}.Show
fun ∘ graph = λf.f(for continuousf) andgraph ∘ fun ⊇ λx.x.
Following Exercises 4.17 and 5.13, the power-set domain Pω is modelled by the
complete lattice
(Set ℕ, ⊆).
The coding #
The decisive device is the tag
tag [n₀, …, n_{k-1}] m = [n₀+1, …, n_{k-1}+1, 0, m] = num(n₀+1, … num(n_{k-1}+1, num(0, m))…),
defined by
tag [] m = num 0 m, tag (n :: ns) m = num (n+1) (tag ns m).
It is a bijection (List ℕ) × ℕ ≃ ℕ: injectivity (tag_injective) is an
induction using
num_injective, and surjectivity (tag_surjective) is strong induction on the
value, decreasing
because num (n+1) b > b (num_succ_left_gt) — the head's first coordinate is
either 0 (stop,
emit m) or ≥ 1 (peel one entry and recurse on a strictly smaller code).
The maps #
With entries ns = {n ∣ n ∈ ns} the finite set of entries of a list:
Fun u x = {m ∣ ∃ ns, (∀ n ∈ ns, n ∈ x) ∧ tag ns m ∈ u},Graph f = {c ∣ ∃ ns m, c = tag ns m ∧ m ∈ f (entries ns)}.
fun ∘ graph = id holds only for continuous maps, captured by
IsApprox f := Monotone f ∧ (finite approximation). We prove:
Fun_Graph:Fun (Graph f) x = f xforIsApprox f— the reflexive equationfun ∘ graph = λf.f;id_le_Graph_Fun:u ⊆ Graph (Fun u)— the inclusiongraph ∘ fun ⊇ λx.x(genuinely⊇, since reorderings/duplications of a list with the sameentriesgive other codes inGraph (Fun u));Fun_isApprox: everyFun uis itselfIsApprox, sofunlands in the continuous maps.
Everything is choice-free (#print axioms ⊆ {propext, Quot.sound}).
A strict lower bound for num #
num (n+1) b strictly exceeds its second argument: this is what makes the
decode recursion
terminate. num (n+1) b = T(n+1+b) + b ≥ (n+b+1) + b > b.
The tag: coding (List ℕ) × ℕ as ℕ #
tag [n₀, …, n_{k-1}] m = [n₀+1, …, n_{k-1}+1, 0, m], built from the pairing
function num.
Equations
Instances For
The tag is onto: every c : ℕ decodes as some tag ns m. Strong
induction on c,
decreasing via num_succ_left_gt.
The maps fun and graph #
graph(f) — the code of the function f.
Equations
- Domain.Neighborhood.Exercise514.Graph f = {c : ℕ | ∃ (ns : List ℕ) (m : ℕ), c = Domain.Neighborhood.Exercise514.tag ns m ∧ m ∈ f (Domain.Neighborhood.Exercise514.entries ns)}
Instances For
A map f : Pω → Pω is approximable (continuous) when it is monotone and
every output is
already produced by a finite subset of the input. The finite subsets of x are
exactly the
entries ns with all entries in x.
Monotonicity is phrased as an explicit ⊆-implication rather than Monotone f:
on Set ℕ the
order ≤ resolves through the CompleteLattice instance whose construction uses
Classical.choice,
so the Monotone-based statement would not be choice-free. The two are
definitionally equal.
Equations
- One or more equations did not get rendered due to their size.