Documentation

LeanPool.DomainTheory.Neighborhood.Exercise419

Exercise 4.19 (Scott 1981, PRG-19, Lecture IV) — verifying Example 4.4 #

Example 4.4 leaves many assertions to the reader. This module discharges the two explicitly requested ones:

The liftC combinator (a map C → V determined by its values on the partial elements σ⊥ and the total elements σ, subject to two monotonicity conditions) is reusable; with it one likewise gets Scott's tail : C → C (tail(bx) = x, tail(Λ) = ⊥), here noted but not needed for one.

The liftC data is choice-free; the truth-domain tests inherit Classical.choice structurally from T (Example 1.2), exactly as Example23.parityMap and Example43.zeroMap do.

"Peano's Axioms" for {0,1}* = List Bool. #

Exercise 4.19 — Peano (i) for {0,1}*. Λ is not a successor: [] ≠ b :: σ.

theorem Domain.Neighborhood.Exercise419.peano_cons_injective {b : Bool} {σ τ : ExampleB.Str} (h : b :: σ = b :: τ) :
σ = τ

Exercise 4.19 — Peano (ii) for {0,1}*. Each successor b ::· is injective.

Exercise 4.19 — Peano (ii′) for {0,1}*. The two successor ranges are disjoint: 0σ ≠ 1τ.

theorem Domain.Neighborhood.Exercise419.peano_induction (P : ExampleB.StrProp) (hnil : P []) (hcons : ∀ (b : Bool) (σ : ExampleB.Str), P σP (b :: σ)) (σ : ExampleB.Str) :
P σ

Exercise 4.19 — Peano (iii) for {0,1}*. Induction: a predicate holding at Λ and closed under both successors holds everywhere. (This is List.rec; it is the two-successor analogue of Definition 4.5(iii) and the recursion engine behind tail/empty/zero/one.)

Disjointness facts for C's neighbourhoods (cones vs singletons). #

A cone is never contained in a singleton (it has at least two elements).

A cone is never equal to a singleton.

The head-test value functions. #

The codomain value chosen by inspecting the head of a sequence: [] ↦ z, 0σ ↦ a₀, 1σ ↦ a₁. With z = ⊥ this is the value at the partial element σ⊥; with z = vΛ the value at the total element σ.

Equations
Instances For
    @[simp]
    theorem Domain.Neighborhood.Exercise419.headValC_nil {β : Type u_1} (V : NeighborhoodSystem β) (z a0 a1 : V.Element) :
    headValC V z a0 a1 [] = z
    @[simp]
    theorem Domain.Neighborhood.Exercise419.headValC_false {β : Type u_1} (V : NeighborhoodSystem β) (z a0 a1 : V.Element) (σ : ExampleB.Str) :
    headValC V z a0 a1 (false :: σ) = a0
    @[simp]
    theorem Domain.Neighborhood.Exercise419.headValC_true {β : Type u_1} (V : NeighborhoodSystem β) (z a0 a1 : V.Element) (σ : ExampleB.Str) :
    headValC V z a0 a1 (true :: σ) = a1
    theorem Domain.Neighborhood.Exercise419.headValC_bot_le {β : Type u_1} (V : NeighborhoodSystem β) (z' a0 a1 : V.Element) {σ τ : ExampleB.Str} (h : σ <+: τ) :
    headValC V V.bot a0 a1 σ headValC V z' a0 a1 τ

    Monotonicity of the head value: along a prefix σ <+: τ, the partial value (z = ⊥) at σ is below any head value at τ with the same head constants. Covers both required conditions (cone→cone with z' = ⊥, cone→singleton with z' = vΛ).

    The combinator liftC: an approximable map out of C. #

    def Domain.Neighborhood.Exercise419.liftC {β : Type u_1} (V : NeighborhoodSystem β) (coneVal singVal : ExampleB.StrV.Element) (hcone : ∀ {σ τ : ExampleB.Str}, σ <+: τconeVal σ coneVal τ) (hsing : ∀ {σ τ : ExampleB.Str}, σ <+: τconeVal σ singVal τ) :

    A map C → V determined by its value coneVal σ on each partial element σ⊥ and singVal σ on each total element σ, provided (a) the partial values are monotone along prefixes and (b) a partial value sits below the total value of any extending prefix. The relation says: a cone σΣ* relates to the neighbourhoods of coneVal σ, and a singleton {σ} to those of singVal σ.

    Equations
    • One or more equations did not get rendered due to their size.
    Instances For
      theorem Domain.Neighborhood.Exercise419.liftC_strBot {β : Type u_1} (V : NeighborhoodSystem β) (coneVal singVal : ExampleB.StrV.Element) (hcone : ∀ {σ τ : ExampleB.Str}, σ <+: τconeVal σ coneVal τ) (hsing : ∀ {σ τ : ExampleB.Str}, σ <+: τconeVal σ singVal τ) (σ : ExampleB.Str) :
      (liftC V coneVal singVal ).toElementMap (Example44.strBot σ) = coneVal σ

      liftC on a partial element: f(σ⊥) = coneVal σ.

      theorem Domain.Neighborhood.Exercise419.liftC_strElem {β : Type u_1} (V : NeighborhoodSystem β) (coneVal singVal : ExampleB.StrV.Element) (hcone : ∀ {σ τ : ExampleB.Str}, σ <+: τconeVal σ coneVal τ) (hsing : ∀ {σ τ : ExampleB.Str}, σ <+: τconeVal σ singVal τ) (σ : ExampleB.Str) :
      (liftC V coneVal singVal ).toElementMap (Example44.strElem σ) = singVal σ

      liftC on a total element: f(σ) = singVal σ.

      The three tests empty, zero, one : C → T. #

      Example 4.4 — empty. empty(Λ) = true, empty(0x) = empty(1x) = false, strict.

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

        Example 4.4 — zero. zero(Λ) = false, zero(0x) = true, zero(1x) = false, strict.

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

          Example 4.4 — one. one(Λ) = false, one(0x) = false, one(1x) = true, strict.

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

            Value equations on total elements σ and partial elements σ⊥.

            one is defined from empty, zero and cond by a fixed-point #

            equation.

            cond(⊥, x, y) = ⊥ in T, phrased with T.bot (which the head-test empty(⊥) produces) rather than the syntactically distinct Example23.botElt of Exercise326.cond_bot.

            The defining right-hand side: cond(empty(x), false, cond(zero(x), false, true)). It uses only empty, zero and the conditional cond (Exercise 3.26) — not one.

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

              Exercise 4.19 (Scott 1981, PRG-19). one is definable from empty, zero, cond: the equation one(x) = cond(empty(x), false, cond(zero(x), false, true)) holds on every total element σ.

              Exercise 4.19 (Scott 1981, PRG-19). The same defining equation holds on every partial element σ⊥ — including ⊥ = []⊥ where empty(⊥) = ⊥ forces cond(⊥, …) = ⊥.