Documentation

LeanPool.DomainTheory.Neighborhood.Example62A

Example 6.2 (Scott 1981, PRG-19, §6) — the generalisation A ≅ Aⁿ + Aⁿ #

Following Dana Scott, Lectures on a Mathematical Theory of Computation, PRG-19 (1981), Lecture VI. After the staple equations BB + B and C ≅ {{Λ}} + C + C (see Example62.lean/Example62C.lean), Scott proposes "a simple, yet interesting generalization of B": for any n, the domain equation

A ≅ Aⁿ + Aⁿ,

where Aⁿ is the n-fold cartesian power. He solves it concretely over Σ* = {0,1}* as the least family

A = {Σ*} ∪ ⋃_{i∈{0,1}} { i ⋃_{j<n} 1ʲ0 X_j ∣ X_j ∈ A for all j < n },

so a neighbourhood (other than the master Σ*) is a tag bit i (Scott's +/−, here true/false) followed by n slots, slot j reached behind the self-delimiting prefix 1ʲ0. An element of A (other than ) is thus ±⟨a₀, …, a_{n-1}⟩: an n-tuple of elements of A, in one of two copies.

This module delivers:

For n = 1 this recovers BB + B (one slot per copy); the tree picture and the automata-theory aside (eventually-periodic trees ↔ regular events) are formalised in Example62Regular.lean.

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

The flat n-fold product Vⁿ over Fin n × β. #

def Domain.Neighborhood.Example62A.prodN {β : Type u_1} {n : } (X : Fin nSet β) :
Set (Fin n × β)

The proper product neighbourhood ⋃_{j<n} {j} × X_j: token (j, b) lies in it iff b ∈ X_j. This is the n-ary analogue of prodNbhd (Definition 3.1).

Equations
Instances For
    @[simp]
    theorem Domain.Neighborhood.Example62A.mem_prodN {β : Type u_1} {n : } {X : Fin nSet β} {p : Fin n × β} :
    p prodN X p.2 X p.1
    theorem Domain.Neighborhood.Example62A.prodN_subset {β : Type u_1} {n : } {X X' : Fin nSet β} :
    prodN X prodN X' ∀ (j : Fin n), X j X' j
    theorem Domain.Neighborhood.Example62A.prodN_inter {β : Type u_1} {n : } {X X' : Fin nSet β} :
    prodN X prodN X' = prodN fun (j : Fin n) => X j X' j
    theorem Domain.Neighborhood.Example62A.prodN_injective {β : Type u_1} {n : } {X X' : Fin nSet β} (h : prodN X = prodN X') (j : Fin n) :
    X j = X' j

    The n-fold product Vⁿ of a neighbourhood system V, over Fin n × β. Its neighbourhoods are exactly the proper products prodN X with each component X j ∈ V. Closure under intersection is componentwise (no tags to disambiguate, so no non-emptiness is needed here).

    Equations
    • One or more equations did not get rendered due to their size.
    Instances For
      @[simp]
      theorem Domain.Neighborhood.Example62A.npow_mem {β : Type u_1} {n : } {V : NeighborhoodSystem β} {W : Set (Fin n × β)} :
      (npow V n).mem W (X : Fin nSet β), (∀ (j : Fin n), V.mem (X j)) W = prodN X
      theorem Domain.Neighborhood.Example62A.npow_nonempty {β : Type u_1} {n : } {V : NeighborhoodSystem β} (hn : 0 < n) (hV : ∀ (X : Set β), V.mem XX.Nonempty) (W : Set (Fin n × β)) :
      (npow V n).mem WW.Nonempty

      Under Scott's standing assumption ∅ ∉ V, no neighbourhood of Vⁿ is empty (provided 0 < n, so there is a coordinate to witness).

      Scott's slot encoding i ⋃_{j<n} 1ʲ0 X_j over {0,1}*. #

      The slot prefix i 1ʲ 0: the leading tag bit i (Scott's +/−), then j ones, then a zero. Reaching component j of the tag-i tuple means matching this prefix.

      Equations
      Instances For

        Parsing the 1ʲ0 body: the position of the first false pins down j and the remainder.

        theorem Domain.Neighborhood.Example62A.slotPre_inj {i i' : Bool} {j j' : } {u v : ExampleB.Str} (h : slotPre i j ++ u = slotPre i' j' ++ v) :
        i = i' j = j' u = v

        Uniqueness of slot decomposition. A token i 1ʲ 0 u determines the tag i, the index j, and the remainder u. This is what makes the slots pairwise disjoint.

        Scott's tag-i tuple neighbourhood i ⋃_{j<n} 1ʲ0 X_j: the union of the n slots, slot j holding X j behind the prefix i 1ʲ 0. (For i = false/true these are Scott's left/right copies, the /+ summands.)

        Equations
        • One or more equations did not get rendered due to their size.
        Instances For
          @[simp]
          theorem Domain.Neighborhood.Example62A.embTuple_inter {n : } {i : Bool} (X X' : Fin nSet ExampleB.Str) :
          embTuple i X embTuple i X' = embTuple i fun (j : Fin n) => X j X' j
          theorem Domain.Neighborhood.Example62A.embTuple_inter_ne {n : } {i i' : Bool} (h : i i') (X X' : Fin nSet ExampleB.Str) :
          theorem Domain.Neighborhood.Example62A.embTuple_subset {n : } {i : Bool} {X X' : Fin nSet ExampleB.Str} :
          embTuple i X embTuple i X' ∀ (j : Fin n), X j X' j
          theorem Domain.Neighborhood.Example62A.embTuple_injective {n : } {i : Bool} {X X' : Fin nSet ExampleB.Str} (h : embTuple i X = embTuple i X') (j : Fin n) :
          X j = X' j
          theorem Domain.Neighborhood.Example62A.embTuple_ne {n : } {i i' : Bool} (h : i i') {X Y : Fin nSet ExampleB.Str} (j : Fin n) (hX : (X j).Nonempty) :

          The neighbourhood system A solving A ≅ Aⁿ + Aⁿ. #

          Scott's domain A as the least family of subsets of Σ* = {0,1}* containing (i) the master Σ* and (ii) every tag-i tuple i ⋃_{j<n} 1ʲ0 X_j built from components X j already in A:

          A = {Σ*} ∪ ⋃_{i∈{0,1}} { i ⋃_{j<n} 1ʲ0 X_j ∣ X_j ∈ A }.

          Instances For

            Under 0 < n every neighbourhood of A is non-empty (Scott's ∅ ∉ A).

            theorem Domain.Neighborhood.Example62A.tag_eq_of_subset {n : } (hn : 0 < n) {i i' : Bool} {Z V : Fin nSet ExampleB.Str} (hZ : ∀ (j : Fin n), MemA n (Z j)) (hsub : embTuple i Z embTuple i' V) :
            i = i'

            A non-empty witness contained in a tag-i' tuple must carry the tag i'.

            theorem Domain.Neighborhood.Example62A.memA_tuple_inv {n : } (hn : 0 < n) {i : Bool} {X : Fin nSet ExampleB.Str} (h : MemA n (embTuple i X)) (j : Fin n) :
            MemA n (X j)

            Inversion: the components of a tuple-shaped neighbourhood of A are themselves in A.

            theorem Domain.Neighborhood.Example62A.memA_inter {n : } (hn : 0 < n) {X : Set ExampleB.Str} :
            MemA n X∀ {Y : Set ExampleB.Str}, MemA n Y∀ {Z : Set ExampleB.Str}, MemA n ZZ X YMemA n (X Y)

            A is closed under consistent intersection. Scott's verification, by induction on the way X entered A: the cross case embTuple false · ∩ embTuple true · collapses to (killed by the non-empty witness), the same-tag case combines componentwise (recursing on the consistency witness's slots).

            Scott's domain A packaged as a neighbourhood system over {0,1}* (needs 0 < n).

            Equations
            Instances For
              @[simp]
              theorem Domain.Neighborhood.Example62A.Asys_mem {n : } {hn : 0 < n} {W : Set ExampleB.Str} :
              (Asys n hn).mem W MemA n W

              The domain equation A ≅ Aⁿ + Aⁿ. #

              theorem Domain.Neighborhood.Example62A.apowNe {n : } (hn : 0 < n) (W : Set (Fin n × ExampleB.Str)) :
              (Apow hn).mem WW.Nonempty
              @[reducible, inline]

              The right-hand side of Scott's equation: the separated sum Aⁿ + Aⁿ.

              Equations
              Instances For
                theorem Domain.Neighborhood.Example62A.apow_mem_prodN {n : } (hn : 0 < n) {X : Fin nSet ExampleB.Str} (hX : ∀ (j : Fin n), MemA n (X j)) :
                (Apow hn).mem (prodN X)
                theorem Domain.Neighborhood.Example62A.apow_mem_prodN_inv {n : } (hn : 0 < n) {X : Fin nSet ExampleB.Str} (h : (Apow hn).mem (prodN X)) (j : Fin n) :
                MemA n (X j)
                theorem Domain.Neighborhood.Example62A.aa_mem_inj₀ {n : } (hn : 0 < n) {X : Fin nSet ExampleB.Str} (hX : ∀ (j : Fin n), MemA n (X j)) :
                (AAsys hn).mem (inj₀ (prodN X))
                theorem Domain.Neighborhood.Example62A.aa_mem_inj₁ {n : } (hn : 0 < n) {Y : Fin nSet ExampleB.Str} (hY : ∀ (j : Fin n), MemA n (Y j)) :
                (AAsys hn).mem (inj₁ (prodN Y))
                theorem Domain.Neighborhood.Example62A.aa_mem_inj₀_inv {n : } (hn : 0 < n) {V : Set (Fin n × ExampleB.Str)} (h : (AAsys hn).mem (inj₀ V)) :
                (Apow hn).mem V
                theorem Domain.Neighborhood.Example62A.aa_mem_inj₁_inv {n : } (hn : 0 < n) {V : Set (Fin n × ExampleB.Str)} (h : (AAsys hn).mem (inj₁ V)) :
                (Apow hn).mem V
                def Domain.Neighborhood.Example62A.toAA {n : } (hn : 0 < n) (z : (Asys n hn).Element) :

                Forward half of A ≅ Aⁿ + Aⁿ. An element z of A is sent to the sum element recording, for each branch, whether z reaches the left copy 0X (left summand Aⁿ) or the right copy 1Y (right summand Aⁿ).

                Equations
                • One or more equations did not get rendered due to their size.
                Instances For
                  @[simp]
                  theorem Domain.Neighborhood.Example62A.toAA_mem_inj₀ {n : } (hn : 0 < n) {z : (Asys n hn).Element} {X : Fin nSet ExampleB.Str} (hX : ∀ (j : Fin n), MemA n (X j)) :
                  (toAA hn z).mem (inj₀ (prodN X)) z.mem (embTuple false X)
                  @[simp]
                  theorem Domain.Neighborhood.Example62A.toAA_mem_inj₁ {n : } (hn : 0 < n) {z : (Asys n hn).Element} {Y : Fin nSet ExampleB.Str} (hY : ∀ (j : Fin n), MemA n (Y j)) :
                  (toAA hn z).mem (inj₁ (prodN Y)) z.mem (embTuple true Y)
                  def Domain.Neighborhood.Example62A.fromAA {n : } (hn : 0 < n) (s : (AAsys hn).Element) :
                  (Asys n hn).Element

                  Inverse half of A ≅ Aⁿ + Aⁿ.

                  Equations
                  • One or more equations did not get rendered due to their size.
                  Instances For
                    @[simp]
                    theorem Domain.Neighborhood.Example62A.fromAA_mem_embF {n : } (hn : 0 < n) {s : (AAsys hn).Element} {X : Fin nSet ExampleB.Str} (hX : ∀ (j : Fin n), MemA n (X j)) :
                    (fromAA hn s).mem (embTuple false X) s.mem (inj₀ (prodN X))
                    @[simp]
                    theorem Domain.Neighborhood.Example62A.fromAA_mem_embT {n : } (hn : 0 < n) {s : (AAsys hn).Element} {Y : Fin nSet ExampleB.Str} (hY : ∀ (j : Fin n), MemA n (Y j)) :
                    (fromAA hn s).mem (embTuple true Y) s.mem (inj₁ (prodN Y))
                    theorem Domain.Neighborhood.Example62A.fromAA_toAA {n : } (hn : 0 < n) (z : (Asys n hn).Element) :
                    fromAA hn (toAA hn z) = z
                    theorem Domain.Neighborhood.Example62A.toAA_fromAA {n : } (hn : 0 < n) (s : (AAsys hn).Element) :
                    toAA hn (fromAA hn s) = s

                    The isomorphism |A| ≃o |Aⁿ + Aⁿ|.

                    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 A ≅ Aⁿ + Aⁿ. Scott's "simple, yet interesting generalization of B": the domain A over {0,1}* (whose non- elements are the two copies — left and right + — of an n-tuple of elements of A) is isomorphic to the separated sum Aⁿ + Aⁿ of two copies of its own n-fold cartesian power.