Documentation

LeanPool.DomainTheory.Neighborhood.ExampleB

Example 1.B (Scott 1981, PRG-19, §1) — binary sequences #

Scott's recurring binary example, generalizing the finite binary tree of Example 1.4 to infinite sequences. Take Δ = Σ* with Σ = {0,1} (the finite binary strings, Λ = the empty string), and for σ ∈ Σ* let σΣ* be the set of all extensions of σ. The neighbourhoods are

B = {σΣ* ∣ σ ∈ Σ*},

a neighbourhood being "all extensions of a fixed prefix σ". We encode Σ* = List Bool, the empty sequence Λ = [], concatenation στ = σ ++ τ, and the initial-segment relation σ prefix τ by mathlib's list-prefix order σ <+: τ. The cone σΣ* is cone σ = {w ∣ σ <+: w}.

Deliverables (all of the Example-1.B paragraph, lines 281–315 of the source):

Everything is constructive (#print axioms ⊆ {propext, Quot.sound}): list-prefix is decidable, so the trichotomy is choice-free.

@[reducible, inline]

The token type Σ* = List Bool (finite binary strings); Λ = [].

Equations
Instances For

    The neighbourhood σΣ*: all extensions of σ (sequences with σ as an initial segment).

    Equations
    Instances For
      @[simp]

      ΛΣ* = Σ*: the cone of the empty string is everything (Scott's Δ).

      Cones reverse the prefix order. σΣ* ⊆ τΣ* iff τ is an initial segment of σ: a longer prefix carves out a smaller cone. ( tests at σ ∈ σΣ*; is transitivity of <+:.)

      theorem Domain.Neighborhood.ExampleB.cone_injective {σ τ : Str} (h : cone σ = cone τ) :
      σ = τ

      Cones are one-one in the prefix. cone σ = cone τ ⟹ σ = τ: from the two inclusions we get τ <+: σ and σ <+: τ, and a prefix-antisymmetry (equal lengths) finishes. Used by the approximable maps BT / BB (Examples 2.3, 2.4) to read off the unique generating prefix of a cone.

      Prefix trichotomy for cones. Any two cones are nested-or-disjoint: either one contains the other, or they are disjoint (incomparable prefixes have no common extension). Choice-free: the prefix relation on List Bool is decidable.

      Membership in Scott's binary neighbourhood system B: XB iff X = σΣ* for some σ.

      Equations
      Instances For

        Exercise ("B is a neighbourhood system"). The family B = {σΣ* ∣ σ ∈ Σ*} is pairwise nested-or-disjoint, by cone_trichotomy.

        Example 1.B (Scott 1981, PRG-19). The binary neighbourhood system B on Δ = Σ*.

        Equations
        • One or more equations did not get rendered due to their size.
        Instances For

          Every cone is a neighbourhood of B.

          Prepending a prefix: σX = {στ ∣ τ ∈ X}. #

          Scott's σX = {στ ∣ τ ∈ X} (prepend the prefix σ to every member of X).

          Equations
          Instances For
            @[simp]
            theorem Domain.Neighborhood.ExampleB.mem_prepend {σ : Str} {X : Set Str} {w : Str} :
            w prepend σ X (τ : Str), τ X w = σ ++ τ

            σ(τΣ*) = (στ)Σ*. Prepending σ to a cone yields the cone of the concatenation — this is why σx lands back in B and why σ⊥ is again a finite element.

            σΣ* = σ·Σ*: prepending σ to the whole space recovers the cone of σ.

            theorem Domain.Neighborhood.ExampleB.memB_prepend (σ : Str) {X : Set Str} (hX : B.mem X) :
            B.mem (prepend σ X)

            Prepending preserves membership in B (σ applied to a cone is a cone).

            The finite elements σ⊥ and the initial-segment factoid. #

            σ⊥, a finite element of |B|. The principal filter ↑(σΣ*) of the cone of σ; its minimal neighbourhood is σΔ = σΣ* (Scott). These are exactly the finite elements of |B|.

            Equations
            Instances For
              theorem Domain.Neighborhood.ExampleB.sigmaBot_le_iff (σ₀ σ₁ : Str) :
              sigmaBot σ₀ sigmaBot σ₁ σ₀ <+: σ₁

              Factoid (Scott 1981, PRG-19). "σ₀⊥ ⊆ σ₁⊥ if and only if σ₀ is an initial segment of the sequence σ₁." The approximation order on finite elements is exactly the prefix order: σ₀⊥ ⊑ σ₁⊥ ↔ σ₀ <+: σ₁. (Via principal_le_iff — reversal — composed with cone_subset_cone — reversal again — which cancel to give the prefix order directly.)

              The operation σx (Scott's left-multiplication on elements). #

              Exercise (σx ∈ |B|). For x ∈ |B| and σ ∈ Σ*, Scott's σx = {Y ∣ σX ⊆ Y for some X ∈ x} is again an element of |B|.

              The filter laws: master uses X = Δx (σΔ ⊆ Δ trivially); inter takes X₁ ∩ X₂ ∈ x and the consistency witness σ(X₁∩X₂), which is a cone (hence in B, by memB_prepend) contained in both Y₁ and Y₂; up reuses the same X.

              Equations
              • One or more equations did not get rendered due to their size.
              Instances For

                σ⊥ really is σ applied to . sigmaElt σ ⊥ = sigmaBot σ, justifying the σ⊥ notation: applying σ to the least element produces the finite element ↑(σΣ*).

                Every element is a union of its finite approximations σ⊥. #

                Factoid (Scott 1981, PRG-19). "x = ⋃ₙ σₙ⊥": every x ∈ |B| is the union of the finite elements σ⊥ whose generating cone σΣ* lies in x. In membership form, a neighbourhood Z belongs to x iff Z lies in some σ⊥ = ↑(σΣ*) with σΣ* ∈ x.

                This is the concrete "an element is uniquely determined by its finite approximations" in |B| (Basic.eq_iUnion_principal specialized to B, where every neighbourhood is a cone). The further arrangement of the σ into a single increasing chain σ₀ prefix σ₁ prefix … requires choice/enumeration and is left to Scott's prose.