Exercise 3.26 (Scott 1981, PRG-19, §3) — the conditional operator cond #
Scott asks: for every domain D there is an approximable mapping
(the conditional operator) satisfying
Here T is the truth domain of Example 1.2 (Example12.neighborhoodSystem),
whose neighbourhoods
are {Δ, {0}, {1}} with true = ↑{0} (Example23.trueElt), false = ↑{1}
(falseElt) and
⊥ = {Δ} (botElt). The product T × D × D is the tagged product of Exercise
3.14, modelled here
as prod T (prod V V) over the token type T.Token ⊕ (α ⊕ α); a neighbourhood is
0C ∪ 10X ∪ 110Y, recovered from W by the projections C = inl⁻¹ W, X = inl⁻¹ inr⁻¹ W,
Y = inr⁻¹ inr⁻¹ W.
Scott's hint gives the relation directly:
0C ∪ 10X ∪ 110Y cond Z iff 0 ∈ C and X ⊆ Z, or
1 ∈ C and Y ⊆ Z, or
0, 1 ∈ C and Δ ⊆ Z.
Since T = {Δ, {0}, {1}}, the three guards on C are mutually exclusive and
exhaustive:
0 ∈ C (alone) means C = {0}, 1 ∈ C (alone) means C = {1}, and 0, 1 ∈ C
means C = Δ. We
therefore phrase the relation with explicit equalities C = {0} / {1} / Δ
(condGuard), which is
mathematically identical to Scott's membership form but makes the case analysis
transparent and the
three identities clean.
Everything is choice-free in spirit; the only classical input is inherited
from T (Example 1.2)
and from the project's ext_of_toElementMap/Element.ext machinery, as elsewhere
in §3.
A T-neighbourhood contained in {0} is {0} (the other two, Δ and {1},
are not).
A T-neighbourhood contained in {1} is {1}.
The conditional relation. #
Scott's guard for cond, phrased with explicit equalities on the truth
component
C = inl⁻¹ W. With X = inl⁻¹ inr⁻¹ W and Y = inr⁻¹ inr⁻¹ W:
Equations
- One or more equations did not get rendered due to their size.
Instances For
The three components C, X, Y of an input neighbourhood are themselves
neighbourhoods.
Exercise 3.26 (Scott 1981, PRG-19). The conditional operator cond : T × D × D → D.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Elementwise characterization, and the three defining identities. #
The elementwise action of cond, computed at a paired argument ⟨t, ⟨x, y⟩⟩:
a neighbourhood
Z lies in cond(t, x, y) iff t selects true ({0} ∈ t) and Z ∈ x, or t
selects false
({1} ∈ t) and Z ∈ y, or Z = Δ_D (the always-present master). The three
defining identities are
immediate corollaries.
Exercise 3.26(i) (Scott 1981, PRG-19). cond(true, x, y) = x.
Exercise 3.26(ii) (Scott 1981, PRG-19). cond(false, x, y) = y.
Exercise 3.26(iii) (Scott 1981, PRG-19). cond(⊥, x, y) = ⊥.