Other Agda modules in this section (18)

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

# Hom functors and their endpoint coordinates

An identification in a hom category retains both endpoint equations.
Conversely, an endpoint-preserving identification of expressions gives
an identification between the corresponding hom functors.

```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.Chapter01.Section06.PullbackLaws as Laws
import SCT.VolumeI.Chapter02.Section01.WalkingMorphism as Walking

module SCT.VolumeI.Chapter02.Section06.HomCalculus.HomCoordinates
  {c m a : Level} (𝒯 : Theory c m a) (M : Mapping.MappingAnimae 𝒯)
  (β„± : Categories.FunctorCategories 𝒯 M) (P : Laws.PullbackStructure 𝒯)
  (I : Walking.WalkingMorphism 𝒯) where

open import SCT.VolumeI.Chapter02.Section01.HomAndSlices 𝒯 M β„± P I public
open import SCT.VolumeI.Chapter01.Section06.PullbackSquares 𝒯 P
import SCT.VolumeI.Chapter01.Section03.Equivalences as TerminalComparisons
open TerminalComparisons.TerminalTargets vocabulary terminal products productLaws composition
  using (terminal-Isoβ‚‚)
import SCT.VolumeI.Chapter01.Section03.ProductCalculus.PairingCoherence as PC
import SCT.VolumeI.Chapter01.Section03.ProductCalculus.PairingNaturality as PN
import SCT.VolumeI.Chapter01.Section03.IdentificationCalculus.Structural as Structural
open PC vocabulary terminal products productLaws composition vertical whiskering
  using (pair-cong-comp; pair-cong-Isoβ‚‚)
open PN vocabulary terminal products productLaws composition vertical whiskering
  using (pair-pre-natural-substitution; substitution-square-projection)
open Structural vocabulary terminal products productLaws composition whiskering
  using (postWhisker-comp-at)

module EncodeComparison {Ξ“ B C : CAT} (u v : MAP B C) (y : MAP Ξ“ B)
  {f g : MorphismExpression (u ∘ y) (v ∘ y)} (Φ : ExpressionIso f g) where
  private
    module F = MorphismExpression f
    module G = MorphismExpression g
    Ξ΄ = ExpressionIso.comparison Ξ¦
    p = pair-cong F.source-frame F.target-frame
    q = pair-cong G.source-frame G.target-frame
    before = pair-pre evβ‚€ ev₁ F.arrow
    after = pair-pre evβ‚€ ev₁ G.arrow
    r = (pair-pre u v y) ⁻¹
    d = pair-cong (evβ‚€ ◁ Ξ΄) (ev₁ ◁ Ξ΄)
    e = endpoints ◁ Ξ΄

    paired : (q βˆ™ d) =β‚‚ p
    paired = pair-cong-Isoβ‚‚ (ExpressionIso.source-compatible Ξ¦) (ExpressionIso.target-compatible Ξ¦) βˆ™
      (pair-cong-comp G.source-frame (evβ‚€ ◁ Ξ΄) G.target-frame (ev₁ ◁ Ξ΄)) ⁻¹

    matching : ((r βˆ™ (q βˆ™ after)) βˆ™ e) =β‚‚ (r βˆ™ (p βˆ™ before))
    matching = isoComp-cong (idIso r) (isoComp-cong paired (idIso before)) βˆ™
      (isoComp-cong (idIso r) ((isoComp-assoc-at q d before) ⁻¹) βˆ™
        (isoComp-cong (idIso r) (isoComp-cong (idIso q)
          ((pair-pre-natural-substitution evβ‚€ ev₁ Ξ΄) ⁻¹)) βˆ™
          (isoComp-cong (idIso r) (isoComp-assoc-at q after e) βˆ™
            isoComp-assoc-at r (q βˆ™ after) e)))

  comparison : ConeIso (EndpointFiber.cone u v y f) (EndpointFiber.cone u v y g)
  comparison = record { leftIso = Ξ΄ ; rightIso = idIso y
    ; compatible = (isoComp-unitΛ‘-at (r βˆ™ (p βˆ™ before)) βˆ™
        isoComp-cong (postWhisker-idIso (pair u v) y) (idIso (r βˆ™ (p βˆ™ before)))) ⁻¹ βˆ™ matching }

hom-cong : {Ξ“ C : CAT} {x y : Obj-abs C}
  {f g : MorphismExpression (const {P = Ξ“} x) (const y)} β†’
  ExpressionIso f g β†’ hom-intro f =₁ hom-intro g
hom-cong {Ξ“} {x = x} {y} Ξ¦ = pullbackLift-cong (EncodeComparison.comparison x y (terminate Ξ“) Ξ¦)

module ConstantBase {Ξ“ A C : CAT} (b : MAP A One) (x : Obj-abs C)
  {h k : MAP Ξ“ A} (Ξ± : h =₁ k) where
  th = terminal-iso (b ∘ h) (terminate Ξ“)
  tk = terminal-iso (b ∘ k) (terminate Ξ“)
  at-h = (x ◁ th) βˆ™ comp-assoc h b x
  at-k = (x ◁ tk) βˆ™ comp-assoc k b x

  natural : (at-k βˆ™ ((x ∘ b) ◁ Ξ±)) =β‚‚ at-h
  natural = isoComp-cong
    ((postWhisker x ◁ terminal-Isoβ‚‚ (tk βˆ™ (b ◁ Ξ±)) th) βˆ™
      (postWhisker-isoComp-at x tk (b ◁ Ξ±)) ⁻¹) (idIso (comp-assoc h b x)) βˆ™
    ((isoComp-assoc-at (x ◁ tk) (x ◁ (b ◁ Ξ±)) (comp-assoc h b x)) ⁻¹ βˆ™
      (isoComp-cong (idIso (x ◁ tk)) (postWhisker-comp-at Ξ± b x) βˆ™
        isoComp-assoc-at (x ◁ tk) (comp-assoc k b x) ((x ∘ b) ◁ Ξ±)))

module HomIdentification {Ξ“ C : CAT} {x y : Obj-abs C}
  {h k : MAP Ξ“ (Hom C x y)} (Ξ± : h =₁ k) where
  module H = EndpointFiber x y

  endpoint : (Ο€ : MAP (Ar C) C) (z : Obj-abs C) (frame : (Ο€ ∘ H.arrow) =₁ (z ∘ H.base)) β†’
    (((z ◁ terminal-iso (H.base ∘ k) (terminate Ξ“)) βˆ™
      (comp-assoc k H.base z βˆ™ ((frame β–· k) βˆ™ (comp-assoc k H.arrow Ο€) ⁻¹))) βˆ™
      (Ο€ ◁ (H.arrow ◁ Ξ±))) =β‚‚
    ((z ◁ terminal-iso (H.base ∘ h) (terminate Ξ“)) βˆ™
      (comp-assoc h H.base z βˆ™ ((frame β–· h) βˆ™ (comp-assoc h H.arrow Ο€) ⁻¹)))
  endpoint Ο€ z frame = isoComp-assoc-at nh Ah bh βˆ™
    (isoComp-cong (ConstantBase.natural H.base z Ξ±) (idIso bh) βˆ™
      ((isoComp-assoc-at (nk βˆ™ Ak) ((z ∘ H.base) ◁ Ξ±) bh) ⁻¹ βˆ™
        (isoComp-cong (idIso (nk βˆ™ Ak)) (substitution-square-projection Ο€ H.arrow (z ∘ H.base) frame Ξ±) βˆ™
          (isoComp-assoc-at (nk βˆ™ Ak) bk (Ο€ ◁ (H.arrow ◁ Ξ±)) βˆ™
            isoComp-cong ((isoComp-assoc-at nk Ak bk) ⁻¹) (idIso (Ο€ ◁ (H.arrow ◁ Ξ±)))))))
    where
    nh = z ◁ terminal-iso (H.base ∘ h) (terminate Ξ“)
    nk = z ◁ terminal-iso (H.base ∘ k) (terminate Ξ“)
    Ah = comp-assoc h H.base z
    Ak = comp-assoc k H.base z
    bh = (frame β–· h) βˆ™ (comp-assoc h H.arrow Ο€) ⁻¹
    bk = (frame β–· k) βˆ™ (comp-assoc k H.arrow Ο€) ⁻¹

  comparison : ExpressionIso (hom-expression h) (hom-expression k)
  comparison = record { comparison = H.arrow ◁ Ξ±
    ; source-compatible = endpoint evβ‚€ x H.source-frame
    ; target-compatible = endpoint ev₁ y H.target-frame }

hom-expression-cong : {Ξ“ C : CAT} {x y : Obj-abs C} {h k : MAP Ξ“ (Hom C x y)} β†’
  h =₁ k β†’ ExpressionIso (hom-expression h) (hom-expression k)
hom-expression-cong = HomIdentification.comparison
```