Documentation

LeanPool.DomainTheory.Neighborhood.Exercise123

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.

The construction is [propext, Quot.sound] given the supplied DecidablePred.

theorem Domain.Neighborhood.NeighborhoodSystem.interUpTo_antitone {α : Type u_1} (V : NeighborhoodSystem α) (X : ā„• → Set α) {j k : ā„•} (h : j ≤ k) :

The finite intersection is antitone in its length: a longer prefix is contained in a shorter one.

def Domain.Neighborhood.Exercise123.state {α : Type u_1} (V : NeighborhoodSystem α) (enum : ā„• → Set α) [DecidablePred V.mem] :
ā„• → Set α Ɨ Set α

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
    def Domain.Neighborhood.Exercise123.Y {α : Type u_1} (V : NeighborhoodSystem α) (enum : ā„• → Set α) [DecidablePred V.mem] (n : ā„•) :
    Set α

    The greedy sequence Yā‚™ = (state n).1.

    Equations
    Instances For
      def Domain.Neighborhood.Exercise123.acc {α : Type u_1} (V : NeighborhoodSystem α) (enum : ā„• → Set α) [DecidablePred V.mem] (n : ā„•) :
      Set α

      The running intersection acc n = ā‹‚_{i≤n} Yįµ¢ = (state n).2.

      Equations
      Instances For
        @[reducible, inline]
        abbrev Domain.Neighborhood.Exercise123.cond {α : Type u_1} (V : NeighborhoodSystem α) (enum : ā„• → Set α) [DecidablePred V.mem] (n : ā„•) :

        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
        Instances For
          @[simp]
          theorem Domain.Neighborhood.Exercise123.Y_zero {α : Type u_1} (V : NeighborhoodSystem α) (enum : ā„• → Set α) [DecidablePred V.mem] :
          Y V enum 0 = enum 0
          @[simp]
          theorem Domain.Neighborhood.Exercise123.acc_zero {α : Type u_1} (V : NeighborhoodSystem α) (enum : ā„• → Set α) [DecidablePred V.mem] :
          acc V enum 0 = V.master ∩ enum 0
          theorem Domain.Neighborhood.Exercise123.state_succ {α : Type u_1} (V : NeighborhoodSystem α) (enum : ā„• → Set α) [DecidablePred V.mem] (n : ā„•) :
          state V enum (n + 1) = if cond V enum n then (enum (n + 1), acc V enum n ∩ enum (n + 1)) else state V enum n

          The defining equation of state at a successor, written with the named cond/acc.

          theorem Domain.Neighborhood.Exercise123.Y_succ_pos {α : Type u_1} (V : NeighborhoodSystem α) (enum : ā„• → Set α) [DecidablePred V.mem] {n : ā„•} (h : cond V enum n) :
          Y V enum (n + 1) = enum (n + 1)
          theorem Domain.Neighborhood.Exercise123.Y_succ_neg {α : Type u_1} (V : NeighborhoodSystem α) (enum : ā„• → Set α) [DecidablePred V.mem] {n : ā„•} (h : ¬cond V enum n) :
          Y V enum (n + 1) = Y V enum n
          theorem Domain.Neighborhood.Exercise123.acc_succ_pos {α : Type u_1} (V : NeighborhoodSystem α) (enum : ā„• → Set α) [DecidablePred V.mem] {n : ā„•} (h : cond V enum n) :
          acc V enum (n + 1) = acc V enum n ∩ enum (n + 1)
          theorem Domain.Neighborhood.Exercise123.acc_succ_neg {α : Type u_1} (V : NeighborhoodSystem α) (enum : ā„• → Set α) [DecidablePred V.mem] {n : ā„•} (h : ¬cond V enum n) :
          acc V enum (n + 1) = acc V enum n
          theorem Domain.Neighborhood.Exercise123.acc_eq_interUpTo {α : Type u_1} (V : NeighborhoodSystem α) (enum : ā„• → Set α) [DecidablePred V.mem] (n : ā„•) :
          acc V enum n = V.interUpTo (Y V enum) (n + 1)

          acc n = ā‹‚_{i<n+1} Yįµ¢: the carried intersection is exactly the prefix intersection.

          theorem Domain.Neighborhood.Exercise123.Y_mem {α : Type u_1} (V : NeighborhoodSystem α) (enum : ā„• → Set α) [DecidablePred V.mem] (henum : āˆ€ (n : ā„•), V.mem (enum n)) (n : ā„•) :
          V.mem (Y V enum n)

          Each Yā‚™ is a neighbourhood.

          theorem Domain.Neighborhood.Exercise123.acc_mem {α : Type u_1} (V : NeighborhoodSystem α) (enum : ā„• → Set α) [DecidablePred V.mem] (henum : āˆ€ (n : ā„•), V.mem (enum n)) (n : ā„•) :
          V.mem (acc V enum n)

          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).

          theorem Domain.Neighborhood.Exercise123.mem_interUpTo_Y {α : Type u_1} (V : NeighborhoodSystem α) (enum : ā„• → Set α) [DecidablePred V.mem] (henum : āˆ€ (n : ā„•), V.mem (enum n)) (n : ā„•) :
          V.mem (V.interUpTo (Y V enum) n)

          ā‹‚_{i<n} Yįµ¢ is always a neighbourhood.

          theorem Domain.Neighborhood.Exercise123.Y_prefix_consistent {α : Type u_1} (V : NeighborhoodSystem α) (enum : ā„• → Set α) [DecidablePred V.mem] (henum : āˆ€ (n : ā„•), V.mem (enum n)) (n : ā„•) :
          V.Consistent (Y V enum) n

          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.

          def Domain.Neighborhood.Exercise123.greedyElement {α : Type u_1} (V : NeighborhoodSystem α) (enum : ā„• → Set α) [DecidablePred V.mem] (henum : āˆ€ (n : ā„•), V.mem (enum n)) :

          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
            theorem Domain.Neighborhood.Exercise123.greedyElement_mem_Y {α : Type u_1} (V : NeighborhoodSystem α) (enum : ā„• → Set α) [DecidablePred V.mem] (henum : āˆ€ (n : ā„•), V.mem (enum n)) (n : ā„•) :
            (greedyElement V enum henum).mem (Y V enum n)

            Every Yā‚™ belongs to the greedy element.

            theorem Domain.Neighborhood.Exercise123.greedyElement_mem_acc {α : Type u_1} (V : NeighborhoodSystem α) (enum : ā„• → Set α) [DecidablePred V.mem] (henum : āˆ€ (n : ā„•), V.mem (enum n)) (n : ā„•) :
            (greedyElement V enum henum).mem (acc V enum n)

            The running intersection acc n belongs to the greedy element.

            theorem Domain.Neighborhood.Exercise123.greedyElement_isTotal {α : Type u_1} (V : NeighborhoodSystem α) (enum : ā„• → Set α) [DecidablePred V.mem] (henum : āˆ€ (n : ā„•), V.mem (enum n)) (hsurj : āˆ€ {X : Set α}, V.mem X → ∃ (n : ā„•), enum n = X) :
            V.IsTotal (greedyElement V enum henum)

            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.

            theorem Domain.Neighborhood.Exercise123.filters_sequence_determined {α : Type u_1} (V : NeighborhoodSystem α) (enum : ā„• → Set α) (henum : āˆ€ (n : ā„•), V.mem (enum n)) (hsurj : āˆ€ {X : Set α}, V.mem X → ∃ (n : ā„•), enum n = X) (x : V.Element) :
            ∃ (s : ā„• → Set α), (āˆ€ (n : ā„•), V.mem (s n)) ∧ āˆ€ (Z : Set α), x.mem Z ↔ V.mem Z ∧ ∃ (n : ā„•), s n āŠ† 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.)