Other Agda modules in this section (24)

Complete compiler-highlighted source. Follow a symbol to its declaration.

Corresponding book passages
# The action of a functor on mapping animae

This is `cons:Post_Composition_On_Mapping_Spaces`. We curry internal
composition to obtain the map sending a functor to its action on mapping
animae. The comparisons below identify its specialization with ordinary
postcomposition and construct the naturality square used in the definition
of a subcategory.

```agda
{-# OPTIONS --safe --without-K #-}
open import Agda.Primitive using (Level)
open import SCT.VolumeI.Chapter01.Theory using (Theory)
import SCT.VolumeI.Chapter01.Section04.MappingAnimae as Mapping

module SCT.VolumeI.Chapter03.Section01.MappingCalculus.MappingAction
  {c m a : Level} (𝒯 : Theory c m a) (M : Mapping.MappingAnimae 𝒯) where

open import SCT.VolumeI.Chapter01.Section04.Setup 𝒯
open Mapping.MappingAnimae M
open import SCT.VolumeI.Chapter01.Section04.Currying 𝒯 M
open import SCT.VolumeI.Chapter01.Section04.Composition 𝒯 M
open import SCT.VolumeI.Chapter01.Section04.Functoriality 𝒯 M
open import SCT.VolumeI.Chapter01.Section04.Points 𝒯 M
  using (nameMap; decodeMap; oneProduct-in; nameMapIso; name-decode)
open import SCT.VolumeI.Chapter01.Section04.CompositionCalculus.InternalCoherence 𝒯 M
  using (evaluate-compose)
open import SCT.VolumeI.Chapter01.Section04.Core 𝒯 M
  using (coreInclusion; core-evaluation)

mappingAction : (E C D : CAT) β†’ MAP (Map C D) (Map (Map E C) (Map E D))
mappingAction E C D = mapCurry (map-isAn C D) mapComp

mappingAction-Ξ² : (E C D : CAT) β†’
  mapUncurry (mappingAction E C D) =₁ mapComp
mappingAction-Ξ² E C D = mapCurry-Ξ² (map-isAn C D) mapComp

apply-mapPost : {Ξ“ E C D : CAT} (f : MAP C D)
  (g : MAP Ξ“ (Map E C)) (x : MAP Ξ“ E) β†’
  applyTerm (mapPost f ∘ g) x =₁ (f ∘ applyTerm g x)
apply-mapPost f g x = comp-assoc (pair g x) mapEval f βˆ™
  ((mapPost-Ξ² f β–· pair g x) βˆ™ (mapUncurry-at (mapPost f) g x) ⁻¹)

apply-nameMap : {Ξ“ C D : CAT} (f : MAP C D) (x : MAP Ξ“ C) β†’
  applyTerm (const (nameMap f)) x =₁ (f ∘ x)
apply-nameMap {Ξ“} f x = (f ◁ pair-Ξ²β‚‚ (terminate Ξ“) x) βˆ™
  (comp-assoc (pair (terminate Ξ“) x) prβ‚‚ f βˆ™
    ((mapCurry-Ξ² one-isAn (f ∘ prβ‚‚) β–· pair (terminate Ξ“) x) βˆ™
      (mapUncurry-at (nameMap f) (terminate Ξ“) x) ⁻¹))

mapPost-compose : {Ξ“ E C D F : CAT} (f : MAP D F)
  (g : MAP Ξ“ (Map C D)) (h : MAP Ξ“ (Map E C)) β†’ isAn Ξ“ β†’
  (mapPost f ∘ composeTerm g h) =₁ composeTerm (mapPost f ∘ g) h
mapPost-compose f g h Ξ“-an = mapReflect Ξ“-an _ _ (right ⁻¹ βˆ™ left)
  where
  left = (f ◁ evaluate-compose g h) βˆ™ mapPost-uncurry f (composeTerm g h)
  right = apply-mapPost f (g ∘ pr₁) (applyTerm (h ∘ pr₁) prβ‚‚) βˆ™
    (applyTerm-cong (comp-assoc pr₁ g (mapPost f)) (idIso (applyTerm (h ∘ pr₁) prβ‚‚)) βˆ™
      evaluate-compose (mapPost f ∘ g) h)

mapComp-projections : {E C D : CAT} β†’
  composeTerm (pr₁ {Map C D} {Map E C}) prβ‚‚ =₁ mapComp
mapComp-projections = comp-unitΚ³ mapComp βˆ™ (mapComp ◁ pair-projections)

mapComp-post : {E C D F : CAT} (f : MAP D F) β†’
  (mapPost f ∘ mapComp {E} {C} {D}) =₁
    (mapComp ∘ productMap (mapPost f) (id (Map E C)))
mapComp-post {E} {C} {D} f =
  (mapComp ◁ pair-cong (idIso (mapPost f ∘ pr₁)) (comp-unitΛ‘ prβ‚‚)) ⁻¹ βˆ™
    (mapPost-compose f pr₁ prβ‚‚ (product-isAn (map-isAn C D) (map-isAn E C)) βˆ™
      (mapPost f ◁ mapComp-projections ⁻¹))

mappingAction-natural : {A C : CAT} (E D : CAT) (f : MAP A C) β†’
  (mapPost (mapPost {C = E} f) ∘ mappingAction E D A) =₁
    (mappingAction E D C ∘ mapPost f)
mappingAction-natural {A} {C} E D f = mapReflect (map-isAn D A) _ _
  (right ⁻¹ βˆ™ (mapComp-post f βˆ™ left))
  where
  left = (mapPost f ◁ mappingAction-Ξ² E D A) βˆ™
    mapPost-uncurry (mapPost f) (mappingAction E D A)
  right = (mappingAction-Ξ² E D C β–· productMap (mapPost f) (id (Map E D))) βˆ™
    mapUncurry-restrict (mappingAction E D C) (mapPost f)

compose-nameMap : {Ξ“ E C D : CAT} (f : MAP C D)
  (g : MAP Ξ“ (Map E C)) β†’ isAn Ξ“ β†’
  composeTerm (const (nameMap f)) g =₁ (mapPost f ∘ g)
compose-nameMap f g Ξ“-an = mapReflect Ξ“-an _ _ (right ⁻¹ βˆ™ left)
  where
  left = apply-nameMap f (applyTerm (g ∘ pr₁) prβ‚‚) βˆ™
    (applyTerm-cong (const-pre (nameMap f) pr₁) (idIso (applyTerm (g ∘ pr₁) prβ‚‚)) βˆ™
      evaluate-compose (const (nameMap f)) g)
  right = (f ◁ mapUncurry-as-apply g) βˆ™ mapPost-uncurry f g

mappingAction-at : {Ξ“ E C D : CAT}
  (g : MAP Ξ“ (Map C D)) (h : MAP Ξ“ (Map E C)) β†’
  applyTerm (mappingAction E C D ∘ g) h =₁ composeTerm g h
mappingAction-at {E = E} {C} {D} g h =
  (mappingAction-Ξ² E C D β–· pair g h) βˆ™
    (mapUncurry-at (mappingAction E C D) g h) ⁻¹

mappingAction-specialize : {C D : CAT} (E : CAT) (f : MAP C D) β†’
  decodeMap (mappingAction E C D ∘ nameMap f) =₁ mapPost {C = E} f
mappingAction-specialize {C} {D} E f = comp-unitΚ³ (mapPost f) βˆ™
  (compose-nameMap f (id (Map E C)) (map-isAn E C) βˆ™
    (mappingAction-at (const (nameMap f)) (id (Map E C)) βˆ™
      (applyTerm-cong (comp-assoc (terminate (Map E C)) (nameMap f) (mappingAction E C D))
        (idIso (id (Map E C))) βˆ™
        mapUncurry-at (mappingAction E C D ∘ nameMap f)
          (terminate (Map E C)) (id (Map E C)))))

mappingAction-name : {C D : CAT} (E : CAT) (f : MAP C D) β†’
  (mappingAction E C D ∘ nameMap f) =₁ nameMap (mapPost {C = E} f)
mappingAction-name {C} {D} E f = nameMapIso (mappingAction-specialize E f) βˆ™
  (name-decode (mappingAction E C D ∘ nameMap f)) ⁻¹

apply-mapPre : {Ξ“ B C D : CAT} (f : MAP B C)
  (g : MAP Ξ“ (Map C D)) (x : MAP Ξ“ B) β†’
  applyTerm (mapPre f ∘ g) x =₁ applyTerm g (f ∘ x)
apply-mapPre f g x =
  (mapEval ◁ (pair-cong (comp-unitΛ‘ g) (idIso (f ∘ x)) βˆ™
    productMap-pair (id _) f g x)) βˆ™
  (comp-assoc (pair g x) (productMap (id _) f) mapEval βˆ™
    ((mapPre-Ξ² f β–· pair g x) βˆ™ (mapUncurry-at (mapPre f) g x) ⁻¹))

compose-named-right : {Ξ“ B C D : CAT} (f : MAP B C)
  (g : MAP Ξ“ (Map C D)) β†’ isAn Ξ“ β†’
  composeTerm g (const (nameMap f)) =₁ (mapPre f ∘ g)
compose-named-right f g Ξ“-an = mapReflect Ξ“-an _ _ (right ⁻¹ βˆ™ left)
  where
  inner = apply-nameMap f prβ‚‚ βˆ™
    applyTerm-cong (const-pre (nameMap f) pr₁) (idIso prβ‚‚)
  left = applyTerm-cong (idIso (g ∘ pr₁)) inner βˆ™
    evaluate-compose g (const (nameMap f))
  right = apply-mapPre f (g ∘ pr₁) prβ‚‚ βˆ™
    (applyTerm-cong (comp-assoc pr₁ g (mapPre f)) (idIso prβ‚‚) βˆ™
      mapUncurry-as-apply (mapPre f ∘ g))

evaluate-mapPre : {Ξ“ C D : CAT} (x : Obj-abs C) (f : MAP Ξ“ (Map C D)) β†’
  (coreInclusion D ∘ (mapPre x ∘ f)) =₁ applyTerm f (const x)
evaluate-mapPre {Ξ“} x f = applyTerm-cong (comp-unitΚ³ f) (idIso (const x)) βˆ™
  (apply-mapPre x (f ∘ id Ξ“) (terminate Ξ“) βˆ™
    (applyTerm-cong (comp-assoc (id Ξ“) f (mapPre x)) (idIso (terminate Ξ“)) βˆ™
      (mapUncurry-at (mapPre x ∘ f) (id Ξ“) (terminate Ξ“) βˆ™
        (core-evaluation (mapPre x ∘ f)) ⁻¹)))

mappingAction-restrict-point : {Ξ“ B C D : CAT} (f : MAP B C)
  (g : MAP Ξ“ (Map C D)) β†’ isAn Ξ“ β†’
  (coreInclusion (Map B D) ∘ (mapPre (nameMap f) ∘ (mappingAction B C D ∘ g))) =₁
    (mapPre f ∘ g)
mappingAction-restrict-point f g Ξ“-an = compose-named-right f g Ξ“-an βˆ™
  (mappingAction-at g (const (nameMap f)) βˆ™
    evaluate-mapPre (nameMap f) (mappingAction _ _ _ ∘ g))
```