Documentation

LeanPool.DomainTheory.Neighborhood.Exercise511

Exercise 5.11 (Scott 1981, PRG-19, §5) — D^∞ as stacks; stack combinators #

Regarding D^∞ = iterSys D (Exercise 3.16) as (bottomless) stacks of elements of D, Scott asks for combinators with the obvious meanings

head : D^∞ → D,      tail : D^∞ → D^∞,      push : D × D^∞ → D^∞,

then for diag : D → D^∞ with diag(x) = ⟨x⟩ₙ (every component equal to x), defined by the recursion diag(x) = push(x, diag(x)), and finally a combinator

map : (D → D)^∞ × D → D^∞,      map(⟨fₙ⟩, x) = ⟨fₙ(x)⟩ₙ.

We build head, tail, push from the order-isomorphism iterProdIso : D^∞ ≅ D × D^∞ of Exercise 3.16 (so unfold = ofIso iterProdIso, fold = ofIso iterProdIso.symm), and obtain the stack laws

together with the component readings head z = z₀ and (tail z)ₙ = zₙ₊₁.

diag and map are defined as least fixed points (Theorem 4.1/4.2); for diag we prove Scott's emphasised property that all components equal x (component_diag), and for map that the n-th component is fₙ(x) (component_map).

The only classical input is what is inherited from iterProdIso / fixMap and the project's Element.ext machinery.

unfold/fold from the isomorphism D^∞ ≅ D × D^∞. #

theorem Domain.Neighborhood.Exercise511.iterProdIso_apply {α : Type u_1} (V : NeighborhoodSystem α) (z : (iterSys V).Element) :
(iterProdIso V) z = pair (component z 0) (ofSeq fun (n : ) => component z (n + 1))

iterProdIso reads a stack as its head together with the tail sequence.

The stack combinators. #

push : D × D^∞ → D^∞, prepend an element to a stack.

Equations
Instances For
    @[simp]
    theorem Domain.Neighborhood.Exercise511.tail_apply {α : Type u_1} (V : NeighborhoodSystem α) (z : (iterSys V).Element) :
    (tail V).toElementMap z = ofSeq fun (n : ) => component z (n + 1)

    (tail z)ₙ = zₙ₊₁.

    Stack law. head(push(x, s)) = x.

    Stack law. tail(push(x, s)) = s.

    Stack law. push(head z, tail z) = z (a stack is its top pushed onto its tail).

    diag : D → D^∞, the constant stack ⟨x⟩ₙ, by recursion `diag(x) = #

    push(x, diag(x))`.

    Exercise 5.11 (Scott 1981, PRG-19). The recursion diag(x) = push(x, diag(x)).

    Exercise 5.11 (Scott 1981, PRG-19). Scott's emphasised property: all components of diag(x) equal x, i.e. diag(x) = ⟨x⟩ₙ.

    map : (D → D)^∞ × D → D^∞, map(⟨fₙ⟩, x) = ⟨fₙ(x)⟩ₙ, by recursion. #

    @[reducible, inline]

    The argument domain of map: a stack of functions paired with a point, (D → D)^∞ × D.

    Equations
    Instances For

      The body of the map recursion as a two-argument map M(W, ⟨s, x⟩) = push((head s)(x), W(tail s, x)), from which map = fix(curry M).

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

        The map recursion operator R(W) = λ⟨s, x⟩. push((head s)(x), W(tail s, x)).

        Equations
        Instances For

          Exercise 5.11 (Scott 1981, PRG-19). The recursion defining map: map(s, x) = push((head s)(x), map(tail s, x)).

          Exercise 5.11 (Scott 1981, PRG-19). The n-th component of map(s, x) is (component s n)(x), i.e. map(⟨fₙ⟩, x) = ⟨fₙ(x)⟩ₙ.