Other Agda modules in this section (89)

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

# Composition of functor-category restrictions after evaluation

The restriction compositor is evaluated by pasting the two separation
squares. The parameter-change comparison supplies the inner edge, and
the mixed product composition law supplies the outer edge.

```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
import SCT.VolumeI.Chapter01.Section08.FunctorCategoryCalculus.FunPrecompositionCompositionBase as Base
import SCT.VolumeI.Chapter01.Section07.FunctorCategories as Categories
import SCT.VolumeI.Chapter01.Section06.PullbackLaws as Laws
import SCT.VolumeI.Chapter01.Section04.CompositionCalculus.RetainedCompositionParameterChange as Project
import SCT.VolumeI.Chapter01.Section08.FunctorCategoryCalculus.FunPrecompositionParameterChange as Parameter
import SCT.VolumeI.Chapter01.Section08.FunctorCategoryCalculus.FunPrecompositionCompositeImage as Image
import SCT.VolumeI.Chapter01.Section02.Isomorphisms as Isomorphisms
import SCT.VolumeI.Chapter01.Section03.ProductCalculus.PairingNaturality as PN
import SCT.VolumeI.Chapter01.Section03.IdentificationCalculus.Structural as Structural

module SCT.VolumeI.Chapter01.Section08.FunctorCategoryCalculus.FunPrecompositionComposition
  {c m a : Level} (𝒯 : Theory c m a) (M : Mapping.MappingAnimae 𝒯)
  (β„± : Categories.FunctorCategories 𝒯 M) (P : Laws.PullbackStructure 𝒯) where

open import SCT.VolumeI.Chapter01.Section07.Setup 𝒯 M β„±
open import SCT.VolumeI.Chapter01.Section08.FunctorCategoryCalculus.FunctorSquares 𝒯 M β„± P
open import SCT.VolumeI.Chapter01.Section08.MappingCalculus.Restriction.RestrictionMate 𝒯 using (cancel-trailing-pair; prefix-transfer; cancel-prefix; close-comparison)
open import SCT.VolumeI.Chapter01.Section08.ProductSquares 𝒯
open import SCT.VolumeI.Chapter01.Section08.ProductCalculus.ProductMixedSubstitution 𝒯 M using (separate-composition)
open import SCT.VolumeI.Chapter01.Section04.SquareCalculus.ParameterSquarePasting 𝒯 using (paste)
open import SCT.VolumeI.Chapter01.Section04.SquareCalculus.ProjectionSquares 𝒯 using (post-inverse)
open import SCT.VolumeI.Chapter01.Section06.ConeCalculus.InverseCalculus 𝒯 using (pre-inverse)
open Isomorphisms vocabulary terminal products productLaws composition vertical whiskering using (cancel-inverse)
open PN vocabulary terminal products productLaws composition vertical whiskering using (cancel-left; cancel-right; move-square)
open Structural vocabulary terminal products productLaws composition whiskering using (postWhisker-comp-at; whisker-mixed-at)

module CompositorEvaluation {X A B C E : CAT} (f : MAP A B) (g : MAP B C) (h : MAP X (Fun C E)) where
  open Base.CompositorEvaluation 𝒯 M β„± P f g h public

  Ο‡X = productRestriction-comp X f g
  Ο‡Y = productRestriction-comp Y f g
  Xgf = productRestriction X (g ∘ f)
  Ygf = productRestriction Y (g ∘ f)
  product-image = e ◁ Ο‡Y
  evaluation-associator = comp-assoc Yf Yg e
  evaluation-beta = Ξ² β–· Yf
  leading-prefix = product-image βˆ™ (evaluation-associator βˆ™ evaluation-beta)
  projected-prefix = (comp-assoc HA Ygf e) ⁻¹ βˆ™ (e ◁ (Ο‡Y β–· HA))

  abstract
    prefix-cancellation :
      (leading-prefix βˆ™ ((Ξ² ⁻¹ β–· Yf) βˆ™ evaluation-associator ⁻¹)) =β‚‚ product-image
    prefix-cancellation = cancel-trailing-pair product-image evaluation-associator evaluation-beta
      (Ξ² ⁻¹ β–· Yf) (pre-inverse Ξ² Yf)

    output-endpoint : projected-prefix =β‚‚ ((leading-prefix β–· HA) βˆ™ Pasted.target-evaluation)
    output-endpoint = normalize ⁻¹ βˆ™
      move-square (comp-assoc HA Ygf e) (product-image β–· HA) (e ◁ (Ο‡Y β–· HA))
        (comp-assoc HA (Yg ∘ Yf) e) (whisker-mixed-at Ο‡Y HA e)
      where
      q : (e ∘ (Yg ∘ Yf)) =₁ (Uf ∘ Yf)
      q = (Ξ² ⁻¹ β–· Yf) βˆ™ evaluation-associator ⁻¹
      final : (e ∘ ((Yg ∘ Yf) ∘ HA)) =₁ ((e ∘ (Yg ∘ Yf)) ∘ HA)
      final = (comp-assoc HA (Yg ∘ Yf) e) ⁻¹
      normalize : ((leading-prefix β–· HA) βˆ™ Pasted.target-evaluation) =β‚‚
        ((product-image β–· HA) βˆ™ final)
      normalize = isoComp-cong
        ((preWhisker HA ◁ prefix-cancellation) βˆ™ (preWhisker-isoComp-at leading-prefix q HA) ⁻¹)
        (idIso final) βˆ™ (isoComp-assoc-at (leading-prefix β–· HA) (q β–· HA) final) ⁻¹

  leading = leading-prefix βˆ™ funPre-uncurry f Fg
  pasted-image = e ◁ paste (Shg ⁻¹) (Shf ⁻¹)

  abstract
    leading-transfer : ((projected-prefix βˆ™ pasted-image) βˆ™ z) =β‚‚ ((leading β–· HA) βˆ™ uβ‚€)
    leading-transfer = isoComp-cong
      ((preWhisker-isoComp-at leading-prefix (funPre-uncurry f Fg) HA) ⁻¹) (idIso uβ‚€) βˆ™
      prefix-transfer (leading-prefix β–· HA) Pasted.target-evaluation projected-prefix pasted-image z
        (funPre-uncurry f Fg β–· HA) uβ‚€ output-endpoint core-transfer

  Sgf = productMap-separate h (g ∘ f)
  separation-image = e ◁ Sgf
  outer-associator = (comp-assoc Xgf HC e) ⁻¹
  product-composition = e ◁ (HC ◁ Ο‡X)
  prefix-associator = comp-assoc HA Ygf e
  prefix-composition = e ◁ (Ο‡Y β–· HA)

  abstract
    leading-normalization : Lifted.leading =β‚‚ leading
    leading-normalization = (isoComp-assoc-at product-image
        (evaluation-associator βˆ™ evaluation-beta) (funPre-uncurry f Fg)) ⁻¹ βˆ™
      isoComp-cong (idIso product-image)
        ((isoComp-assoc-at evaluation-associator evaluation-beta (funPre-uncurry f Fg)) ⁻¹)

    product-square :
      (separation-image βˆ™ (prefix-composition βˆ™ pasted-image)) =β‚‚ product-composition
    product-square =
      isoComp-unitΛ‘-at product-composition βˆ™
      (isoComp-cong
        (postWhisker-idIso e (HC ∘ Xgf) βˆ™
          ((postWhisker e ◁ isoComp-inverseΚ³-at Sgf) βˆ™
            (postWhisker-isoComp-at e Sgf (Sgf ⁻¹)) ⁻¹))
        (idIso product-composition) βˆ™
      ((isoComp-assoc-at separation-image (e ◁ Sgf ⁻¹) product-composition) ⁻¹ βˆ™
        isoComp-cong (idIso separation-image)
          (postWhisker-isoComp-at e (Sgf ⁻¹) (HC ◁ Ο‡X) βˆ™
            ((postWhisker e ◁ separate-composition h f g) βˆ™
              (postWhisker-isoComp-at e (Ο‡Y β–· HA) (paste (Shg ⁻¹) (Shf ⁻¹))) ⁻¹))))

    remove-prefix : (Lifted.prefix βˆ™ (projected-prefix βˆ™ pasted-image)) =β‚‚
      (outer-associator βˆ™ product-composition)
    remove-prefix = cancel-prefix outer-associator separation-image prefix-associator
      prefix-composition pasted-image product-composition product-square

    outer-square : (outer-associator βˆ™ product-composition) =β‚‚
      ((U ◁ Ο‡X) βˆ™ a₃ ⁻¹)
    outer-square = move-square (comp-assoc Xgf HC e) (U ◁ Ο‡X) product-composition a₃
      (postWhisker-comp-at Ο‡X HC e)

    finish : ((outer-associator βˆ™ product-composition) βˆ™ z) =β‚‚
      ((U ◁ Ο‡X) βˆ™ (aβ‚‚ βˆ™ (a₁ βˆ™ r)))
    finish = isoComp-cong (idIso (U ◁ Ο‡X)) (cancel-left a₃ (aβ‚‚ βˆ™ (a₁ βˆ™ r))) βˆ™
      (isoComp-assoc-at (U ◁ Ο‡X) (a₃ ⁻¹) z βˆ™ isoComp-cong outer-square (idIso z))

    comparison :
      (funPre-uncurry (g ∘ f) h βˆ™ funUncurryIso (preComp f g β–· h)) =β‚‚
      ((funUncurry h ◁ productRestriction-comp X f g) βˆ™
        (comp-assoc Xf Xg (funUncurry h) βˆ™
          ((funPre-uncurry g h β–· Xf) βˆ™
            (funPre-uncurry f (funPre g ∘ h) βˆ™ funUncurryIso (comp-assoc h (funPre g) (funPre f))))))
    comparison = close-comparison _ Lifted.prefix projected-prefix pasted-image z
      ((leading β–· HA) βˆ™ uβ‚€) (outer-associator βˆ™ product-composition) _
      (isoComp-cong (idIso Lifted.prefix)
        (isoComp-cong (preWhisker HA ◁ leading-normalization) (idIso uβ‚€)) βˆ™ Lifted.law)
      leading-transfer remove-prefix finish
```