Exercise 1.23 (Scott 1981, PRG-19, §1) ā the greedy total element of a countable #
system
Scott: suppose š = {Xā, Xā, ā¦} is countable and the consistency of finite
sequences of
neighbourhoods is decidable. Then the greedy sequence
Yā = Xā
Y_{n+1} = X_{n+1} if X_{n+1} is consistent with Yā, ā¦, Yā;
= Yā otherwise.
is well defined, and {Yā, Yā, ā¦} is a total element of |š|. (Hint: first
show that
Yā, ā¦, Y_{n-1} is consistent for every n.)
This file formalizes the greedy construction over an enumeration enum : ā ā Set α of š,
encoding "consistency of the prefix + candidate is decidable" as [DecidablePred V.mem] (by
Theorem 1.1c, a prefix is consistent iff its running intersection is a
neighbourhood). We carry
the state (Yā, ā_{iā¤n} Yįµ¢); the running intersection acc n is exactly
interUpTo Y (n+1)
and is always a neighbourhood, which is the hint Y_prefix_consistent.
greedyElementā the filter{X ā š ⣠ā_{i<n} Yįµ¢ ā X for some n}generated byāØYāā©;greedyElement_isTotalā under surjectivity ofenum,greedyElementis maximal: anyWin a larger filterzis someenum k; if greedy skipped it thenWwas inconsistent with the prefix, contradictingz's closure under intersection.
The construction is [propext, Quot.sound] given the supplied DecidablePred.
Greedy state: state n = (Yā, ā_{iā¤n} Yįµ¢). The running intersection in the
second
component lets the consistency test V.mem (acc ā© enum (n+1)) be self-contained
(Theorem 1.1c:
the prefix Yā,ā¦,Yā,enum (n+1) is consistent iff this intersection is a
neighbourhood).
Equations
Instances For
The greedy sequence Yā = (state n).1.
Equations
- Domain.Neighborhood.Exercise123.Y V enum n = (Domain.Neighborhood.Exercise123.state V enum n).1
Instances For
The running intersection acc n = ā_{iā¤n} Yįµ¢ = (state n).2.
Equations
- Domain.Neighborhood.Exercise123.acc V enum n = (Domain.Neighborhood.Exercise123.state V enum n).2
Instances For
The consistency test at stage n+1: is enum (n+1) consistent with the
prefix Yā,ā¦,Yā?
An abbrev so the [DecidablePred V.mem] instance is found through it.
Equations
- Domain.Neighborhood.Exercise123.cond V enum n = V.mem (Domain.Neighborhood.Exercise123.acc V enum n ā© enum (n + 1))
Instances For
The defining equation of state at a successor, written with the named
cond/acc.
acc n = ā_{i<n+1} Yįµ¢: the carried intersection is exactly the prefix
intersection.
Each Yā is a neighbourhood.
The running intersection acc n is always a neighbourhood ā the greedy choice
guarantees it.
This is the content of Scott's hint (consistency of the prefix).
ā_{i<n} Yįµ¢ is always a neighbourhood.
Exercise 1.23 ā the hint. For every n, the prefix Yā, ā¦, Y_{n-1} is
consistent in
š: its finite intersection is a neighbourhood, so it is its own common lower
bound.
Exercise 1.23 ā the greedy element. The filter generated by all Yā:
{X ā š ⣠ā_{i<n} Yįµ¢ ā X for some n}. The prefix intersections ā_{i<n} Yįµ¢ are a
descending
chain of neighbourhoods, so this is a genuine filter.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Every Yā belongs to the greedy element.
The running intersection acc n belongs to the greedy element.
Exercise 1.23 ā {Yā} is a total element. Maximality: if z extends the
greedy element
and W ā z, write W = enum k (surjectivity). For k = 0, W = Yā is already
in the greedy
element. For k = m+1: either the greedy step accepted enum k (then W = Y_k
is in the
element), or it rejected it ā but then acc m ā© enum k ā š, contradicting that
both acc m
(in the greedy element, hence in z) and W lie in the filter z.
Exercise 1.23 ā "all filters can be determined by sequences". In a
countable system, every
filter x is the limit family of a sequence of neighbourhoods: take sā = enum n whenever
enum n ā x and sā = Ī otherwise. Every member of x is some enum k
(surjectivity), so it is
caught by s; conversely each sā ā x, so anything above some sā is in x.
(Classical: it
selects the sequence by deciding membership in x.)