Other Agda modules in this section (188)

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

# An insertion comparison with prescribed coordinate images

The two coordinates used by evaluation form an equivalence. Lifting the
desired coordinate comparisons through it chooses the insertion witness
for currying. Its images are retained, so both endpoint calculations can
use those comparisons directly. This changes only a chosen witness, not
the underlying coordinate permutation.

```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.Section07.FunctorCategories as Categories
import SCT.VolumeI.Chapter02.Section01.WalkingMorphism as Walking

module SCT.VolumeI.Chapter02.Section02.MorphismCalculus.CurryingInsertion
  {c m a : Level} (𝒯 : Theory c m a) (M : Mapping.MappingAnimae 𝒯)
  (β„± : Categories.FunctorCategories 𝒯 M) (I : Walking.WalkingMorphism 𝒯) where

open import SCT.VolumeI.Chapter02.Section01.Morphisms 𝒯 M β„± I public
import SCT.VolumeI.Chapter02.Section02.MorphismCalculus.UncurryingExpressionCoordinates as Coordinates
import SCT.VolumeI.Chapter01.Section03.ProductCalculus.NestedSymmetry as Symmetry
import SCT.VolumeI.Chapter01.Section04.ProductCalculus.ProductSubstitution as Substitution
import SCT.VolumeI.Chapter01.Section03.ProductCalculus.PairingNaturality as PN
import SCT.VolumeI.Chapter01.Section03.ProductCalculus.PairingUnits as PU
import SCT.VolumeI.Chapter01.Section02.Isomorphisms as Iso
open PN vocabulary terminal products productLaws composition vertical whiskering using (substitution-square-projection)
open PU vocabulary terminal products productLaws composition vertical whiskering pentagonTriangle using (cancel-right-reflect)
open Iso vocabulary terminal products productLaws composition vertical whiskering using (cancel-inverse)
open import SCT.VolumeI.Chapter01.Section04.ProductCalculus.ProductAssociativity 𝒯 M using (cancel-inverse-tail)

module At (Ξ“ X : CAT) where
  module Coordinate = Coordinates.Coordinates 𝒯 M β„± I Ξ“ X
  permutation = Coordinate.permutation
  first-coordinate : MAP ((Ξ“ Γ— X) Γ— [1]) (Ξ“ Γ— [1])
  first-coordinate = Coordinate.step
  second-coordinate : MAP ((Ξ“ Γ— X) Γ— [1]) X
  second-coordinate = Coordinate.fixed ∘ pr₁
  joint : MAP ((Ξ“ Γ— X) Γ— [1]) ((Ξ“ Γ— [1]) Γ— X)
  joint = pair first-coordinate second-coordinate

  joint-comparison : joint =₁ Symmetry.exchange 𝒯 {Ξ“} {X} {[1]}
  joint-comparison = pair-cong
    (pair-cong (idIso (pr₁ ∘ pr₁)) (comp-unitΛ‘ prβ‚‚))
    (comp-unitΛ‘ prβ‚‚ β–· pr₁)
  joint-isEquiv : IsEquiv joint
  joint-isEquiv = equiv-transport (joint-comparison ⁻¹) (Symmetry.exchange-isEquiv 𝒯 Ξ“ X [1])

  module Endpoint (z : Obj-abs [1]) where
    i = insert {X = Ξ“} z
    j = insert {X = Ξ“ Γ— X} z
    substitution = productMap i (id X)
    before = permutation ∘ substitution
    module Product = Substitution.Coordinates 𝒯 M X (id (Ξ“ Γ— [1])) i

    first-pasting : ((first-coordinate ∘ permutation) ∘ substitution) =₁ (first-coordinate ∘ j)
    first-pasting = insert-natural pr₁ z βˆ™
      (pair-β₁ (i ∘ pr₁) (id X ∘ prβ‚‚) βˆ™ (Coordinate.step-comparison β–· substitution))
    second-pasting : ((second-coordinate ∘ permutation) ∘ substitution) =₁ (second-coordinate ∘ j)
    second-pasting = (identity-boundary z Coordinate.fixed) ⁻¹ βˆ™
      (Product.second βˆ™ (Coordinate.second β–· substitution))
    first-image = first-pasting βˆ™ (comp-assoc substitution permutation first-coordinate) ⁻¹
    second-image = second-pasting βˆ™ (comp-assoc substitution permutation second-coordinate) ⁻¹

    first-frame : (u : MAP (Ξ“ Γ— X) ((Ξ“ Γ— X) Γ— [1])) β†’ (pr₁ ∘ (joint ∘ u)) =₁ (first-coordinate ∘ u)
    first-frame u = (pair-β₁ first-coordinate second-coordinate β–· u) βˆ™ (comp-assoc u joint pr₁) ⁻¹
    second-frame : (u : MAP (Ξ“ Γ— X) ((Ξ“ Γ— X) Γ— [1])) β†’ (prβ‚‚ ∘ (joint ∘ u)) =₁ (second-coordinate ∘ u)
    second-frame u = (pair-Ξ²β‚‚ first-coordinate second-coordinate β–· u) βˆ™ (comp-assoc u joint prβ‚‚) ⁻¹
    first-lift = (first-frame j) ⁻¹ βˆ™ (first-image βˆ™ first-frame before)
    second-lift = (second-frame j) ⁻¹ βˆ™ (second-image βˆ™ second-frame before)
    paired = pair-iso first-lift second-lift
    lifted = postWhisker-lift joint joint-isEquiv paired
    abstract
      comparison : before =₁ j
      comparison = FunctorLift.lift lifted
      comparison-image : (joint ◁ comparison) =β‚‚ paired
      comparison-image = FunctorLift.comparison lifted

    projection-image : {Y : CAT} (Ο€ : MAP ((Ξ“ Γ— [1]) Γ— X) Y) (q : MAP ((Ξ“ Γ— X) Γ— [1]) Y)
      (b : (Ο€ ∘ joint) =₁ q) (Ξ± : (q ∘ before) =₁ (q ∘ j)) β†’
      (Ο€ ◁ paired) =β‚‚ (((b β–· j) βˆ™ (comp-assoc j joint Ο€) ⁻¹) ⁻¹ βˆ™
        (Ξ± βˆ™ ((b β–· before) βˆ™ (comp-assoc before joint Ο€) ⁻¹))) β†’
      (q ◁ comparison) =β‚‚ Ξ±
    projection-image Ο€ q b Ξ± prescribed = cancel-right-reflect bh
      (cancel-inverse bk (Ξ± βˆ™ bh) βˆ™ isoComp-cong (idIso bk) prescribed βˆ™
        isoComp-cong (idIso bk) (postWhisker Ο€ ◁ comparison-image) βˆ™
        (substitution-square-projection Ο€ joint q b comparison) ⁻¹)
      where
      bh = (b β–· before) βˆ™ (comp-assoc before joint Ο€) ⁻¹
      bk = (b β–· j) βˆ™ (comp-assoc j joint Ο€) ⁻¹

    abstract
      first-prescribed : (first-coordinate ◁ comparison) =β‚‚ first-image
      first-prescribed = projection-image pr₁ first-coordinate (pair-β₁ first-coordinate second-coordinate)
        first-image (pair-iso-β₁ first-lift second-lift)
      second-prescribed : (second-coordinate ◁ comparison) =β‚‚ second-image
      second-prescribed = projection-image prβ‚‚ second-coordinate (pair-Ξ²β‚‚ first-coordinate second-coordinate)
        second-image (pair-iso-Ξ²β‚‚ first-lift second-lift)

      first-square : ((first-coordinate ◁ comparison) βˆ™ comp-assoc substitution permutation first-coordinate) =β‚‚ first-pasting
      first-square = cancel-inverse-tail first-pasting (comp-assoc substitution permutation first-coordinate) βˆ™
        isoComp-cong first-prescribed (idIso (comp-assoc substitution permutation first-coordinate))
      second-square : ((second-coordinate ◁ comparison) βˆ™ comp-assoc substitution permutation second-coordinate) =β‚‚ second-pasting
      second-square = cancel-inverse-tail second-pasting (comp-assoc substitution permutation second-coordinate) βˆ™
        isoComp-cong second-prescribed (idIso (comp-assoc substitution permutation second-coordinate))
```