Exercise 6.21 (Scott 1981, PRG-19, §6) — the separated sum ⊕ and product ⊗ #
EXERCISE 6.21. Do the same as 6.19 and 6.20 when the functors are also allowed to be generated by the operations
D₀ ⊕ D₁ = {{Λ} ∪ 0Δ₀ ∪ 1Δ₁} ∪ {0X ∣ X ∈ D₀ ∖ {Δ₀}} ∪ {1Y ∣ Y ∈ D₁ ∖ {Δ₁}},D₀ ⊗ D₁ = {{Λ} ∪ 0Δ₀ ∪ 1Δ₁} ∪ {{Λ} ∪ 0X ∪ 1Y ∣ X ∈ D₀ ∖ {Δ₀} and Y ∈ D₁ ∖ {Δ₁}}. Generalize all of+,×,⊕,⊗to combinations of several terms, not just the binary sums and products.
This module extends Exercise 6.19 Part B (Exercise619PartB.lean) with the two
coalesced
operations. The difference from the separated sum +/product × of 6.19 is
that ⊕/⊗ delete
the improper tagged copies 0Δ₀ and 1Δ₁: in domain terms this identifies
the two bottoms
(⊕ is the coalesced sum, ⊗ the smash product), whereas +/× keep them
apart. Both share the
same master {Λ} ∪ 0Δ₀ ∪ 1Δ₁ as +/×.
Contents (this stage: objects) #
oplusTok/otimesTok— the two token-level systems overStr = {0,1}*, each∅-free.ScottSys.oplus/ScottSys.otimes— the same, repackaged as objects of Scott's category.
Everything is choice-free (#print axioms ⊆ {propext, Quot.sound}).
The coalesced sum D₀ ⊕ D₁ over {0,1}* #
D₀ ⊕ D₁ = {M} ∪ {0X ∣ X ∈ 𝒟₀, X ≠ Δ₀} ∪ {1Y ∣ Y ∈ 𝒟₁, Y ≠ Δ₁}, where M = {Λ} ∪ 0Δ₀ ∪ 1Δ₁ is
the shared sumTokMaster.
Exercise 6.21 — the coalesced sum system 𝒟₀ ⊕ 𝒟₁ over {0,1}*. As
sumTok, but the
improper copies 0Δ₀, 1Δ₁ are removed (X ≠ Δ₀, Y ≠ Δ₁), so the two bottoms
are identified.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The smash product D₀ ⊗ D₁ over {0,1}* #
D₀ ⊗ D₁ = {M} ∪ {{Λ} ∪ 0X ∪ 1Y ∣ X ∈ 𝒟₀, X ≠ Δ₀, Y ∈ 𝒟₁, Y ≠ Δ₁}, where again
M = {Λ} ∪ 0Δ₀ ∪ 1Δ₁ = prodTokNbhd Δ₀ Δ₁. The improper rectangles touching a top
coordinate (other
than the full top M) are removed.
Exercise 6.21 — the smash product system 𝒟₀ ⊗ 𝒟₁ over {0,1}*. As
prodTok, but proper
rectangles must avoid both top coordinates (X ≠ Δ₀, Y ≠ Δ₁); the full top M = prodTokNbhd Δ₀ Δ₁
is kept as the master.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Repackaged as objects of Scott's category #
Membership inversions #
Monotone on domains: ◁ is carried componentwise #
The functorial action of the coalesced sum on (strict) maps #
The relation has the same shape as sumMapTok but with two changes forced by
coalescence: proper
tagged copies require the components to be proper (X ≠ Δ₀, X' ≠ Δ₀'), and the
master/collapse
row (W ∈ 𝒟₀⊕𝒟₁ ∧ W' = M) sends every neighbourhood to the top M (which is
always valid, the
top being the least informative output, and is exactly what handles f₀(X) = Δ₀'
collapsing back to
the shared bottom).
f₀ ⊕ f₁, the action of the coalesced sum on maps.
Equations
- One or more equations did not get rendered due to their size.
Instances For
oplusMapTok is always strict.
(I ⊕ I) = I.
(g₀ ∘ f₀) ⊕ (g₁ ∘ f₁) = (g₀ ⊕ g₁) ∘ (f₀ ⊕ f₁) for strict g₀, g₁.
(Strictness of the
outer maps is exactly what prevents an intermediate top f₀(X) = Δ₀' from being
re-expanded — that
is the categorical reason ⊕ is a functor only on the strict-map category Scott
restricts to.)
oplusMapTok is monotone in both arguments.
The functorial action of the smash product on (strict) maps #
As prodMapTok, but proper rectangles require both components proper, and a
master/collapse row
absorbs a boundary hit f₀(X) = Δ₀' (or f₁(Y) = Δ₁') into the top M.
f₀ ⊗ f₁, the action of the smash product on maps.
Equations
- One or more equations did not get rendered due to their size.
Instances For
otimesMapTok is always strict.
(I ⊗ I) = I.
(g₀ ∘ f₀) ⊗ (g₁ ∘ f₁) = (g₀ ⊗ g₁) ∘ (f₀ ⊗ f₁) for strict g₀, g₁.
otimesMapTok is monotone in both arguments.
The extended functor-expression algebra GExpr #
Scott's "do the same as 6.19 and 6.20 when the functors are also allowed to be
generated by the
operations ⊕, ⊗": the closed family of constructs is enlarged from FExpr
(constants,
identity, +, ×) to also include the coalesced ⊕ and the smash ⊗. The
functor laws and the
on-maps/on-domains continuity properties are re-established by induction; the
⊕/⊗ composition
law carries the strictness hypothesis (Scott's category is the strict-map
category, and that is
exactly what makes ⊕/⊗ functorial).
The extended functor-expression algebra (constants, identity, +, ×,
⊕, ⊗).
- const : ScottSys → GExpr
The constant functor
T(X) = 𝒟. - var : GExpr
The identity functor
T(X) = X. - sum : GExpr → GExpr → GExpr
The separated sum
T₀(X) + T₁(X). - prod : GExpr → GExpr → GExpr
The separated product
T₀(X) × T₁(X). - oplus : GExpr → GExpr → GExpr
The coalesced sum
T₀(X) ⊕ T₁(X). - otimes : GExpr → GExpr → GExpr
The smash product
T₀(X) ⊗ T₁(X).
Instances For
The action of T on maps.
Equations
- (Domain.Neighborhood.Exercise619.GExpr.const D).map x✝ = Domain.Neighborhood.ApproximableMap.idMap D.sys
- Domain.Neighborhood.Exercise619.GExpr.var.map x✝ = x✝
- (a.sum b).map x✝ = Domain.Neighborhood.Exercise619.sumMapTok (a.map x✝) (b.map x✝)
- (a.prod b).map x✝ = Domain.Neighborhood.Exercise619.prodMapTok (a.map x✝) (b.map x✝)
- (a.oplus b).map x✝ = Domain.Neighborhood.Exercise619.oplusMapTok (a.map x✝) (b.map x✝)
- (a.otimes b).map x✝ = Domain.Neighborhood.Exercise619.otimesMapTok (a.map x✝) (b.map x✝)
Instances For
Every T preserves strictness.
Functor law 1 — T(I_X) = I_{T(X)}.
Functor law 2 — T(g ∘ f) = T(g) ∘ T(f) for strict g. Together with
map_id, these are
all functors of the strict-map category. The strictness of g is needed (and
only) for the
coalesced ⊕/⊗, whose composition law oplusMapTok_comp/otimesMapTok_comp
requires it.
Continuous on domains #
λD. T(D) is continuous on domains.
Continuous on maps #
Forward direction of continuity on maps for GExpr.
λf. T(f) is continuous on maps.
Exercise 6.20 for the extended algebra — λΓ. tok(T({Γ})) is continuous, #
so a fixed point exists
The masters of ⊕/⊗ coincide with those of +/× (all four equal {Λ} ∪ 0Δ₀ ∪ 1Δ₁), so the
token-level recursion gFun has the same tagged-union body in all four binary
cases. The 6.20
argument (continuity of λΓ. tok(T({Γ})) and existence of Γ = tok(T({Γ})),
whence
{Γ} ◁ T({Γ}) and Theorem 6.14 applies) goes through verbatim, reusing the
generic helpers
singletonSys, insertTag_mono, insertTag_continuous of Exercise 6.19 Part B.
The token-level master recursion for GExpr. All four binary operations
share the same body
(sumTokMaster = prodTokNbhd on masters).
Equations
- One or more equations did not get rendered due to their size.
- Domain.Neighborhood.Exercise619.gFun (Domain.Neighborhood.Exercise619.GExpr.const C) x✝ = C.sys.master
- Domain.Neighborhood.Exercise619.gFun Domain.Neighborhood.Exercise619.GExpr.var x✝ = x✝
Instances For
λΓ. tok(T({Γ})) is monotone.
λΓ. tok(T({Γ})) is continuous on {Γ ∣ Λ ∈ Γ}.
Λ ∈ tok(C) for every constant C occurring in T.
Equations
- (Domain.Neighborhood.Exercise619.GExpr.const C).RootedConst = ([] ∈ C.sys.master)
- Domain.Neighborhood.Exercise619.GExpr.var.RootedConst = True
- (a.sum b).RootedConst = (a.RootedConst ∧ b.RootedConst)
- (a.prod b).RootedConst = (a.RootedConst ∧ b.RootedConst)
- (a.oplus b).RootedConst = (a.RootedConst ∧ b.RootedConst)
- (a.otimes b).RootedConst = (a.RootedConst ∧ b.RootedConst)
Instances For
The Kleene iteration gFunⁿ({Λ}).
Equations
Instances For
The Kleene union is a fixed point of λΓ. tok(T({Γ})).
Exercise 6.21/6.20 (token level). For any GExpr T whose constants
contain Λ, there
is a
set Γ with Λ ∈ Γ and Γ = tok(T({Γ})).
Exercise 6.21/6.20 (object level): {Γ} ◁ T({Γ}), so Theorem 6.14 applies
for any construct
T built from constants, identity, +, ×, ⊕, ⊗.
Generalizing +, ×, ⊕, ⊗ to combinations of several terms #
Generalize all of
+,×,⊕,⊗to combinations of several terms, not just the binary sums and products.
Because GExpr is closed under the binary operations, every finite
combination of several terms
T₀ ⋆ T₁ ⋆ ⋯ ⋆ Tₙ (for any ⋆ ∈ {+, ×, ⊕, ⊗}, in any nesting) is itself a
GExpr — so the
results already proved (map_id, map_comp, map_mono, map_continuous,
obj_subsystem,
obj_continuous, and the 6.20 fixed point gExists_singleton_subsystem) apply to
all of them with
no further work. The naryOp fold below packages the common right-nested n-ary
constructs
⋆(a, [b, c, …]) = a ⋆ (b ⋆ (c ⋆ ⋯)) explicitly, and naryOp_rootedConst shows
the Λ ∈ tok
side-condition (needed for the 6.20 fixed point) is preserved, so every n-ary
construct also has a
solution Γ = tok(T({Γ})).
Right-nested n-ary fold of a binary construct-operation op over a
non-empty list a, l….
With op = .sum/.prod/.oplus/.otimes this is the n-ary +/×/⊕/⊗.
Equations
- Domain.Neighborhood.Exercise619.GExpr.naryOp op a [] = a
- Domain.Neighborhood.Exercise619.GExpr.naryOp op a (b :: l) = op a (Domain.Neighborhood.Exercise619.GExpr.naryOp op b l)
Instances For
n-ary separated sum T₀ + T₁ + ⋯ + Tₙ.
Equations
Instances For
n-ary separated product T₀ × T₁ × ⋯ × Tₙ.
Equations
Instances For
n-ary coalesced sum T₀ ⊕ T₁ ⊕ ⋯ ⊕ Tₙ.
Equations
Instances For
n-ary smash product T₀ ⊗ T₁ ⊗ ⋯ ⊗ Tₙ.
Equations
Instances For
The Λ ∈ tok side-condition is preserved by any n-ary fold whose binary
operation preserves it
(all four of +, ×, ⊕, ⊗ do, definitionally).
Every n-ary construct has a solution Γ = tok(T({Γ})) (so {Γ} ◁ T({Γ})
and 6.14 applies),
illustrated for the n-ary separated sum; identical for
naryProd/naryOplus/naryOtimes.