Documentation

LeanPool.DomainTheory.Neighborhood.Example62

Example 6.2 (Scott 1981, PRG-19, §6) — B and C as solutions of domain #

equations

Following Dana Scott, Lectures on a Mathematical Theory of Computation, PRG-19 (1981), Lecture VI, Introduction to domain equations. Scott observes that the staple examples B (binary sequences, Example 1.B) and C (finite-or-infinite binary sequences, Example 4.4) satisfy domain equations:

BB + B, C ≅ {{Λ}} + C + C,

where, "if we liked", both systems can be presented over {0,1}* as the least families

B = {Σ*} ∪ {0X ∣ X ∈ B} ∪ {1X ∣ X ∈ B}, C = {Σ*} ∪ {{Λ}} ∪ {0X ∣ X ∈ C} ∪ {1X ∣ X ∈ C}.

This module formalizes the BB + B half. (See Example62C.lean for C's three-way equation C ≅ 𝟙 + C + C.)

The point of the equation is that a neighbourhood of B is either the master Σ* (= cone []), a 0-prefixed copy 0X (= embBit false X), or a 1-prefixed copy 1X (= embBit true X) — exactly the three shapes that build the sum B + B (Exercise 3.18): the fresh basepoint, the left copy 0X, and the right copy 1Y. We exhibit the order-isomorphism bbEquiv : |B| ≃o |B + B| directly from the filter maps toBB (forward) / fromBB (inverse), mirroring Example61.dsharpEquiv.

All data is choice-free (#print axioms ⊆ {propext, Quot.sound}).

Prepending a single bit: bX = {bw' ∣ w' ∈ X}. #

bX = {b :: w' ∣ w' ∈ X}: the b-prefixed copy of a neighbourhood X (Scott's 0X for b = false and 1X for b = true).

Equations
Instances For

    bX = b·X is exactly the single-bit prepend of Example 1.B.

    b(σΣ*) = (bσ)Σ*: prepending a bit to a cone gives the cone of the longer prefix.

    Prepending a bit lands back in B.

    If bW ∈ B then W ∈ B: a b-prefixed neighbourhood that lands in B must be b·(cone w'), so W = cone w'.

    theorem Domain.Neighborhood.Example62.embBit_ne {b b' : Bool} (h : b b') {X Y : Set ExampleB.Str} (hX : X.Nonempty) :
    embBit b X embBit b' Y

    B is positive (no empty neighbourhood) and its neighbourhood-shape #

    classification.

    Scott's standing assumption ∅ ∉ B: every neighbourhood of B is nonempty (cones contain their generating prefix).

    Example 6.2 — the shape of a B-neighbourhood. Every neighbourhood of B is either the master Σ* = cone [], a 0-copy 0X with XB, or a 1-copy 1X with XB.

    The sum target B + B and its inversion lemmas. #

    @[reducible, inline]

    The right-hand side of Scott's domain equation: the sum system B + B (Exercise 3.18).

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

      The forward half toBB : |B| → |B + B|. #

      Example 6.2 — forward half of BB + B. An element x of B is sent to the sum element recording, for each branch, whether x reaches the 0-copy 0X (left summand) or the 1-copy 1Y (right summand).

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

        The inverse half fromBB : |B + B| → |B|. #

        Example 6.2 — inverse half of BB + B.

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

          The two halves are mutually inverse. #

          The domain equation BB + B. #

          Example 6.2 (Scott 1981, PRG-19) — the isomorphism |B| ≃o |B + B|.

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

            Example 6.2 (Scott 1981, PRG-19) — the domain equation BB + B. Scott's binary-sequence domain B is, as a domain, isomorphic to B + B: a sequence is bottom, or begins with 0, or begins with 1, the two non-bottom cases giving the two summands.