Exercise 5.10 (Scott 1981, PRG-19, §5) — the smash product and the strict #
function space
Suppose
𝒟₀and𝒟₁are neighbourhood systems over disjoint setsΔ₀andΔ₁. Define the smash product𝒟₀ ⊗ 𝒟₁with neighbourhoods{Δ₀ ∪ Δ₁} ∪ {X ∪ Y ∣ X ∈ 𝒟₀ ∖ {Δ₀} and Y ∈ 𝒟₁ ∖ {Δ₁}}. Show that this is a neighbourhood system. Define(𝒟₀ →⊥ 𝒟₁)so that|𝒟₀ →⊥ 𝒟₁|consists exactly of the strict functions. By introducing appropriate combinators, show that(𝒟₀ →⊥ (𝒟₁ →⊥ 𝒟₂))and((𝒟₀ ⊗ 𝒟₁) →⊥ 𝒟₂)are isomorphic.
We model the disjoint union of token sets by the sum type α ⊕ β, exactly as
for the ordinary
product (Domain/Neighborhood/Product.lean), reusing prodNbhd X Y = Sum.inl '' X ∪ Sum.inr '' Y
and its algebra (prodNbhd_inter, prodNbhd_subset_iff, prodNbhd_injective).
This file is organised as follows.
- The smash product
smash V₀ V₁(§ smash): a genuine neighbourhood system. The neighbourhoods are the masterΔ₀ ∪ Δ₁together with the proper product neighbourhoodsX ∪ Ywhose factors are both proper (X ≠ Δ₀,Y ≠ Δ₁). Closure under consistent intersection is the new content: the consistency witness rules out the degenerate cases, and a proper factor stays proper under intersection. - The smash collapses bottoms (
§ elements): the elementsmashPair x y(the strict pairing) and the order-isomorphism showing|𝒟₀ ⊗ 𝒟₁|is the smash of the pointed domains — every element is either⊥or a pair⟨x, y⟩of non-⊥elements. - The strict function space
strictFun V₀ V₁(§ strict): a neighbourhood system whose elements are exactly the strict approximable maps (IsStrict f, i.e.f(⊥) = ⊥). We realise it as the function space generated only by step neighbourhoods[X, Y]with proper inputX, and prove the representationstrictFunEquiv : |𝒟₀ →⊥ 𝒟₁| ≃o {f ∣ IsStrict f}. - The adjunction (
§ iso): the "appropriate combinators" Scott asks for — a strict currysmashCurryMapand strict uncurrysmashUncurryMap— assembled into the order-isomorphismsmashCurryEquiv : ((𝒟₀ ⊗ 𝒟₁) →⊥ 𝒟₂) ≃o (𝒟₀ →⊥ (𝒟₁ →⊥ 𝒟₂)). The decisive computation issection_uncurry_rel:g(⟨x, y⟩⊗) = curry⊥(g)(x)(y), with the boundary (a master factor) handled by strictness — exactly the bottom-gluing the smash performs.
The data (smash, strictFun, smashCurryMap, smashUncurryMap) and the
representation
strictFunEquiv are choice-free (#print axioms ⊆ {propext, Quot.sound});
Classical.choice
enters only the smashCurryEquiv proof, through the genuinely-classical X = Δ₀? / Y = Δ₁?
boundary case analysis.
The smash product 𝒟₀ ⊗ 𝒟₁. #
A proper product neighbourhood of the smash: X ∪ Y with X ∈ 𝒟₀ ∖ {Δ₀}
and
Y ∈ 𝒟₁ ∖ {Δ₁} (both factors strictly below their masters).
Equations
Instances For
A neighbourhood that is ⊆ Δ₀ and equals Δ₀ exactly when it contains Δ₀.
A proper factor
X ≠ Δ₀ stays proper after intersecting with anything: X ∩ X' ≠ Δ₀.
Exercise 5.10 (Scott 1981, PRG-19) — the smash product 𝒟₀ ⊗ 𝒟₁.
Neighbourhoods are the
master Δ₀ ∪ Δ₁ together with the proper product neighbourhoods X ∪ Y (both
factors proper).
This is a neighbourhood system. Condition (i) is the master clause. Condition
(ii) is the new
content: given two smash neighbourhoods with a consistency witness Z,
- if either is the master, the intersection collapses to the other (since
X ⊆ Δ₀,Y ⊆ Δ₁); - if both are proper,
Zcannot be the master (that would force a factor to beΔ₀/Δ₁), soZis a properU ∪ V;U ⊆ X ∩ X'andV ⊆ Y ∩ Y'then witnessX ∩ X' ∈ 𝒟₀,Y ∩ Y' ∈ 𝒟₁, both still proper (inter_ne_master_*).
Equations
- One or more equations did not get rendered due to their size.
Instances For
A proper product neighbourhood is a neighbourhood of the smash.
The smash collapses bottoms: the strict pairing ⟨x, y⟩⊗. #
The smash identifies all elements that have a ⊥ in either coordinate. We realise
this by the strict
pairing smashPair x y: when both x, y are non-⊥ it is the genuine pair ⟨x, y⟩, and when either
is ⊥ it collapses to ⊥ (smashPair_eq_bot_iff). Every element of |𝒟₀ ⊗ 𝒟₁|
arises this way.
The strict pairing ⟨x, y⟩⊗: the filter generated by the proper product
neighbourhoods
X ∪ Y with X ∈ x ∖ {Δ₀}, Y ∈ y ∖ {Δ₁} (plus the master). When either x or
y is ⊥ (i.e.
contains only its master), this collapses to ⊥.
Equations
- One or more equations did not get rendered due to their size.
Instances For
An element is ⊥ iff every neighbourhood it contains is the master: x ≠ ⊥
exactly when x
contains a proper neighbourhood.
The strict pairing is ⊥ iff one of the components is ⊥: the smash glues
(⊥, y) and
(x, ⊥)
to a single bottom.
The strict pairing is monotone in both arguments.
A ⊥ left factor collapses the strict pairing to ⊥ (choice-free).
A ⊥ right factor collapses the strict pairing to ⊥ (choice-free).
The strict function space (𝒟₀ →⊥ 𝒟₁). #
A map f : 𝒟₀ → 𝒟₁ is strict when f(⊥) = ⊥. In relational terms (since
f(⊥) is the filter
{Y ∣ Δ₀ f Y}), this says f relates the master input Δ₀ only to the master
output Δ₁:
Δ₀ f Y ⟹ Y = Δ₁.
We realise (𝒟₀ →⊥ 𝒟₁) as the function space whose tokens are the strict
approximable maps and
whose neighbourhoods are the non-empty finite intersections of step sets [X, Y] = {f ∣ X f Y}. The
crucial point — making |𝒟₀ →⊥ 𝒟₁| consist exactly of the strict functions — is
automatic: a step
[Δ₀, Y] with Y ≠ Δ₁ contains no strict map, so it is empty, hence never a
neighbourhood; thus no
filter can force a non-strict value at ⊥. The representation strictFunEquiv
then mirrors
Theorem 3.10.
A map is strict when f(⊥) = ⊥. Relationally: f sends the master
input only to the
master
output.
Equations
Instances For
Strictness is exactly f(⊥) = ⊥.
Strictness is downward closed: a map below a strict map is strict.
The constant map at ⊥ is strict.
The identity is strict.
The strict maps 𝒟₀ →⊥ 𝒟₁, as a subtype carrying the inherited approximation
order.
Equations
Instances For
A step set among strict maps: [X, Y] = {f strict ∣ X f Y}.
Equations
- Domain.Neighborhood.Exercise510.sstep X Y = {f : Domain.Neighborhood.Exercise510.StrictMap V₀ V₁ | (↑f).rel X Y}
Instances For
A finite intersection of strict step sets.
Equations
- Domain.Neighborhood.Exercise510.sstepFun L = {f : Domain.Neighborhood.Exercise510.StrictMap V₀ V₁ | ∀ p ∈ L, (↑f).rel p.1 p.2}
Instances For
[Δ₀, Δ₁] = |𝒟₀ →⊥ 𝒟₁|: every (strict) map relates the masters.
Exercise 5.10 — the strict function space (𝒟₀ →⊥ 𝒟₁). Tokens are the
strict approximable
maps; neighbourhoods are non-empty finite intersections of step sets.
Equations
- One or more equations did not get rendered due to their size.
Instances For
A step set is a neighbourhood as soon as it has a (strict) witness.
Intersection of two neighbourhoods, when non-empty, is again one.
The generation lemma: a filter contains sstepFun L iff it contains each step
[Xᵢ, Yᵢ].
The strict map represented by a filter. X (toStrictMap φ) Y ↔ [X, Y] ∈ φ. It is strict
because the step [Δ₀, Y] with Y ≠ Δ₁ is empty (no strict map relates Δ₀ to a
proper output),
hence not a neighbourhood, so it cannot belong to φ.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The filter f̂ = {F ∣ f ∈ F} of a strict map.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Exercise 5.10 — the strict function space is complete. |𝒟₀ →⊥ 𝒟₁| is
order-isomorphic to
the strict approximable maps 𝒟₀ → 𝒟₁.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The adjunction (𝒟₀ →⊥ (𝒟₁ →⊥ 𝒟₂)) ≅ ((𝒟₀ ⊗ 𝒟₁) →⊥ 𝒟₂). #
The smash product is left adjoint to the strict function space: strict maps out
of a smash product
are the same as strict maps into a strict function space. We realise the iso with
the "appropriate
combinators" Scott asks for — a strict curry and strict uncurry — connected by
the computation
g(⟨x, y⟩⊗) = (curry g)(x)(y).
The decisive computation is smashPair_principal_apply: for proper X, Y,
applying g to the
strict pairing of the principal elements is the same as g relating the proper
neighbourhood
X ∪ Y. At the bottom (a master factor) the strict pairing collapses to ⊥,
where strictness forces
the master output — exactly the gluing the smash performs.
Every smash neighbourhood is a product neighbourhood A ∪ B (the master is
Δ₀ ∪ Δ₁).
The key computation. For proper X, Y, g(⟨↑X, ↑Y⟩⊗) contains Z iff
g relates the
proper neighbourhood X ∪ Y to Z. (Coarser members of the strict pairing are
absorbed by
monotonicity; the master member needs only that X ∪ Y ⊆ Δ₀ ∪ Δ₁.)
The X-section of g : 𝒟₀ ⊗ 𝒟₁ → 𝒟₂, as a map 𝒟₁ → 𝒟₂: y ↦ g(⟨↑X, y⟩⊗).
Built with
Exercise 2.8's ofMono from its values on principal inputs.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The section is monotone in the neighbourhood X (a smaller input gives a
larger section).
The section of a strict g is itself strict: g(⟨↑X, ⊥⟩⊗) = g(⊥) = ⊥.
The generation lemma for maps into the strict function space: X h (⋂ᵢ[Yᵢ,Zᵢ]) iff
X h [Yᵢ,Zᵢ] for all i.
Strict curry combinator. curry⊥ : ((𝒟₀ ⊗ 𝒟₁) →⊥ 𝒟₂) → (𝒟₀ →⊥ (𝒟₁ →⊥ 𝒟₂)), sending g
to x ↦ (y ↦ g(⟨x, y⟩⊗)).
Equations
- One or more equations did not get rendered due to their size.
Instances For
Strict uncurry combinator. uncurry⊥ : (𝒟₀ →⊥ (𝒟₁ →⊥ 𝒟₂)) → ((𝒟₀ ⊗ 𝒟₁) →⊥ 𝒟₂),
X ∪ Y (uncurry⊥ h) Z ↔ X h [Y, Z].
Equations
- One or more equations did not get rendered due to their size.
Instances For
The roundtrip identities and the adjunction isomorphism. #
A step with master codomain is everything: every strict map relates Y to
Δ₁.
The decisive computation for the adjunction. The X-section of uncurry⊥ h evaluated on a
neighbourhood Y is exactly the strict-function value X h [Y, Z]. At the
boundary (a master
factor) both sides collapse via strictness; off the boundary it is
smashPair_principal_apply.
Roundtrip (i): uncurry⊥ ∘ curry⊥ = id.
Roundtrip (ii): curry⊥ ∘ uncurry⊥ = id.
Exercise 5.10 (Scott 1981, PRG-19) — the adjunction. The strict currying
combinator is an
order isomorphism ((𝒟₀ ⊗ 𝒟₁) →⊥ 𝒟₂) ≃ (𝒟₀ →⊥ (𝒟₁ →⊥ 𝒟₂)): the smash product is
left adjoint to
the strict function space.
Equations
- One or more equations did not get rendered due to their size.