Documentation

LeanPool.DomainTheory.Neighborhood.Example43

Example 4.3 (Scott 1981, PRG-19, §4) — the natural-number domain N #

Scott's "THE domain of integers" (pages 57–61). The tokens are , and the neighbourhoods are

N = {{n} ∣ n ∈ ℕ} ∪ {ℕ}

— a flat domain: the singletons {n} are the finite total elements and the whole space is the least-informative neighbourhood Δ = ⊥. We build N by the nested-or-disjoint criterion (ofNestedOrDisjoint): any two neighbourhoods are nested (one is ) or disjoint (distinct singletons).

The (ideal) elements of |N| are exactly: the bottom ⊥ = {ℕ} ("undefined"), and for each n the total element n̂ = ↑{n} = {{n}, ℕ} (natElem n). Scott then equips N with the structure maps

making ⟨N, 0, succ, pred, zero⟩ "THE domain of integers". All three are strict approximable maps determined by their action on the finite total elements:

We capture the common shape — a map NV sending n̂ ↦ val n and ⊥ ↦ ⊥ — once and for all in the combinator constLiftN, whose computation rules constLiftN_natElem/constLiftN_bot give all of the displayed equations uniformly. The data (N, constLiftN, succMap, predMap) is choice-free (#print axioms ⊆ {propext, Quot.sound}); zeroMap inherits Classical.choice structurally from the truth domain T of Example 1.2 exactly as Example23.parityMap does.

The neighbourhood system N. #

Membership in Scott's natural-number system: a neighbourhood is the whole space or a singleton {n}.

Equations
Instances For

    is not a singleton (a witness n+1 ≠ n).

    {n} ≠ ℕ (the symmetric form).

    Singletons of naturals are one-one as sets.

    Any two neighbourhoods of N are nested or disjoint: contains every singleton, and two distinct singletons are disjoint.

    Example 4.3 (Scott 1981, PRG-19). The natural-number neighbourhood system N on Δ = ℕ.

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

      ⊥ ∈ N reads: a neighbourhood lies in iff it is the whole space .

      The total elements . #

      Scott's total element n̂ = ↑{n} = {{n}, ℕ}, the principal filter of the singleton {n}.

      Equations
      Instances For

        A neighbourhood belongs to iff it is (the master) or the singleton {n}.

        Scott's 0 ∈ |N|, the distinguished zero of the structured domain.

        Equations
        Instances For

          The strict lifting combinator n̂ ↦ val n, ⊥ ↦ ⊥. #

          The strict approximable map NV determined by a choice of value val n ∈ |V| for each n: it sends the total element to val n and the bottom to . The relation X f Y holds when either X = Δ_N forces the blunt output Y = Δ_V (the strict ⊥ ↦ ⊥ clause), or X = {n} and Y is a neighbourhood of val n.

          Definition 2.1 checks uniformly: (i) Δ_N f Δ_V; (ii) intersect outputs — distinct inputs are impossible (ℕ ≠ {n}, singletons are one-one), so both outputs come from the same val n and inter_mem of the filter val n applies; (iii) sharpening {n} ⊆ X keeps the input a singleton {n}, and up_mem of val n widens the output, while a blunt input Δ_N forces Δ_V.

          Equations
          • One or more equations did not get rendered due to their size.
          Instances For
            theorem Domain.Neighborhood.Example43.constLiftN_natElem {β : Type u_1} (V : NeighborhoodSystem β) (val : V.Element) (n : ) :
            (constLiftN V val).toElementMap (natElem n) = val n

            Computation on the total elements. f(n̂) = val n.

            Computation on bottom (strictness). f(⊥) = ⊥.

            The successor map succ : NN. #

            The predecessor map pred : NN. #

            pred(0̂) = ⊥: predecessor of zero is undefined.

            The test map zero : NT. #

            @[reducible, inline]

            The two-token truth domain T of Example 1.2 (= Example23.T).

            Equations
            Instances For

              pred undoes succ. #

              pred(succ(n̂)) = n̂: the predecessor undoes the successor on total elements. (A sample of the "recursion" reasoning Scott highlights; cf. the iterated-summation example.)