Exercise 3.22 (Scott 1981, PRG-19, ยง3) โ composition is approximable #
Scott asks for the approximable composition mapping
comp : (๐โ โ ๐โ) ร (๐โ โ ๐โ) โ (๐โ โ ๐โ), comp(g, f) = g โ f,
and suggests building it from eval and curry. We follow the hint: the
uncurried form
compApp : ((๐โ โ ๐โ) ร (๐โ โ ๐โ)) ร ๐โ โ ๐โ, compApp(โจโจg, fโฉ, xโฉ) = g(f(x)),
is assembled from the two evaluation maps and the projections/pairing of
Definition 3.3, and then
compMap = curry compApp is the desired map. Theorem 3.12's
toElementMap_curry_apply and 3.11's
evalMap_apply compute comp(g, f) = g โ f on elements
(toElementMap_compMap_apply).
Everything is choice-free (#print axioms โ {propext, Quot.sound}).
The uncurried composition map ((๐โโ๐โ) ร (๐โโ๐โ)) ร ๐โ โ ๐โ, โจโจg, fโฉ, xโฉ โฆ g(f(x)),
built from the inner evaluation (๐โโ๐โ) ร ๐โ โ ๐โ, the outer evaluation (๐โโ๐โ) ร ๐โ โ ๐โ,
and the product projections/pairing (Definition 3.3).
Equations
- One or more equations did not get rendered due to their size.
Instances For
compApp(โจโจg, fโฉ, xโฉ) = g(f(x)).
Exercise 3.22 (Scott 1981, PRG-19). The composition mapping
comp : (๐โ โ ๐โ) ร (๐โ โ ๐โ) โ (๐โ โ ๐โ), comp = curry(compApp).
Equations
- Domain.Neighborhood.compMap Vโ Vโ Vโ = Domain.Neighborhood.curry (Domain.Neighborhood.compApp Vโ Vโ Vโ)
Instances For
Exercise 3.22 (Scott 1981, PRG-19). comp(g, f) = g โ f: applying the
value
comp(โจg, fโฉ) โ |๐โ โ ๐โ| to x gives g(f(x)).
Exercise 3.22 (Scott 1981, PRG-19). The relational form comp(g, f) = g โ f: the value of
comp at โจg, fโฉ, read back as an approximable map, is the composition of the
approximable maps.