Documentation

LeanPool.DomainTheory.Neighborhood.Exercise322

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}).

def Domain.Neighborhood.compApp {ฮฑ : Type u_1} {ฮฒ : Type u_2} {ฮณ : Type u_3} (Vโ‚€ : NeighborhoodSystem ฮฑ) (Vโ‚ : NeighborhoodSystem ฮฒ) (Vโ‚‚ : NeighborhoodSystem ฮณ) :
ApproximableMap (prod (prod (funSpace Vโ‚ Vโ‚‚) (funSpace Vโ‚€ Vโ‚)) Vโ‚€) Vโ‚‚

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
    theorem Domain.Neighborhood.toElementMap_compApp {ฮฑ : Type u_1} {ฮฒ : Type u_2} {ฮณ : Type u_3} {Vโ‚€ : NeighborhoodSystem ฮฑ} {Vโ‚ : NeighborhoodSystem ฮฒ} {Vโ‚‚ : NeighborhoodSystem ฮณ} (Gฯ† : (funSpace Vโ‚ Vโ‚‚).Element) (Fฯ† : (funSpace Vโ‚€ Vโ‚).Element) (x : Vโ‚€.Element) :
    (compApp Vโ‚€ Vโ‚ Vโ‚‚).toElementMap (pair (pair Gฯ† Fฯ†) x) = (toApproxMap Gฯ†).toElementMap ((toApproxMap Fฯ†).toElementMap x)

    compApp(โŸจโŸจg, fโŸฉ, xโŸฉ) = g(f(x)).

    def Domain.Neighborhood.compMap {ฮฑ : Type u_1} {ฮฒ : Type u_2} {ฮณ : Type u_3} (Vโ‚€ : NeighborhoodSystem ฮฑ) (Vโ‚ : NeighborhoodSystem ฮฒ) (Vโ‚‚ : NeighborhoodSystem ฮณ) :
    ApproximableMap (prod (funSpace Vโ‚ Vโ‚‚) (funSpace Vโ‚€ Vโ‚)) (funSpace Vโ‚€ Vโ‚‚)

    Exercise 3.22 (Scott 1981, PRG-19). The composition mapping comp : (๐’Ÿโ‚ โ†’ ๐’Ÿโ‚‚) ร— (๐’Ÿโ‚€ โ†’ ๐’Ÿโ‚) โ†’ (๐’Ÿโ‚€ โ†’ ๐’Ÿโ‚‚), comp = curry(compApp).

    Equations
    Instances For
      theorem Domain.Neighborhood.toElementMap_compMap_apply {ฮฑ : Type u_1} {ฮฒ : Type u_2} {ฮณ : Type u_3} {Vโ‚€ : NeighborhoodSystem ฮฑ} {Vโ‚ : NeighborhoodSystem ฮฒ} {Vโ‚‚ : NeighborhoodSystem ฮณ} (Gฯ† : (funSpace Vโ‚ Vโ‚‚).Element) (Fฯ† : (funSpace Vโ‚€ Vโ‚).Element) (x : Vโ‚€.Element) :
      (toApproxMap ((compMap Vโ‚€ Vโ‚ Vโ‚‚).toElementMap (pair Gฯ† Fฯ†))).toElementMap x = (toApproxMap Gฯ†).toElementMap ((toApproxMap Fฯ†).toElementMap x)

      Exercise 3.22 (Scott 1981, PRG-19). comp(g, f) = g โˆ˜ f: applying the value comp(โŸจg, fโŸฉ) โˆˆ |๐’Ÿโ‚€ โ†’ ๐’Ÿโ‚‚| to x gives g(f(x)).

      theorem Domain.Neighborhood.toApproxMap_compMap {ฮฑ : Type u_1} {ฮฒ : Type u_2} {ฮณ : Type u_3} {Vโ‚€ : NeighborhoodSystem ฮฑ} {Vโ‚ : NeighborhoodSystem ฮฒ} {Vโ‚‚ : NeighborhoodSystem ฮณ} (Gฯ† : (funSpace Vโ‚ Vโ‚‚).Element) (Fฯ† : (funSpace Vโ‚€ Vโ‚).Element) :
      toApproxMap ((compMap Vโ‚€ Vโ‚ Vโ‚‚).toElementMap (pair Gฯ† Fฯ†)) = (toApproxMap Gฯ†).comp (toApproxMap Fฯ†)

      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.